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

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

#include <stdbool.h>
#include <sys/socket.h>
#include <libgen.h>
#include <sys/ioctl.h>
#include <sys/un.h>
#include <time.h>
#include <unistd.h>
#include <utarray.h>
#include "subscriber_events.h"
#include <eloop.h>
#include "../utils/allocs.h"
#include "../utils/log.h"
#include "../utils/os.h"
#include "../utils/sockctl.h"
#include "../capture/capture_service.h"
#include "cmd_processor.h"
#include "network_commands.h"
#include "supervisor_utils.h"
Include dependency graph for supervisor.c:

Functions

void configure_mac_info (struct mac_conn_info *info, bool allow_connection, int vlanid, ssize_t pass_len, uint8_t *pass, char *label)
 
int run_analyser (char *ifname, struct capture_conf *config, pthread_t *pid)
 
int schedule_analyser (struct supervisor_context *context, int vlanid)
 
int save_device_vlan (struct supervisor_context *context, uint8_t mac_addr[], struct mac_conn_info *info)
 
struct mac_conn_info get_mac_conn_cmd (uint8_t mac_addr[], void *mac_conn_arg)
 Return a mac_conn_info for a given MAC address. More...
 
void ap_service_callback (struct supervisor_context *context, uint8_t mac_addr[], enum AP_CONNECTION_STATUS status)
 The AP service callback. More...
 
int process_received_data (int sock, struct client_address *claddr, struct supervisor_context *context)
 
void eloop_read_domain_handler (int sock, void *eloop_ctx, void *sock_ctx)
 
void eloop_read_udp_handler (int sock, void *eloop_ctx, void *sock_ctx)
 
void close_supervisor (struct supervisor_context *context)
 Closes the supervisor service. More...
 
int run_supervisor (char *server_path, unsigned int port, struct supervisor_context *context)
 Executes the supervisor service. More...
 

Detailed Description

File containing the implementation of the supervisor service.

Author
Alexandru Mereacre
Date
2020

Function Documentation

◆ ap_service_callback()

void ap_service_callback ( struct supervisor_context context,
uint8_t  mac_addr[],
enum AP_CONNECTION_STATUS  status 
)

The AP service callback.

Parameters
contextThe supervisor context
mac_addrThe STA mac address
statusThe STA connection status
Returns
0 on success, -1 on failure

◆ close_supervisor()

void close_supervisor ( struct supervisor_context context)

Closes the supervisor service.

Parameters
contextThe supervisor structure
Returns
true on success, false otherwise

◆ configure_mac_info()

void configure_mac_info ( struct mac_conn_info info,
bool  allow_connection,
int  vlanid,
ssize_t  pass_len,
uint8_t *  pass,
char *  label 
)

◆ eloop_read_domain_handler()

void eloop_read_domain_handler ( int  sock,
void *  eloop_ctx,
void *  sock_ctx 
)

◆ eloop_read_udp_handler()

void eloop_read_udp_handler ( int  sock,
void *  eloop_ctx,
void *  sock_ctx 
)

◆ get_mac_conn_cmd()

struct mac_conn_info get_mac_conn_cmd ( uint8_t  mac_addr[],
void *  mac_conn_arg 
)

Return a mac_conn_info for a given MAC address.

Parameters
mac_addrThe input MAC adderss
mac_conn_argThe supervisor_context pointer
Returns
struct mac_conn_info

◆ process_received_data()

int process_received_data ( int  sock,
struct client_address claddr,
struct supervisor_context context 
)

◆ run_analyser()

int run_analyser ( char *  ifname,
struct capture_conf config,
pthread_t *  pid 
)

◆ run_supervisor()

int run_supervisor ( char *  server_path,
unsigned int  port,
struct supervisor_context context 
)

Executes the supervisor service.

Parameters
server_pathThe domain socket path
portThe UDP port
contextThe supervisor structure
Returns
int The domain socket

◆ save_device_vlan()

int save_device_vlan ( struct supervisor_context context,
uint8_t  mac_addr[],
struct mac_conn_info info 
)

◆ schedule_analyser()

int schedule_analyser ( struct supervisor_context context,
int  vlanid 
)