EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Functions
supervisor_utils.c File Reference

File containing the implementation of the supervisor utils. More...

#include <inttypes.h>
#include "../utils/hash.h"
#include "../utils/os.h"
#include "sqlite_macconn_writer.h"
#include "supervisor_config.h"
#include "supervisor_utils.h"
Include dependency graph for supervisor_utils.c:

Functions

int allocate_vlan (struct supervisor_context *context, uint8_t *mac_addr, enum VLAN_ALLOCATION_TYPE type)
 Allocates a VLAN ID for a given MAC address. More...
 
int save_mac_mapper (struct supervisor_context *context, struct mac_conn conn)
 Save a MAC entry into the mapper. More...
 

Detailed Description

File containing the implementation of the supervisor utils.

Author
Alexandru Mereacre
Date
2022

Function Documentation

◆ allocate_vlan()

int allocate_vlan ( struct supervisor_context context,
uint8_t *  mac_addr,
enum VLAN_ALLOCATION_TYPE  type 
)

Allocates a VLAN ID for a given MAC address.

Parameters
context[in]The supervisor context
mac_addr[in]The MAC address
type[in]The VLAN allocation type
Returns
VLAN ID, -1 on failure

◆ save_mac_mapper()

int save_mac_mapper ( struct supervisor_context context,
struct mac_conn  conn 
)

Save a MAC entry into the mapper.

Parameters
contextThe supervisor context
connThe MAC connection structure
Returns
0 on success, -1 on failure