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

Chapter 12  Identifying Local Interface Names and Indexes

» 

Technical documentation

Complete book in PDF

 » Table of Contents

The IPv6 sockets API uses an interface index (a small positive integer) to identify the local interface joined to a multicast group. Interfaces are normally known by names such as "lan0”. On HP-UX implementations, when the system configures an interface, the kernel assigns a unique positive integer value (called the interface index) to that interface. These small positive integers start at one. Interface numbering is not necessarily contiguous.

This API defines:

  • two functions that map between an interface name and index:

    • if_nametoindex()

    • if_indextoname()

  • a function that returns all interface names and indexes:

    • if_nameindex()

  • a function to return the dynamic memory allocated by the previous function:

    • if_freenameindex()

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