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

File containing the definition of the system commands. More...

#include <stdbool.h>
#include <inttypes.h>
#include <sys/un.h>
#include "../utils/sockctl.h"
#include "supervisor_config.h"
Include dependency graph for system_commands.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PING_REPLY   "PONG\n"
 

Enumerations

enum  DHCP_IP_TYPE {
  DHCP_IP_NONE = 0 , DHCP_IP_NEW , DHCP_IP_OLD , DHCP_IP_DEL ,
  DHCP_IP_ARP
}
 

Functions

int set_ip_cmd (struct supervisor_context *context, uint8_t *mac_addr, char *ip_addr, enum DHCP_IP_TYPE ip_type)
 SET_IP command. More...
 
char * ping_cmd (void)
 SUPERVISOR_PING command. More...
 
int subscribe_events_cmd (struct supervisor_context *context, const struct client_address *addr)
 SUBSCRIBE_EVENTS command. More...
 

Detailed Description

File containing the definition of the system commands.

Author
Alexandru Mereacre
Date
2021

Macro Definition Documentation

◆ PING_REPLY

#define PING_REPLY   "PONG\n"

Enumeration Type Documentation

◆ DHCP_IP_TYPE

Enumerator
DHCP_IP_NONE 
DHCP_IP_NEW 
DHCP_IP_OLD 
DHCP_IP_DEL 
DHCP_IP_ARP 

Function Documentation

◆ ping_cmd()

char* ping_cmd ( void  )

SUPERVISOR_PING command.

Returns
char* the ping reply string, NULL on failure

◆ set_ip_cmd()

int set_ip_cmd ( struct supervisor_context context,
uint8_t *  mac_addr,
char *  ip_addr,
enum DHCP_IP_TYPE  ip_type 
)

SET_IP command.

Parameters
contextThe supervisor structure instance
mac_addrThe MAC address
ip_addrThe IP address
ip_typeThe DHCP_IP_TYPE
Returns
int 0 on success, -1 on failure

◆ subscribe_events_cmd()

int subscribe_events_cmd ( struct supervisor_context context,
const struct client_address addr 
)

SUBSCRIBE_EVENTS command.

Parameters
contextThe supervisor structure instance
addrThe subscriber address
Returns
0 on success, -1 on failure