Previous section.

Technical Standard: Networking Services (XNS), Issue 5.2 Draft 2.0
Copyright © 1999 The Open Group

NAME

if_nametoindex - map an interface name to its corresponding index

SYNOPSIS


#include <net/if.h>

unsigned int if_nametoindex(const char *ifname);


DESCRIPTION

Returns the interface index corresponding to name ifname.

RETURN VALUE

The corresponding index if ifname is the name of an interface; zero otherwise.

ERRORS

[EFAULT]
The buffer pointed to by ifname can not be accessed.

SEE ALSO

getsockopt(), if_freenameindex(), if_indextoname(), if_nameindex(), setsockopt(), <net/if.h>.

CHANGE HISTORY

First released in Issue 5.2.

Contents Next section Index