Updated: April 19, 2023 |
Return a list of interfaces
#include <net/if.h> struct if_nameindex * if_nameindex( void );
The if_nameindex() function returns an array of if_nameindex structures, with one structure per interface, as defined in the include file <net/if.h>. The if_nameindex structure contains at least the following members:
The end of the array of structures is indicated by an entry with an if_index of 0 and an if_name of NULL.
A valid array of if_nameindex structures, or NULL if and error occurred while using getifaddrs() to retrieve the list, or there wasn't enough memory available.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |