NAME

  tst_if_name_to_index - Maps an interface name into its corresponding index


PURPOSE

   To check if ifname is the name of an interface, the if_nametoindex()
   function shall return the interface index corresponding to name ifname.


SYNOPSIS

  ./tst_if_name_to_index [-tooloption ...]
    -tooloption : v6api tool option


TEST PROCEDURE

  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


NOTE

  None


REFERENCE

  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.