z/OS Communications Server: IPv6 Network and Application Design Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Address conversion functions

z/OS Communications Server: IPv6 Network and Application Design Guide
SC27-3663-00

IP addresses often need to be given to a socket application in character (string) format. It is also common for socket applications to need to display IP addresses in string format. The following functions work for IPv4 and IPv6 addresses:
inet_ntop
Convert a binary IP address (either IPv4 or IPv6) into string format.
inet_pton
Convert an IP address in string format to binary format.

The functions inet_ntoa and inet_addr are still available, but they cannot be used for IPv6 addresses.

Table 1. Address conversion functions
Function z/OS® UNIX Assembler Callable services C/C++ using Language Environment® IP CICS® C sockets REXX Socket Extended macro/call (includes CICS EZASOKET)
inet_pton No Yes Yes No No
inet_ntop No Yes Yes No No
PTON No No No No Yes
NTOP No No No No Yes

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014