EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the definition of the ap service. More...
#include <stdbool.h>
#include <sys/types.h>
#include "../radius/radius_server.h"
#include "../supervisor/supervisor_config.h"
#include "../utils/allocs.h"
#include "../utils/iface.h"
#include "../utils/os.h"
#include "ap_config.h"
Go to the source code of this file.
Data Structures | |
struct | run_ap_callback_fn_struct |
Macros | |
#define | ATTACH_AP_COMMAND "ATTACH" |
#define | STA_AP_COMMAND "STA" /* Command name to check if a station is registered */ |
#define | GENERIC_AP_COMMAND_OK_REPLY "OK" /* The command response on succes */ |
#define | GENERIC_AP_COMMAND_FAIL_REPLY "FAIL" /* The command response on failure */ |
#define | PING_AP_COMMAND "PING" /* Command name to ping the hostapd daemon */ |
#define | PING_AP_COMMAND_REPLY "PONG" /* Reply to the ping command */ |
#define | DENYACL_ADD_COMMAND "DENY_ACL ADD_MAC" /* Command name to add a station to the deny ACL */ |
#define | DENYACL_DEL_COMMAND "DENY_ACL DEL_MAC" /* Command name to remove a station from the deny ACL */ |
Typedefs | |
typedef void(* | ap_service_fn) (struct supervisor_context *context, uint8_t mac_addr[], enum AP_CONNECTION_STATUS status) |
Functions | |
int | run_ap (struct supervisor_context *context, bool exec_ap, bool generate_ssid, struct run_ap_callback_fn_struct *ap_callback_fn) |
Runs the AP service. More... | |
bool | close_ap (struct supervisor_context *context) |
Closes (terminates) AP process. More... | |
int | ping_ap_command (struct apconf *hconf) |
Pings the hostapd daemon. More... | |
int | denyacl_add_ap_command (struct apconf *hconf, const char *mac_addr) |
Deny ACL ADD AP command. More... | |
int | denyacl_del_ap_command (struct apconf *hconf, const char *mac_addr) |
Deny ACL DEL AP command. More... | |
int | disconnect_ap_command (struct apconf *hconf, const char *mac_addr) |
Disconnect and reconnect a MAC device from the AP. More... | |
int | check_sta_ap_command (struct apconf *hconf, const char *mac_addr) |
Check if a station is registered on the AP. More... | |
File containing the definition of the ap service.
Defines the functions to start and stop the acces point service (AP). It also defines auxiliary commands to manage the acces control list for stations connected to the AP.
#define ATTACH_AP_COMMAND "ATTACH" |
#define DENYACL_ADD_COMMAND "DENY_ACL ADD_MAC" /* Command name to add a station to the deny ACL */ |
#define DENYACL_DEL_COMMAND "DENY_ACL DEL_MAC" /* Command name to remove a station from the deny ACL */ |
#define GENERIC_AP_COMMAND_FAIL_REPLY "FAIL" /* The command response on failure */ |
#define GENERIC_AP_COMMAND_OK_REPLY "OK" /* The command response on succes */ |
#define PING_AP_COMMAND "PING" /* Command name to ping the hostapd daemon */ |
#define PING_AP_COMMAND_REPLY "PONG" /* Reply to the ping command */ |
#define STA_AP_COMMAND "STA" /* Command name to check if a station is registered */ |
typedef void(* ap_service_fn) (struct supervisor_context *context, uint8_t mac_addr[], enum AP_CONNECTION_STATUS status) |
Type of callback for AP service in run_ap()
int check_sta_ap_command | ( | struct apconf * | hconf, |
const char * | mac_addr | ||
) |
Check if a station is registered on the AP.
hconf | AP config structure |
mac_addr | The mac address of the station |
bool close_ap | ( | struct supervisor_context * | context | ) |
Closes (terminates) AP process.
context | The supervisor context structure |
int denyacl_add_ap_command | ( | struct apconf * | hconf, |
const char * | mac_addr | ||
) |
Deny ACL ADD AP command.
hconf | AP config structure |
mac_addr | The mac address to add to deny list |
int denyacl_del_ap_command | ( | struct apconf * | hconf, |
const char * | mac_addr | ||
) |
Deny ACL DEL AP command.
hconf | AP config structure |
mac_addr | The mac address to remove from deny list |
int disconnect_ap_command | ( | struct apconf * | hconf, |
const char * | mac_addr | ||
) |
Disconnect and reconnect a MAC device from the AP.
hconf | AP config structure |
mac_addr | The mac address to disconnect |
int ping_ap_command | ( | struct apconf * | hconf | ) |
Pings the hostapd daemon.
hconf | AP config structure |
<tt>0</tt> | if the hostapd daemon responded okay. |
<tt>-1</tt> | if the hostapd daemon didn't respond or had an invalid response. |
int run_ap | ( | struct supervisor_context * | context, |
bool | exec_ap, | ||
bool | generate_ssid, | ||
struct run_ap_callback_fn_struct * | ap_callback_fn | ||
) |
Runs the AP service.
context | The supervisor context structure | |
exec_ap | Flag to execute/signal the AP process | |
generate_ssid | Flag to generate the SSID for AP | |
[in] | ap_callback_fn | A stuct containing the callback for AP service |