11 #ifndef CMD_PROCESSOR_H
12 #define CMD_PROCESSOR_H
15 #include <sys/types.h>
19 #include "../utils/sockctl.h"
24 #define CMD_PING "PING_SUPERVISOR"
25 #define CMD_SET_IP "SET_IP"
26 #define CMD_SUBSCRIBE_EVENTS "SUBSCRIBE_EVENTS"
29 #define CMD_ACCEPT_MAC "ACCEPT_MAC"
30 #define CMD_DENY_MAC "DENY_MAC"
31 #define CMD_ADD_NAT "ADD_NAT"
32 #define CMD_REMOVE_NAT "REMOVE_NAT"
33 #define CMD_ASSIGN_PSK "ASSIGN_PSK"
34 #define CMD_GET_MAP "GET_MAP"
35 #define CMD_GET_ALL "GET_ALL"
36 #define CMD_ADD_BRIDGE "ADD_BRIDGE"
37 #define CMD_REMOVE_BRIDGE "REMOVE_BRIDGE"
38 #define CMD_CLEAR_BRIDGES "CLEAR_BRIDGE"
39 #define CMD_GET_BRIDGES "GET_BRIDGES"
40 #define CMD_REGISTER_TICKET "REGISTER_TICKET"
41 #define CMD_CLEAR_PSK "CLEAR_PSK"
43 #ifdef WITH_CRYPTO_SERVICE
45 #define CMD_PUT_CRYPT "PUT_CRYPT"
46 #define CMD_GET_CRYPT "GET_CRYPT"
47 #define CMD_GEN_RANDKEY "GEN_RANDKEY"
48 #define CMD_GEN_PRIVKEY "GEN_PRIVKEY"
49 #define CMD_GEN_PUBKEY "GEN_PUBKEY"
50 #define CMD_GEN_CERT "GEN_CERT"
51 #define CMD_ENCRYPT_BLOB "ENCRYPT_BLOB"
52 #define CMD_DECRYPT_BLOB "DECRYPT_BLOB"
53 #define CMD_SIGN_BLOB "SIGN_BLOB"
56 #define CMD_DELIMITER '\x20'
58 #define OK_REPLY "OK\n"
59 #define FAIL_REPLY "FAIL\n"
61 #define MAX_QUERY_OP_LEN 3
78 UT_array *cmd_arr,
char sep);
327 #ifdef WITH_CRYPTO_SERVICE
337 ssize_t process_put_crypt_cmd(
int sock,
351 ssize_t process_get_crypt_cmd(
int sock,
365 ssize_t process_gen_randkey_cmd(
int sock,
379 ssize_t process_gen_privkey_cmd(
int sock,
393 ssize_t process_gen_pubkey_cmd(
int sock,
407 ssize_t process_gen_cert_cmd(
int sock,
const struct client_address *client_addr,
420 ssize_t process_encrypt_blob_cmd(
int sock,
434 ssize_t process_decrypt_blob_cmd(
int sock,
448 ssize_t process_sign_blob_cmd(
int sock,
ssize_t process_clear_psk_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the CLEAR_PSK command.
Definition: cmd_processor.c:594
ssize_t process_add_nat_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the ADD_NAT command.
Definition: cmd_processor.c:160
ssize_t process_remove_bridge_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the REMOVE_BRIDGE command.
Definition: cmd_processor.c:446
ssize_t process_set_ip_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the SET_IP command.
Definition: cmd_processor.c:337
ssize_t process_add_bridge_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the ADD_BRIDGE command.
Definition: cmd_processor.c:397
ssize_t process_register_ticket_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the REGISTER_TICKET command.
Definition: cmd_processor.c:549
process_cmd_fn get_command_function(const char *cmd)
Get the command function pointer.
Definition: cmd_processor.c:987
bool process_domain_buffer(char *domain_buffer, size_t domain_buffer_len, UT_array *cmd_arr, char sep)
Processes the domain command string.
Definition: cmd_processor.c:35
ssize_t(* process_cmd_fn)(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Definition: cmd_processor.h:63
ssize_t process_deny_mac_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the DENY_MAC command.
Definition: cmd_processor.c:137
ssize_t process_query_fingerprint_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the QUERY_FINGERPRINT command.
ssize_t process_get_bridges_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the GET_BRIDGES command.
Definition: cmd_processor.c:500
ssize_t process_remove_nat_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the REMOVE_NAT command.
Definition: cmd_processor.c:183
ssize_t process_get_all_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the GET_ALL command.
Definition: cmd_processor.c:278
ssize_t process_accept_mac_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the ACCEPT_MAC command.
Definition: cmd_processor.c:104
ssize_t process_subscribe_events_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the SUBSCRIBE_EVENTS command.
Definition: cmd_processor.c:90
ssize_t process_ping_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the PING command.
Definition: cmd_processor.c:75
ssize_t process_assign_psk_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the ASSIGN_PSK command.
Definition: cmd_processor.c:207
ssize_t process_get_map_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the GET_MAP command.
Definition: cmd_processor.c:240
ssize_t process_clear_bridges_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the CLEAR_BRIDGES command.
Definition: cmd_processor.c:477
ssize_t process_set_fingerprint_cmd(int sock, const struct client_address *client_addr, struct supervisor_context *context, UT_array *cmd_arr)
Processes the SET_FINGERPRINT command.
Client address structure definition.
Definition: sockctl.h:28
Supervisor structure definition.
Definition: supervisor_config.h:45
File containing the definition of the supervisor service structure.