Maps an interface index to its corresponding name. Format #include <if.h> char *if_indextoname ( unsigned int ifindex, char *ifname );
1 – Arguments
ifindex The interface index. ifname Points to a buffer that is IFNAMSIZ bytes in length. (IFNAMSIZ is defined in the IF.H header file.) If an interface name is found, it is returned in the buffer.
2 – Description
This function maps an interface index to its corresponding name.
3 – Return Values
Interface name If interface name is found, it is returned to the buffer. NULL If no interface name corresponds to the specified index, the function returns NULL and sets errno to ENXIO.
4 – Errors
ENXIO No interface name corresponds to the specified index. System error A system error.