Converts IPv4 or IPv6 address from binary to text form.
- Parameters
-
family | The address family (AF_INET or AF_INET6). |
addr | Pointer to the IP address in network-byte order. |
str | Pointer 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_len | Length 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.