EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the definition of the mac mapper. More...
#include <stdbool.h>
#include <inttypes.h>
#include <utarray.h>
#include <uthash.h>
#include "bridge_list.h"
#include "../ap/ap_config.h"
#include "../utils/allocs.h"
#include "../utils/hashmap.h"
#include "../utils/os.h"
Go to the source code of this file.
Data Structures | |
struct | mac_conn_info |
MAC connection info structure. More... | |
struct | mac_conn |
MAC connection structure. More... | |
struct | hashmap_mac_conn |
MAC mapper connection structure. More... | |
Macros | |
#define | MAX_DEVICE_LABEL_SIZE 255 |
Typedefs | |
typedef struct hashmap_mac_conn | hmap_mac_conn |
MAC mapper connection structure. More... | |
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 definition of the mac mapper.
#define MAX_DEVICE_LABEL_SIZE 255 |
typedef struct hashmap_mac_conn hmap_mac_conn |
MAC mapper connection structure.
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 |