EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
ap_service.h
Go to the documentation of this file.
1 
15 #ifndef HOSTAPD_SERVICE_H
16 #define HOSTAPD_SERVICE_H
17 
18 #include <stdbool.h>
19 #include <sys/types.h>
20 
21 #include "../radius/radius_server.h"
22 #include "../supervisor/supervisor_config.h"
23 #include "../utils/allocs.h"
24 #include "../utils/iface.h"
25 #include "../utils/os.h"
26 #include "ap_config.h"
27 
28 #define ATTACH_AP_COMMAND "ATTACH"
29 
30 #define STA_AP_COMMAND \
31  "STA" /* Command name to check if a station is registered */
32 
33 #define GENERIC_AP_COMMAND_OK_REPLY "OK" /* The command response on succes */
34 #define GENERIC_AP_COMMAND_FAIL_REPLY \
35  "FAIL" /* The command response on failure */
36 
37 #define PING_AP_COMMAND "PING" /* Command name to ping the hostapd daemon */
38 #define PING_AP_COMMAND_REPLY "PONG" /* Reply to the ping command */
39 
40 #define DENYACL_ADD_COMMAND \
41  "DENY_ACL ADD_MAC" /* Command name to add a station to the deny ACL */
42 #define DENYACL_DEL_COMMAND \
43  "DENY_ACL DEL_MAC" /* Command name to remove a station from the deny ACL */
44 
46 typedef void (*ap_service_fn)(struct supervisor_context *context,
47  uint8_t mac_addr[],
48  enum AP_CONNECTION_STATUS status);
49 
54 };
55 
65 int run_ap(struct supervisor_context *context, bool exec_ap, bool generate_ssid,
66  struct run_ap_callback_fn_struct *ap_callback_fn);
67 
74 bool close_ap(struct supervisor_context *context);
75 
83 int ping_ap_command(struct apconf *hconf);
84 
92 int denyacl_add_ap_command(struct apconf *hconf, const char *mac_addr);
93 
101 int denyacl_del_ap_command(struct apconf *hconf, const char *mac_addr);
102 
110 int disconnect_ap_command(struct apconf *hconf, const char *mac_addr);
111 
119 int check_sta_ap_command(struct apconf *hconf, const char *mac_addr);
120 #endif
File containing the definition of AP config structures.
AP_CONNECTION_STATUS
The AP conection status.
Definition: ap_config.h:41
int denyacl_add_ap_command(struct apconf *hconf, const char *mac_addr)
Deny ACL ADD AP command.
Definition: ap_service.c:94
int disconnect_ap_command(struct apconf *hconf, const char *mac_addr)
Disconnect and reconnect a MAC device from the AP.
Definition: ap_service.c:102
int ping_ap_command(struct apconf *hconf)
Pings the hostapd daemon.
Definition: ap_service.c:34
void(* ap_service_fn)(struct supervisor_context *context, uint8_t mac_addr[], enum AP_CONNECTION_STATUS status)
Definition: ap_service.h:46
bool close_ap(struct supervisor_context *context)
Closes (terminates) AP process.
Definition: ap_service.c:316
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.
Definition: ap_service.c:275
int check_sta_ap_command(struct apconf *hconf, const char *mac_addr)
Check if a station is registered on the AP.
Definition: ap_service.c:116
int denyacl_del_ap_command(struct apconf *hconf, const char *mac_addr)
Deny ACL DEL AP command.
Definition: ap_service.c:98
The hostapd configuration structure.
Definition: ap_config.h:51
Definition: ap_service.h:51
ap_service_fn ap_service_fn
Definition: ap_service.h:53
Supervisor structure definition.
Definition: supervisor_config.h:45