Embedded TCP/IP stack  4.7.0

◆ fnet_inet_pton()

fnet_return_t fnet_inet_pton ( fnet_address_family_t  family,
const fnet_char_t str,
void *  addr,
fnet_size_t  addr_len 
)

Converts IPv4 and IPv6 addresses from text to binary form.

Parameters
familyThe address family (AF_INET or AF_INET6).
strNull-terminated character string that contains the text representation of the IP address to convert to numeric binary form.
addrPointer to a buffer in which to store the numeric binary representation of the IP address str.
addr_lenLength of the addr buffer.
Returns
This function returns:
  • FNET_OK if no error occurs.
  • FNET_ERR if the string in the str parameter does not contain a legitimate Internet address.
See also
fnet_inet_ntop()

This function converts the character string src into a network address structure in the addr_family address family, then copies the network address structure to the addr buffer.

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

© 2005-2020 by Andrej Butok. http://fnet.sourceforge.net