Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

intf-win32.c File Reference

#include "config.h"
#include <iphlpapi.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dnet.h"

Go to the source code of this file.

Defines

#define MIB_IF_TYPE_MAX   32

Functions

static char * _ifcombo_name (int type)
static int _ifcombo_type (const char *device)
static void _ifcombo_add (struct ifcombo *ifc, DWORD idx)
static void _ifrow_to_entry (intf_t *intf, MIB_IFROW *ifrow, struct intf_entry *entry)
static int _refresh_tables (intf_t *intf)
static int _find_ifindex (intf_t *intf, const char *device)
intf_tintf_open (void)
int intf_get (intf_t *intf, struct intf_entry *entry)
int intf_get_src (intf_t *intf, struct intf_entry *entry, struct addr *src)
int intf_get_dst (intf_t *intf, struct intf_entry *entry, struct addr *dst)
int intf_set (intf_t *intf, const struct intf_entry *entry)
int intf_loop (intf_t *intf, intf_handler callback, void *arg)
intf_tintf_close (intf_t *intf)


Define Documentation

#define MIB_IF_TYPE_MAX   32
 

Definition at line 27 of file intf-win32.c.

Referenced by _refresh_tables(), and intf_close().


Function Documentation

static int _find_ifindex intf_t intf,
const char *  device
[static]
 

Definition at line 201 of file intf-win32.c.

References _ifcombo_type(), ifcombo::idx, and intf_handle::ifcombo.

Referenced by intf_get(), and intf_set().

static void _ifcombo_add struct ifcombo ifc,
DWORD  idx
[static]
 

Definition at line 78 of file intf-win32.c.

Referenced by _refresh_tables().

static char* _ifcombo_name int  type  )  [static]
 

Definition at line 36 of file intf-win32.c.

Referenced by _ifrow_to_entry().

static int _ifcombo_type const char *  device  )  [static]
 

Definition at line 57 of file intf-win32.c.

References INTF_TYPE_ETH, INTF_TYPE_FDDI, INTF_TYPE_LOOPBACK, INTF_TYPE_OTHER, INTF_TYPE_PPP, INTF_TYPE_SLIP, and INTF_TYPE_TOKENRING.

Referenced by _find_ifindex().

static void _ifrow_to_entry intf_t intf,
MIB_IFROW *  ifrow,
struct intf_entry entry
[static]
 

Definition at line 94 of file intf-win32.c.

References _ifcombo_name(), addr::addr_bits, addr_mtob(), addr::addr_type, ADDR_TYPE_ETH, ADDR_TYPE_IP, ADDR_TYPE_NONE, ETH_ADDR_BITS, ETH_ADDR_LEN, ifcombo::idx, intf_handle::ifcombo, INTF_FLAG_LOOPBACK, INTF_FLAG_MULTICAST, INTF_FLAG_UP, IP_ADDR_LEN, intf_handle::iptable, memcpy, memset, and snprintf.

Referenced by intf_get(), intf_get_dst(), intf_get_src(), and intf_loop().

static int _refresh_tables intf_t intf  )  [static]
 

Definition at line 157 of file intf-win32.c.

References _ifcombo_add(), FALSE, GetIfTable(), GetIpAddrTable(), intf_handle::ifcombo, intf_handle::iftable, intf_handle::iptable, and MIB_IF_TYPE_MAX.

Referenced by intf_get(), intf_get_dst(), intf_get_src(), and intf_loop().

intf_t* intf_close intf_t intf  ) 
 

Definition at line 339 of file intf-win32.c.

References MIB_IF_TYPE_MAX, and NULL.

int intf_get intf_t intf,
struct intf_entry entry
 

Definition at line 219 of file intf-win32.c.

References _find_ifindex(), _ifrow_to_entry(), _refresh_tables(), GetIfEntry(), and intf_entry::intf_name.

int intf_get_dst intf_t intf,
struct intf_entry entry,
struct addr dst
 

Definition at line 265 of file intf-win32.c.

References _ifrow_to_entry(), _refresh_tables(), addr::addr_type, ADDR_TYPE_IP, errno, GetBestInterface(), and GetIfEntry().

int intf_get_src intf_t intf,
struct intf_entry entry,
struct addr src
 

Definition at line 237 of file intf-win32.c.

References _ifrow_to_entry(), _refresh_tables(), addr::addr_type, ADDR_TYPE_IP, errno, GetIfEntry(), and intf_handle::iptable.

int intf_loop intf_t intf,
intf_handler  callback,
void *  arg
 

Definition at line 318 of file intf-win32.c.

References _ifrow_to_entry(), _refresh_tables(), intf_handle::iftable, and intf_entry::intf_len.

intf_t* intf_open void   ) 
 

Definition at line 213 of file intf-win32.c.

int intf_set intf_t intf,
const struct intf_entry entry
 

Definition at line 288 of file intf-win32.c.

References _find_ifindex(), AddIPAddress(), addr::addr_bits, addr_btom(), addr::addr_type, ADDR_TYPE_IP, errno, intf_entry::intf_addr, intf_entry::intf_name, IP_ADDR_LEN, and memcpy.


Generated on Sun May 14 14:51:22 2006 by  doxygen 1.4.2