QNX Developer Support
|This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.|
Convert an Internet network number from CIDR format to network format
#include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> int inet_net_pton( int af, const char * src, void * dst, size_t size );
- The address family. Currently, only AF_INET is supported.
- A pointer to the presentation-format (CIDR) address. The format of the address is interpreted according to af.
- A pointer to the buffer where the function can store the converted address.
- The size of the buffer pointed to by dst, in bytes.
Use the -l socket option to qcc to link against this library.
The inet_net_pton() function converts an Internet network number from presentation format -- a printable form as held in a character string, such as, Internet standard dot notation, or Classless Internet Domain Routing (CIDR) -- to network format (usually a struct in_addr or some other internal binary representation, in network byte order).
For more information on Internet addresses, see inet_net_ntop().
The number of bits that specify the network number (computed based on the class, or specified with /CIDR), or -1 if an error occurred (errno is set).
- Invalid argument af.