EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the implementation of the mac mapper. More...
#include <stdbool.h>
#include "utils/allocs.h"
#include "utils/log.h"
#include "utils/net.h"
#include "utils/os.h"
#include "bridge_list.h"
#include "mac_mapper.h"
Functions | |
int | get_mac_mapper (hmap_mac_conn **hmap, uint8_t mac_addr[ETHER_ADDR_LEN], struct mac_conn_info *info) |
Get the MAC connection info structure for a given MAC address. More... | |
bool | put_mac_mapper (hmap_mac_conn **hmap, struct mac_conn conn) |
Insert a MAC into the MAC mapper connection object. More... | |
void | free_mac_mapper (hmap_mac_conn **hmap) |
Frees the MAC mapper connection object. More... | |
int | get_mac_list (hmap_mac_conn **hmap, struct mac_conn **list) |
Get the MAC list from the MAC mapper connection object. More... | |
void | init_default_mac_info (struct mac_conn_info *info, int default_open_vlanid, bool allow_all_nat) |
Generate a default mac info configuration. More... | |
int | get_ip_mapper (hmap_mac_conn **hmap, char *ip, uint8_t *mac_addr) |
Get the MAC address for a given IP address. More... | |
File containing the implementation of the mac mapper.
void free_mac_mapper | ( | hmap_mac_conn ** | hmap | ) |
Frees the MAC mapper connection object.
hmap | MAC mapper connection object |
int get_ip_mapper | ( | hmap_mac_conn ** | hmap, |
char * | ip, | ||
uint8_t * | mac_addr | ||
) |
Get the MAC address for a given IP address.
hmap | MAC mapper object |
ip | The AP address |
mac_addr | Output MAC address |
1
if MAC address found, -1
error and 0
if MAC address not found int get_mac_list | ( | hmap_mac_conn ** | hmap, |
struct mac_conn ** | list | ||
) |
Get the MAC list from the MAC mapper connection object.
hmap | MAC mapper connection object |
list | Output MAC list |
int get_mac_mapper | ( | hmap_mac_conn ** | hmap, |
uint8_t | mac_addr[ETHER_ADDR_LEN], | ||
struct mac_conn_info * | info | ||
) |
Get the MAC connection info structure for a given MAC address.
hmap | MAC mapper object |
mac_addr | MAC address in byte format |
info | Output MAC connection info structure |
1
if MAC address found, -1
error and 0
if MAC address not found void init_default_mac_info | ( | struct mac_conn_info * | info, |
int | default_open_vlanid, | ||
bool | allow_all_nat | ||
) |
Generate a default mac info configuration.
info | The input mac info structure |
default_open_vlanid | The default VLAN ID |
allow_all_nat | The NAT flag |
bool put_mac_mapper | ( | hmap_mac_conn ** | hmap, |
struct mac_conn | conn | ||
) |
Insert a MAC into the MAC mapper connection object.
hmap | MAC mapper object |
conn | MAC connection structure |