if indextoname

Jump to: navigation, search

Table of Contents >> IPv6 Programmer's Reference

#include <trsocket.h>

int indextoname (
unsigned int ifindex,
char * ifname

Function Description

This function supports both IPv4 and IPv6. Refer to [RFC 2553]. Maps an interface index into its corresponding interface name.


  • ifindex
    Interface index
  • ifname
    Interface name. The ifname argument must point to a buffer of at least IF_NAMESIZE bytes into which the interface name corresponding to the specified index is returned.


  • NULL
    Failed. Call tfGetSocketError() for the specific error code.
  • !=NULL
    Pointer to interface name

If if_indextoname fails, the error code can be retrieved with tfGetSocketError() which will return one of the following:

    There is no interface corresponding to the specified index.
    Bad parameter value.

Table of Contents >> IPv6 Programmer's Reference