ifiter_getifaddrs.c File Reference

Obtain the list of network interfaces using the getifaddrs(3) library. More...

#include <ifaddrs.h>

Go to the source code of this file.

Data Structures

struct  isc_interfaceiter
 Iterator structure. More...

Defines

#define IFITER_MAGIC   ISC_MAGIC('I', 'F', 'I', 'G')
 Iterator Magic.
#define VALID_IFITER(t)   ISC_MAGIC_VALID(t, IFITER_MAGIC)
 Valid Iterator.

Functions

isc_result_t isc_interfaceiter_create (isc_mem_t *mctx, isc_interfaceiter_t **iterp)
 Create an iterator for traversing the operating system's list of network interfaces.
static isc_result_t internal_current (isc_interfaceiter_t *iter)
static isc_result_t internal_next (isc_interfaceiter_t *iter)
static void internal_destroy (isc_interfaceiter_t *iter)
static void internal_first (isc_interfaceiter_t *iter)


Detailed Description

Obtain the list of network interfaces using the getifaddrs(3) library.

Definition in file ifiter_getifaddrs.c.


Define Documentation

#define IFITER_MAGIC   ISC_MAGIC('I', 'F', 'I', 'G')

Iterator Magic.

Definition at line 28 of file ifiter_getifaddrs.c.

Referenced by isc_interfaceiter_create().

#define VALID_IFITER (  )     ISC_MAGIC_VALID(t, IFITER_MAGIC)

Valid Iterator.

Definition at line 30 of file ifiter_getifaddrs.c.

Referenced by internal_current(), internal_current4(), isc_interfaceiter_destroy(), isc_interfaceiter_first(), and isc_interfaceiter_next().


Function Documentation

isc_result_t isc_interfaceiter_create ( isc_mem_t mctx,
isc_interfaceiter_t **  iterp 
)

Create an iterator for traversing the operating system's list of network interfaces.

Returns:

Definition at line 54 of file ifiter_getifaddrs.c.

References isc_interfaceiter::buf, isc_interfaceiter::bufsize, isc_interfaceiter::ifaddrs, IFITER_MAGIC, isc__strerror(), isc_mem_get, isc_mem_put, ISC_MSG_GETIFADDRS, isc_msgcat_get(), ISC_MSGSET_IFITERGETIFADDRS, ISC_R_FAILURE, ISC_R_NOMEMORY, ISC_R_SUCCESS, ISC_R_UNEXPECTED, ISC_STRERRORSIZE, isc_interfaceiter::magic, isc_interfaceiter::mctx, isc_interfaceiter::pos, REQUIRE, isc_interfaceiter::result, and UNEXPECTED_ERROR.

static isc_result_t internal_current ( isc_interfaceiter_t iter  )  [static]

Definition at line 126 of file ifiter_getifaddrs.c.

References isc_interface::address, isc_interface::af, AF_INET6, isc_interfaceiter::current, isc_interface::dstaddress, isc_interface::flags, get_addr(), INSIST, INTERFACE_F_LOOPBACK, INTERFACE_F_POINTTOPOINT, INTERFACE_F_UP, ISC_R_IGNORE, ISC_R_SUCCESS, ISC_TRUE, isc_interface::name, isc_interface::netmask, isc_interfaceiter::pos, REQUIRE, and VALID_IFITER.

Referenced by isc_interfaceiter_first(), and isc_interfaceiter_next().

static isc_result_t internal_next ( isc_interfaceiter_t iter  )  [static]

Definition at line 199 of file ifiter_getifaddrs.c.

References ISC_R_NOMORE, ISC_R_SUCCESS, and isc_interfaceiter::pos.

Referenced by isc_interfaceiter_first(), and isc_interfaceiter_next().

static void internal_destroy ( isc_interfaceiter_t iter  )  [static]

Definition at line 215 of file ifiter_getifaddrs.c.

References isc_interfaceiter::ifaddrs.

Referenced by isc_interfaceiter_destroy().

static void internal_first ( isc_interfaceiter_t iter  )  [static]

Definition at line 228 of file ifiter_getifaddrs.c.

References isc_interfaceiter::ifaddrs, and isc_interfaceiter::pos.

Referenced by isc_interfaceiter_first().


Generated on Tue Apr 28 17:41:19 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha