Maps an interface index into its corresponding name.
Standard C Library <libc.a>
#include <net/if.h> char *if_indextoname(unsigned int ifindex, char *ifname);
When the if_indextoname subroutine is called, the ifname parameter points to a buffer of at least IF_NAMESIZE bytes. The if_indextoname subroutine places the name of the interface in this buffer with the ifindex index.
If ifindex is an interface index, the if_indextoname Subroutine returns the ifname value, which points to a buffer containing the interface name. Otherwise, it returns a NULL pointer and sets the errno global value to indicate the error.
If there is no interface corresponding to the specified index, the errno global value is set to ENXIO. If a system error occurs (such as insufficient memory), the errno global value is set to the proper value (such as, ENOMEM).
ifindex | Possible interface index |
ifname | Possible name of an interface |
ENXIO | There is no interface corresponding to the specified index |
ENOMEM | Insufficient memory |
if_nametoindex Subroutine, if_indextoname Subroutine, and if_nameindex Subroutine.
Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.