#include "config.h"
#include <sys/param.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "dnet.h"
Go to the source code of this file.
Classes | |
struct | intf_handle |
Defines | |
#define | NEXTIFR(i) (i + 1) |
Functions | |
static int | intf_flags_to_iff (u_short flags, int iff) |
static u_int | intf_iff_to_flags (int iff) |
intf_t * | intf_open (void) |
static int | _intf_delete_addrs (intf_t *intf, struct intf_entry *entry) |
static int | _intf_delete_aliases (intf_t *intf, struct intf_entry *entry) |
static int | _intf_add_aliases (intf_t *intf, const struct intf_entry *entry) |
int | intf_set (intf_t *intf, const struct intf_entry *entry) |
static void | _intf_set_type (struct intf_entry *entry) |
static int | _intf_get_noalias (intf_t *intf, struct intf_entry *entry) |
static int | _intf_get_aliases (intf_t *intf, struct intf_entry *entry) |
int | intf_get (intf_t *intf, struct intf_entry *entry) |
static int | _match_intf_src (const struct intf_entry *entry, void *arg) |
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_loop (intf_t *intf, intf_handler callback, void *arg) |
intf_t * | intf_close (intf_t *intf) |
|
Definition at line 63 of file intf.c. Referenced by _intf_get_aliases(), and intf_loop(). |
|
Definition at line 201 of file intf.c. References addr_bcast(), addr_btos(), addr_ntos(), ADDR_TYPE_IP, intf_handle::fd, ifreq::ifr_name, intf_entry::intf_name, memset, snprintf, and strlcpy. Referenced by intf_set(). |
|
Definition at line 141 of file intf.c. References addr_ntos(), addr::addr_type, ADDR_TYPE_IP, intf_entry::intf_addr, intf_entry::intf_dst_addr, intf_entry::intf_name, memset, and strlcpy. Referenced by intf_set(). |
|
Definition at line 168 of file intf.c. References addr_ntos(), intf_handle::fd, ifreq::ifr_name, intf_entry::intf_name, memset, snprintf, and strlcpy. Referenced by intf_set(). |
|
Definition at line 472 of file intf.c. References addr_aton, addr::addr_bits, addr_stob(), addr_ston(), addr::addr_type, ADDR_TYPE_ETH, ADDR_TYPE_IP, ADDR_TYPE_IP6, errno, intf_handle::fd6, intf_handle::ifc, intf_entry::intf_addr, intf_entry::intf_alias_num, intf_entry::intf_dst_addr, intf_entry::intf_len, intf_entry::intf_link_addr, intf_entry::intf_name, INTF_NAME_LEN, memcpy, NEXTIFR, NULL, and snprintf. Referenced by intf_get(), and intf_loop(). |
|
Definition at line 377 of file intf.c. References _intf_set_type(), addr::addr_bits, addr_pack, addr_stob(), addr_ston(), addr::addr_type, ADDR_TYPE_ETH, ADDR_TYPE_NONE, ETH_ADDR_BITS, ETH_ADDR_LEN, eth_close(), eth_get(), eth_open(), intf_handle::fd, ifreq::ifr_name, intf_entry::intf_addr, intf_entry::intf_dst_addr, intf_entry::intf_flags, intf_iff_to_flags(), intf_entry::intf_link_addr, intf_entry::intf_mtu, intf_entry::intf_name, intf_entry::intf_type, INTF_TYPE_ETH, INTF_TYPE_TUN, NULL, and strlcpy. Referenced by intf_get(), and intf_loop(). |
|
Definition at line 364 of file intf.c. References INTF_FLAG_BROADCAST, INTF_FLAG_LOOPBACK, INTF_FLAG_POINTOPOINT, intf_entry::intf_flags, intf_entry::intf_type, INTF_TYPE_ETH, INTF_TYPE_LOOPBACK, INTF_TYPE_OTHER, and INTF_TYPE_TUN. Referenced by _intf_get_noalias(). |
|
Definition at line 572 of file intf.c. References ADDR_TYPE_IP, intf_entry::intf_addr, intf_entry::intf_len, and memcpy. Referenced by intf_get_dst(), and intf_get_src(). |
|
Definition at line 728 of file intf.c. References NULL. Referenced by __pyx_f_4dnet_4intf___dealloc__(), arp_close(), eth_open(), intf_main(), intf_open(), ip_close(), START_TEST(), and tun_close(). |
|
Definition at line 83 of file intf.c. References INTF_FLAG_NOARP, and INTF_FLAG_UP. Referenced by intf_set(). |
|
Definition at line 557 of file intf.c. References _intf_get_aliases(), _intf_get_noalias(), caddr_t, intf_handle::fd, intf_handle::ifc, and intf_handle::ifcbuf. Referenced by __pyx_f_4dnet_4intf_get(), eth_open(), intf_main(), intf_set(), START_TEST(), and tun_open(). |
|
Definition at line 601 of file intf.c. References _match_intf_src(), addr_ntos(), addr_ston(), addr::addr_type, ADDR_TYPE_IP, errno, intf_handle::fd, intf_entry::intf_addr, and intf_loop(). Referenced by __pyx_f_4dnet_4intf_get_dst(), and intf_main(). |
|
Definition at line 589 of file intf.c. References _match_intf_src(), errno, intf_entry::intf_addr, intf_loop(), and memcpy. Referenced by __pyx_f_4dnet_4intf_get_src(), and intf_main(). |
|
Definition at line 98 of file intf.c. References INTF_FLAG_BROADCAST, INTF_FLAG_LOOPBACK, INTF_FLAG_MULTICAST, INTF_FLAG_NOARP, INTF_FLAG_POINTOPOINT, and INTF_FLAG_UP. Referenced by _intf_get_noalias(). |
|
Definition at line 682 of file intf.c. References _intf_get_aliases(), _intf_get_noalias(), caddr_t, ifreq::ifr_name, intf_entry::intf_len, intf_entry::intf_name, memset, NEXTIFR, NULL, and strlcpy. Referenced by __pyx_f_4dnet_4intf_loop(), arp_add(), arp_get(), intf_get_dst(), intf_get_src(), intf_main(), and ip_open(). |
|
Definition at line 119 of file intf.c. References errno, intf, intf_close(), and NULL. Referenced by __pyx_f_4dnet_4intf___init__(), arp_open(), eth_open(), intf_main(), ip_open(), START_TEST(), and tun_open(). |
|
Definition at line 251 of file intf.c. References _intf_add_aliases(), _intf_delete_addrs(), _intf_delete_aliases(), addr_bcast(), addr::addr_bits, addr_btos(), addr_cmp(), addr_ntos(), addr::addr_type, ADDR_TYPE_ETH, ADDR_TYPE_IP, errno, ETH_ADDR_LEN, eth_close(), eth_open(), eth_set(), intf_handle::fd, intf_entry::intf_addr, intf_entry::intf_dst_addr, intf_entry::intf_flags, intf_flags_to_iff(), intf_get(), intf_entry::intf_len, intf_entry::intf_link_addr, intf_entry::intf_mtu, intf_entry::intf_name, memcpy, memset, NULL, and strlcpy. Referenced by __pyx_f_4dnet_4intf_set(), intf_main(), tun_close(), and tun_open(). |