IF_NAMETOINDEX(3) Library Functions Manual IF_NAMETOINDEX(3)
NAME
if_nametoindex —
map a network interface name to its corresponding
index
SYNOPSIS
#include
<net/if.h>
unsigned if_nametoindex(const char *ifname);
DESCRIPTION
The if_nametoindex () function shall
return the interface index corresponding to name
ifname.
RETURN VALUE
The corresponding index if ifname is the name of an interface; otherwise, zero.
ERRORS
No errors are defined.
EXAMPLES
None.
APPLICATION USAGE
None.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
getsockopt(3), if_freenameindex(3), if_indextoname(3), if_nameindex(3), setsockopt(3)
XBD <net/if.h>
CHANGE HISTORY
First released in Issue 6. Derived from the XNS, Issue 5.2 specification.
January 31, 2018 posix.fail