Embedded TCP/IP stack: fnet_inet_ntop

FNET

Embedded TCP/IP stack  4.1.0
fnet_char_t* fnet_inet_ntop ( fnet_address_family_t  family,
const void *  addr,
fnet_char_t str,
fnet_size_t  str_len 
)

Converts IPv4 or IPv6 address from binary to text form.

Parameters
familyThe address family (AF_INET or AF_INET6).
addrPointer to the IP address in network-byte order.
strPointer to a buffer in which to store the NULL-terminated string representation of the IP address.
For an IPv4 address, the str buffer must be at least 16 bytes long (FNET_IP4_ADDR_STR_SIZE).
For an IPv6 address, the str buffer must be at least 46 bytes long (FNET_IP6_ADDR_STR_SIZE).
str_lenLength of the str buffer.
Returns
This function returns:
  • pointer to a buffer containing the string representation of IP address (the str), if no error occurs,
  • FNET_NULL if an error occurs.
See also
fnet_inet_pton()

This function converts the network address structure, specified by the addr parameter, in the addr_family address family into a character string. The resulting string is copied to the buffer pointed to by str.

Note
fnet_inet_ntop() extends the fnet_inet_ntoa() function to support multiple address families.
fnet_inet_ntoa() is now considered to be deprecated.

© 2005-2018 by Andrey Butok. http://fnet.sourceforge.net