Maps an interface name to its corresponding index.
Standard C Library (libc.a)
#include <net/if.h>
unsigned int if_nametoindex(const char *ifname);
If the ifname parameter is the name of an interface, the if_nametoindex subroutine returns the interface index corresponding to the ifname name. If the ifname parameter is not the name of an interface, the if_nametoindex subroutine returns a 0 and the errno global variable is set to the appropriate value.
Item | Description |
---|---|
ifname | Possible name of an interface. |