HPlogo HP-UX IPv6 Porting Guide: HP-UX 11i v2 September 2004 > Chapter 12  Identifying Local Interface Names and Indexes

Name-to-Index

» 

Technical documentation

Complete book in PDF

 » Table of Contents

The first function maps an interface name into its corresponding index.

Header Files

#include <net/if.h>

Syntax

unsigned int  if_nametoindex(const char *ifname);

If the specified interface name does not exist, the function returns a value of zero, and sets errno to ENXIO. If a system error occurred (such as running out of memory), the function returns a value of zero and sets errno to the proper value (such as ENOMEM).

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