Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Homepage FreeRTOS+ Products FreeRTOS Labs Integration Services Contact / Enquiries


[FreeRTOS Embedded IP Stack API]

void FreeRTOS_inet_ntoa( uint32_t ulIPAddress, uint8_t *pucBuffer )

A macro that converts an IP address expressed as a 32-bit number in network byte order to a string in decimal dot notation (for example "").

The standard Berkeley sockets inet_ntoa() function returns a pointer to a string that is normally stored in a global buffer. FreeRTOS_inet_ntoa() deviates from the normal semantics by instead taking the buffer into which the string is written as a parameter. The deviation is to ensure the macro is re-entrant and thread aware.


ulIPAddress   An IP address expressed as a 32-bit value in network byte order.

pucBuffer   A pointer to a buffer into which the IP address will be written in decimal dot notation.

Example usage:

The example on the FreeRTOS_recvfrom() documentation page demonstrates FreeRTOS_inet_ntoa() being used to print the IP address from which a message was received.

The example on the FreeRTOS_GetAddressConfiguration() documentation page demonstrates FreeRTOS_inet_ntoa() being used to print out the network configuration - including the IP address and net mask of the node, and the IP addresses of the gateway and DNS server respectively.

[ Back to the top ]    [ About FreeRTOS ]    [ FreeRTOS+ Sitemap ]    [ Main FreeRTOS Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.