11 #ifndef IFACE_MAPPER_H_
12 #define IFACE_MAPPER_H_
15 #include <netinet/in.h>
17 #include <net/ethernet.h>
27 #define LINK_TYPE_LEN 64
45 char ifname[IF_NAMESIZE];
55 uint8_t mac_addr[ETHER_ADDR_LEN];
112 char ifname[
static IF_NAMESIZE]);
179 char ifname[
static IF_NAMESIZE]);
191 char brname[
static IF_NAMESIZE]);
File containing the definition of the allocs functionalities.
#define LINK_TYPE_LEN
Definition: iface_mapper.h:27
int copy_vlan_mapper(hmap_vlan_conn *const *hmap, hmap_vlan_conn **copy)
Makes a copy of the VLAn mapper structure.
Definition: iface_mapper.c:120
void free_vlan_mapper(hmap_vlan_conn **hmap)
Frees the VLAN ID to interface connection mapper object.
Definition: iface_mapper.c:171
int get_if_mapper(hmap_if_conn *const *hmap, in_addr_t subnet, char ifname[static IF_NAMESIZE])
Get the interface name corresponding to an IP address of the subnet.
Definition: iface_mapper.c:29
struct hashmap_if_conn hmap_if_conn
Subnet to interface connection mapper.
IF_STATE
Definition: iface_mapper.h:29
@ IF_STATE_LOWERLAYERDOWN
Definition: iface_mapper.h:33
@ IF_STATE_DOWN
Definition: iface_mapper.h:32
@ IF_STATE_NOTPRESENT
Definition: iface_mapper.h:31
@ IF_STATE_OTHER
Definition: iface_mapper.h:37
@ IF_STATE_TESTING
Definition: iface_mapper.h:34
@ IF_STATE_DORMANT
Definition: iface_mapper.h:35
@ IF_STATE_UNKNOWN
Definition: iface_mapper.h:30
@ IF_STATE_UP
Definition: iface_mapper.h:36
bool create_if_mapper(const UT_array *config_ifinfo_array, hmap_if_conn **hmap)
Create the subnet to interface mapper.
Definition: iface_mapper.c:263
void free_if_mapper(hmap_if_conn **hmap)
Frees the interface connection mapper object.
Definition: iface_mapper.c:90
int init_ifbridge_names(UT_array *config_ifinfo_array, const char *ifname, const char *brname)
Initialise the interface names.
Definition: iface_mapper.c:310
struct hashmap_vlan_conn hmap_vlan_conn
VLAN to interface connection mapper.
bool put_if_mapper(hmap_if_conn **hmap, in_addr_t subnet, const char *ifname)
Inserts an interface and subnet IP value into the interface connection mapper.
Definition: iface_mapper.c:54
int get_vlan_mapper(hmap_vlan_conn *const *hmap, int vlanid, struct vlan_conn *conn)
Get the vlan connection structure corresponding to a VLAN ID.
Definition: iface_mapper.c:99
int create_vlan_mapper(const UT_array *config_ifinfo_array, hmap_vlan_conn **hmap)
Create the VLAN ID to interface mapper.
Definition: iface_mapper.c:288
int get_brname_from_ip(const UT_array *config_ifinfo_array, const char *ip_addr, char brname[static IF_NAMESIZE])
Get the bridge name from an IP string.
Definition: iface_mapper.c:205
bool put_vlan_mapper(hmap_vlan_conn **hmap, const struct vlan_conn *conn)
Inserts a vlan connection structure and VLAN ID value into the interface connection mapper.
Definition: iface_mapper.c:133
struct config_ifinfo_t config_ifinfo_t
Interface configuration info structure.
int get_ifname_from_ip(const UT_array *config_ifinfo_array, const char *ip, char ifname[static IF_NAMESIZE])
Get the interface name from an IP string.
Definition: iface_mapper.c:234
File containing the definition of the network utilities.
#define OS_INET_ADDRSTRLEN
Definition: net.h:25
#define OS_INET6_ADDRSTRLEN
Definition: net.h:26
File containing the definition of the os functionalities.
Interface configuration info structure.
Definition: iface_mapper.h:62
int vlanid
Definition: iface_mapper.h:63
char brd_addr[OS_INET_ADDRSTRLEN]
Definition: iface_mapper.h:67
char ip_addr[OS_INET_ADDRSTRLEN]
Definition: iface_mapper.h:66
char brname[IF_NAMESIZE]
Definition: iface_mapper.h:65
char subnet_mask[OS_INET_ADDRSTRLEN]
Definition: iface_mapper.h:69
char ifname[IF_NAMESIZE]
Definition: iface_mapper.h:64
Subnet to interface connection mapper.
Definition: iface_mapper.h:76
char value[IF_NAMESIZE]
Definition: iface_mapper.h:78
UT_hash_handle hh
Definition: iface_mapper.h:79
in_addr_t key
Definition: iface_mapper.h:77
VLAN to interface connection mapper.
Definition: iface_mapper.h:96
UT_hash_handle hh
Definition: iface_mapper.h:99
struct vlan_conn value
Definition: iface_mapper.h:98
int key
Definition: iface_mapper.h:97
Network interface definition structure.
Definition: iface_mapper.h:44
uint32_t ifindex
Definition: iface_mapper.h:46
uint8_t ifa_family
Definition: iface_mapper.h:49
MAC connection structure.
Definition: iface_mapper.h:86
int vlanid
Definition: iface_mapper.h:87
pthread_t capture_pid
Definition: iface_mapper.h:89
char ifname[IF_NAMESIZE]
Definition: iface_mapper.h:88