Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

if_nametoindex() - convert interface name to interface index

&pagelevel(3)&pagelevel

#include <net.if.h>

unsigned int if_nametoindex(const char * ifname);


Description

The function if_nametoindex() returns the interface index corresponding to the specified interface name. ifname is a null-terminated string containing the interface name.

Return value

If execution is successful, if_nametoindex() returns the interface index. Otherwise 0 is returned

Errors indicated by errno

No errors are defined.