EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
network_commands.h
Go to the documentation of this file.
1 
11 #ifndef NETWORK_COMMANDS_H
12 #define NETWORK_COMMANDS_H
13 
14 #include <stdbool.h>
15 #include <inttypes.h>
16 
17 #define TICKET_PASSPHRASE_SIZE 16
18 #define TICKET_TIMEOUT 60 // In seconds
19 
20 #include "../ap/ap_config.h"
21 #include "supervisor_config.h"
22 
28 void free_ticket(struct supervisor_context *context);
29 
38 int accept_mac_cmd(struct supervisor_context *context, uint8_t *mac_addr,
39  int vlanid);
40 
48 int deny_mac_cmd(struct supervisor_context *context, uint8_t *mac_addr);
49 
57 int add_nat_cmd(struct supervisor_context *context, uint8_t *mac_addr);
58 
66 int remove_nat_cmd(struct supervisor_context *context, uint8_t *mac_addr);
67 
77 int assign_psk_cmd(struct supervisor_context *context, uint8_t *mac_addr,
78  char *pass, int pass_len);
79 
88 int add_bridge_mac_cmd(struct supervisor_context *context,
89  uint8_t *left_mac_addr, uint8_t *right_mac_addr);
90 
99 int add_bridge_ip_cmd(struct supervisor_context *context, char *left_ip_addr,
100  char *right_ip_addr);
101 
110 int remove_bridge_cmd(struct supervisor_context *context,
111  uint8_t *left_mac_addr, uint8_t *right_mac_addr);
112 
120 int clear_bridges_cmd(struct supervisor_context *context, uint8_t *mac_addr);
121 
131 uint8_t *register_ticket_cmd(struct supervisor_context *context,
132  uint8_t *mac_addr, char *label, int vlanid);
133 
141 int clear_psk_cmd(struct supervisor_context *context, uint8_t *mac_addr);
142 
150 int add_nat_ip(struct supervisor_context *context, char *ip_addr);
151 
159 int remove_nat_ip(struct supervisor_context *context, char *ip_addr);
160 
169 int add_bridge_ip(struct supervisor_context *context, char *ip_addr_left,
170  char *ip_addr_right);
171 
180 int delete_bridge_ip(struct supervisor_context *context, char *ip_addr_left,
181  char *ip_addr_right);
182 #endif
int clear_psk_cmd(struct supervisor_context *context, uint8_t *mac_addr)
CLEAR_PSK command.
Definition: network_commands.c:450
int remove_nat_ip(struct supervisor_context *context, char *ip_addr)
Remove an IP to NAT.
Definition: network_commands.c:140
int accept_mac_cmd(struct supervisor_context *context, uint8_t *mac_addr, int vlanid)
ACCEPT_MAC command.
Definition: network_commands.c:53
int remove_bridge_cmd(struct supervisor_context *context, uint8_t *left_mac_addr, uint8_t *right_mac_addr)
REMOVE_BRIDGE command.
Definition: network_commands.c:352
int clear_bridges_cmd(struct supervisor_context *context, uint8_t *mac_addr)
CLEAR_BRIDGES command.
Definition: network_commands.c:393
int add_bridge_ip(struct supervisor_context *context, char *ip_addr_left, char *ip_addr_right)
Add an IP bridge.
Definition: network_commands.c:243
int assign_psk_cmd(struct supervisor_context *context, uint8_t *mac_addr, char *pass, int pass_len)
ASSIGN_PSK command.
Definition: network_commands.c:219
uint8_t * register_ticket_cmd(struct supervisor_context *context, uint8_t *mac_addr, char *label, int vlanid)
REGISTER_TICKET command.
Definition: network_commands.c:411
int add_bridge_ip_cmd(struct supervisor_context *context, char *left_ip_addr, char *right_ip_addr)
ADD_BRIDGE command (IP address input)
Definition: network_commands.c:309
void free_ticket(struct supervisor_context *context)
Frees an allocated ticket.
Definition: network_commands.c:36
int add_nat_cmd(struct supervisor_context *context, uint8_t *mac_addr)
ADD_NAT command.
Definition: network_commands.c:151
int delete_bridge_ip(struct supervisor_context *context, char *ip_addr_left, char *ip_addr_right)
Deletes an IP bridge.
Definition: network_commands.c:256
int add_nat_ip(struct supervisor_context *context, char *ip_addr)
Add an IP to NAT.
Definition: network_commands.c:129
int deny_mac_cmd(struct supervisor_context *context, uint8_t *mac_addr)
DENY_MAC command.
Definition: network_commands.c:102
int remove_nat_cmd(struct supervisor_context *context, uint8_t *mac_addr)
REMOVE_NAT command.
Definition: network_commands.c:185
int add_bridge_mac_cmd(struct supervisor_context *context, uint8_t *left_mac_addr, uint8_t *right_mac_addr)
ADD_BRIDGE command (MAC address input)
Definition: network_commands.c:269
Supervisor structure definition.
Definition: supervisor_config.h:45
File containing the definition of the supervisor service structure.