tst_if_name_to_index - Maps an interface name into its corresponding index
To check if ifname is the name of an interface, the if_nametoindex() function shall return the interface index corresponding to name ifname.
./tst_if_name_to_index [-tooloption ...] -tooloption : v6api tool option
1. The argument ifname is the name of loopback interface lo, should return 1 2. The argument ifname is the name of interface Link0, should return 2
None
RFC 3493
4.1 Name-to-Index
The first function maps an interface name into its corresponding index.
#include <net/if.h>
unsigned int if_nametoindex(const char *ifname);
If ifname is the name of an interface, the if_nametoindex() function shall return the interface index corresponding to name ifname; otherwise, it shall return zero. No errors are defined.