Loading...
Select Version
&pagelevel(3)&pagelevel
#include <sys.socket.h>
#include <net.if.h>
char * if_indextoname(unsigned int ifindex, char * ifname);
Description
The function if_indextoname() returns the interface name corresponding to the specified interface index. To achieve this, a pointer to a buffer of minimum length IF_NAMESIZE (present in <net.if.h>) is supplied in ifname.
Return value
If execution is successful, if_indextoname() returns the interface name stored in ifname. Otherwise a NULL pointer is returned
Errors indicated by errno
ENXIO
No interface name corresponding to the specified index was found.