inet_pton()

convert address from presentation format to network format 

Function


SYNOPSIS

#include <arpa/inet.h>

char *inet_pton(int af, const char *src, void *dst);


DESCRIPTION

The inet_pton() function converts an address from presentation format to network format (usually a struct in_addr, struct in6_addr, or some other binary form, in network byte order).


PARAMETERS

af 

Specifies the address family. Currently, only AF_INET and AF_INET6 are supported.

src 

Points to the presentation-format address. The format of the address is interpreted according to af.

dst 

Points to the buffer into which the converted address is stored..


RETURN VALUES

On success, the inet_pton() function returns 1. If the address was not parsable in the specified address family, inet_pton() returns 0. Otherwise, it returns -1, and sets errno to one of the following:

EAFNOSUPPORT 

The address family specified in af is not supported by this function.


CONFORMANCE

PTC MKS Toolkit UNIX APIs extension.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

The implementation of this function is taken from the Bind resolver implementation from the Internet Software Consortium.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
inet_addr(), inet_aton(), inet_lnaof(), inet_makeaddr(), inet_net_ntop(), inet_net_pton(), inet_neta(), inet_netof(), inet_network(), inet_ntoa(), inet_ntop()


PTC MKS Toolkit 10.4 Documentation Build 39.