PTON

The PTON macro converts an IP address in its standard text presentation form to its numeric binary form. On successful completion, PTON returns the converted IP address in the buffer provided.

The following requirements apply to this call:
Read syntax diagramSkip visual syntax diagram
>>-EZASMI--TYPE=PTON--,AF--=--+-'INET'---+---------------------->
                              +-'INET6'--+   
                              +-address--+   
                              +-*indaddr-+   
                              '-(reg)----'   

>--,SRCADDR--=--+-address--+--,SRCLEN--=--+-address--+---------->
                +-*indaddr-+              +-*indaddr-+   
                '-(reg)----'              '-(reg)----'   

>--,DSTADDR--=--+-address--+--,ERRNO--=--+-address--+----------->
                +-*indaddr-+             +-*indaddr-+   
                '-(reg)----'             '-(reg)----'   

>--,RETCODE--=--+-address--+--+-------------------------+------><
                +-*indaddr-+  '-,ERROR--=--+-address--+-'   
                '-(reg)----'               +-*indaddr-+     
                                           '-(reg)----'     

Keyword
Description
AF
Input parameter. Specify one of the following:
Value
Description
'INET' or a decimal '2'
Indicates the address being converted is an IPv4 address.
'INET6' or a decimal '19'
Indicates the address being converted is an IPv6 address.

AF can also indicate a fullword binary number specifying the address family.

SRCADDR
Input parameter. A field containing the standard text presentation form of the IPv4 or IPv6 address being converted. For IPv4 the address must be in dotted-decimal format and for IPv6 the address must be in colon-hex format. The size of the field for an IPv4 address must be 15 bytes and the size for an IPv6 address must be 45 bytes.
SRCLEN
Input parameter. A binary halfword field that must contain the length of the IP address to be converted.
DSTADDR
A field used to receive the numeric binary form of the IPv4 or IPv6 address being converted in network byte order. For an IPv4 address, this field must be a fullword. For an IPv6 address, this field must be 16 bytes.
ERRNO
Output parameter. A fullword binary field. If RETCODE is negative, ERRNO contains a valid error number. Otherwise, ignore the ERRNO field.

See Socket call error return codes for information about ERRNO return codes.

RETCODE
A fullword binary field that returns one of the following values:
Value
Description
0
Successful call.
–1
Check ERRNO for an error code.
ERROR
Input parameter. The location in your program to receive control when the application programming interface (API) processing module cannot be loaded.