Retrieves the interface index associated with a particular interface name. The first of four functions, if_nametoindex maps an interface name into its corresponding index.
Library (libinet.a)
#include <net/if.h> unsigned int if_nametoindex (ifname) const char *ifname
The first of four functions for Interface Identification. The argument is a null-terminated interface name (for example, en0 , tr1 , ....).
If successful, if_nametoindex returns the interface index associated with the name. If unsuccessful, 0 (zero) is returned.
The if_indextoname subroutine, if_nameindex subroutine, and if_freenameindex subroutine.
Subroutines Overview in AIX Version 4 General Programming Concepts: Writing and Debugging Programs.