if_nametoindex()

Map an interface name to its index

Synopsis:

#include <net/if.h>

unsigned int if_nametoindex( const char * ifname );

Since:

BlackBerry 10.0.0

Arguments:

ifname
The interface name that you want to map.

Library:

libsocket

Use the -l socket option to qcc to link against this library.

Description:

The if_nametoindex() function maps the interface name specified by ifname to its corresponding index.

Returns:

The index number of the interface, or 0 if the specified interface couldn't be found or an error occurred while using getifaddrs() to retrieve the list of interfaces.

Classification:

POSIX 1003.1

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus