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


Interface identification

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

IPv6 interfaces can have many different IP addresses. IPv6 allows a socket application to specify an interface to use for sending data by specifying an interface index. Certain socket options allow specification of an interface index. Also, socket options for IPv6 multicast join group and IPv6 multicast leave group allow optional specification of an interface index.

The IPv6 resolver interface enables a socket application to specify interface index or interface name on getaddrinfo calls to initialize the zone index field in the sockaddr structure information for link-local IPv6 addresses. The getnameinfo calls return the interface index or interface name for input link-local IPv6 addresses when the sockaddr structure contains the zone index. See Scope information about getaddrinfo calls for more information. Some z/OS® applications use this resolver capability to enable users to include interface (or scope) information as part of host name or IPv6 address information passed to the resolver. See Table 1 for a list of the applications that support for this function.

The function if_nameindex() allows socket applications to obtain a list of interface names and their corresponding indexes. The functions if_nametoindex() and if_indextoname() allow translation of an interface name to an interface index and translation of an interface index to an interface name. The function if_freenameindex() is used to free dynamic storage allocated by the if_nameindex() function.

For non-C/C++ (Language Environment® applications), a new ioctl function code (SIOCGIFNAMEINDEX) is provided. Use Table 1 to determine which APIs support this new ioctl.

Table 1. Function calls
Function/IOCTL z/OS UNIX Assembler Callable services C/C++ using Language Environment IP CICS® C sockets REXX Socket Extended macro/call (includes CICS EZASOKET)
if_nametoindex No Yes Yes No No
if_indextoname No Yes Yes No No
if_nameindex No Yes Yes No No
SIOCGIFNAMEINDEX Yes No No Yes Yes
if_freenameindex No Yes Yes No No

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014