HPlogo HP-UX IPv6 Porting Guide: HP-UX 11i v2 September 2004

Chapter 13 Configuring or Querying an Interface using IPv6 ioctl() Function Calls

» 

Technical documentation

Complete book in PDF

 » Table of Contents

Certain IPv4 applications need detailed configuration information for a network interface of a node. They use the SIOCGIFCONF, SIOCGIFADDR, SIOCGIFFLAGS, and other ioctl() function calls, as defined in /usr/include/sys/ioctl.h, to determine the characteristics of the network interfaces and their attributes.

All of the IPv4 SIOC* ioctl() function calls use the struct ifreq data structure (defined in /usr/include/net/if.h) as one of the arguments for the SIOC* ioctl() function calls. However, the ifreq data structure defined for IPv4 is not large enough to hold an IPv6 address. Therefore, the existing IPv4 SIOC* and their associated data structures are not applicable for IPv6 applications.

New ioctl() function calls for IPv6-applications-follow the SIOCSL* and SIOCGL* ioctl() name format. IPv6 ioctl() function calls also use a larger data structure described below. They are otherwise identical to the IPv4 ioctl() function calls.

NOTE: The IPv6 SIOCSL* and SIOCGL* ioctl() function calls are not supported for IPv4 applications.

Definitions for both IPv6 and IPv4 ioctl() function calls are in /usr/include/sys/ioctl.h.

NOTE: Use a larger data structure for IPv6 addresses. IPv6 addresses cannot fit into the IPv4 struct ifreq data structure used by IPv4 SIOC* ioctl() function calls. IPv6 applications pass, as a parameter to IPv6 ioctl()function calls, the data structures struct if_laddrreq and struct if_laddrconf.

Both IPv6 and IPv4 ioctl() data structures are in /usr/include/net/if.h.

© 2004 Hewlett-Packard Development Company, L.P.