NAME

  tst_if_index_to_name - Maps an interface index into its corresponding name


PURPOSE

  To check if ifindex is an interface index then the function
  shall return the value supplied in ifname, which points to
  a buffer now containing the interface name.


SYNOPSIS

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


TEST PROCEDURE

  1. The argument ifindex is the interface index of lo, shall return ifname "lo"
  2. The argument ifindex is the interface index of Link0, shall return "Link0 name"


NOTE

  None


REFERENCE

  RFC 3493
  4.2 Index-to-Name
    The second function maps an interface index into its corresponding
    name.
      #include <net/if.h>
      char  *if_indextoname(unsigned int ifindex, char *ifname);
    When this function is called, the ifname argument shall point to a
    buffer of at least IF_NAMESIZE bytes.  The function shall place in
    this buffer the name of the interface with index ifindex.
    (IF_NAMESIZE is also defined in <net/if.h> and its value includes a
    terminating null byte at the end of the interface name.)  If ifindex
    is an interface index, then the function shall return the value
    supplied in ifname, which points to a buffer now containing the
    interface name.  Otherwise, the function shall return a NULL pointer
    and set errno to indicate the error.  If there is no interface
    corresponding to the specified index, errno is set to ENXIO.  If
    there was a system error (such as running out of memory), errno would
    be set to the proper value (e.g., ENOMEM).