EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
bridge_list.h
Go to the documentation of this file.
1 
11 #ifndef BRIDGE_LIST_H
12 #define BRIDGE_LIST_H
13 
14 #include <net/ethernet.h>
15 #include <utarray.h>
16 
17 #include <list.h>
18 #include "../utils/allocs.h"
19 #include "../utils/os.h"
20 
26  uint8_t src_addr[ETHER_ADDR_LEN];
28  uint8_t dst_addr[ETHER_ADDR_LEN];
30 };
37  struct dl_list list;
38 };
39 
47 };
48 
54 struct bridge_mac_list *init_bridge_list(void);
55 
61 void free_bridge_list(struct bridge_mac_list *ml);
62 
72 int add_bridge_mac(struct bridge_mac_list *ml, const uint8_t *mac_addr_left,
73  const uint8_t *mac_addr_right);
74 
83 int remove_bridge_mac(struct bridge_mac_list *ml, const uint8_t *mac_addr_left,
84  const uint8_t *mac_addr_right);
85 
96  const uint8_t *mac_addr_left,
97  const uint8_t *mac_addr_right);
98 
107 int get_src_mac_list(struct bridge_mac_list *ml, const uint8_t *src_addr,
108  UT_array **mac_list_arr);
109 
117 int get_all_bridge_edges(struct bridge_mac_list *ml, UT_array **tuple_list_arr);
118 
127 int check_bridge_exist(struct bridge_mac_list *ml, const uint8_t *mac_addr_left,
128  const uint8_t *mac_addr_right);
129 #endif
struct bridge_mac_list * init_bridge_list(void)
Init the MAC brideg address list for bridge assignment.
Definition: bridge_list.c:22
int add_bridge_mac(struct bridge_mac_list *ml, const uint8_t *mac_addr_left, const uint8_t *mac_addr_right)
Add bridge connection to the MAC bridge address list.
Definition: bridge_list.c:115
int check_bridge_exist(struct bridge_mac_list *ml, const uint8_t *mac_addr_left, const uint8_t *mac_addr_right)
Check if a bridge exist.
Definition: bridge_list.c:103
int get_src_mac_list(struct bridge_mac_list *ml, const uint8_t *src_addr, UT_array **mac_list_arr)
Get the MAC address dst list array for a src MAC address.
Definition: bridge_list.c:197
void free_bridge_list(struct bridge_mac_list *ml)
Free MAC bridge address list.
Definition: bridge_list.c:44
int remove_bridge_mac(struct bridge_mac_list *ml, const uint8_t *mac_addr_left, const uint8_t *mac_addr_right)
Removes a bridge connection from the MAC address list.
Definition: bridge_list.c:168
struct bridge_mac_list_tuple get_bridge_mac(struct bridge_mac_list *ml, const uint8_t *mac_addr_left, const uint8_t *mac_addr_right)
Get the bridge mac object from a bridge connection.
Definition: bridge_list.c:68
int get_all_bridge_edges(struct bridge_mac_list *ml, UT_array **tuple_list_arr)
Get the all the bridge edges as tuple list array.
Definition: bridge_list.c:217
The structure for edge definition.
Definition: bridge_list.h:44
struct bridge_mac_list * left_edge
Definition: bridge_list.h:45
struct bridge_mac_list * right_edge
Definition: bridge_list.h:46
The MAC bridge address store list.
Definition: bridge_list.h:35
struct dl_list list
Definition: bridge_list.h:37
struct bridge_mac_tuple mac_tuple
Definition: bridge_list.h:36
The bridge MAc tuple definition.
Definition: bridge_list.h:25
uint8_t dst_addr[ETHER_ADDR_LEN]
Definition: bridge_list.h:28
uint8_t src_addr[ETHER_ADDR_LEN]
Definition: bridge_list.h:26