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

Because IPv6 and IPv4 addresses have a different format and size, changes are required when formatting these addresses for presentation purposes. Two utility functions have been introduced for a selected set of socket APIs to help applications perform this processing. A formatted IPv6 address uses significantly more space than a formatted IPv4 address (46 bytes versus 16 bytes) and this might affect the layout of any messages and displays that include an IP address.
Table 1. Address conversion function changes
Affected API call Required changes
Translating an IP address from numeric form to presentation form using inet_ntoa() Convert to use inet_ntop() function. This function can be used for both IPv4 and IPv6 addresses.
Translating a presentation form IP address to numeric form using inet_addr() Convert to use inet_pton() function. This function can be used for both IPv4 and IPv6 addresses.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014