Determines the interface name associated with a particular index. The second of four functions, if_indextoname maps an interface index into its corresponding name.
Library (libinet.a)
#include <net/if.h>> char * if_indextoname (index, ifname) unsigned int index; char *ifname;
The second of four functions for Interface Identification. The first argument is the interface index whose name is to be retrieved. The second argument is a buffer of at least IFNAMSIZ bytes, into which the name is to be copied.
Note: The if_indextoname argument must point to a buffer of at least IFNAMESIZ bytes into which the interface name corresponding to the specified index is returned. IFNAMSIZ is also defined in <net/if.h> and its value includes a terminating null byte at the end of the interface name.
If successful, if_indextoname returns a pointer to a valid name corresponding to the specified index. A null pointer is returned if no interface name corresponds to the specified index.
The if_nametoindex subroutine, if_nameindex subroutine, and if_freenameindex subroutine.
Subroutines Overview in AIX Version 4 General Programming Concepts: Writing and Debugging Programs.