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

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

#include <inttypes.h>
#include "supervisor_config.h"
Include dependency graph for supervisor_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  VLAN_ALLOCATION_TYPE { VLAN_ALLOCATE_RANDOM = 0 , VLAN_ALLOCATE_HASH }
 

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 definition of the supervisor utils.

Author
Alexandru Mereacre
Date
2022

Enumeration Type Documentation

◆ VLAN_ALLOCATION_TYPE

Enumerator
VLAN_ALLOCATE_RANDOM 
VLAN_ALLOCATE_HASH 

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