simplify more
This commit is contained in:
parent
ef86c4f8f6
commit
7f3935ed15
6 changed files with 56 additions and 24 deletions
|
@ -16,7 +16,7 @@ namespace fw
|
|||
{
|
||||
typedef struct api_endpoints
|
||||
{
|
||||
char uri[20];
|
||||
char uri[40];
|
||||
char method[7];
|
||||
char description[30];
|
||||
struct api_endpoints *next;
|
||||
|
@ -38,7 +38,7 @@ namespace fw
|
|||
auth_t check_auth();
|
||||
|
||||
void setup_routing(const char *cert, const char *key);
|
||||
void add_api_endpoint(const char *uri, const char *method, const char *description);
|
||||
void add_api_endpoint(const String uri, const char *method, const char *description);
|
||||
void get_firewall_rule_handler();
|
||||
void get_firewall_rules_handler();
|
||||
void post_firewall_handler();
|
||||
|
@ -52,14 +52,17 @@ namespace fw
|
|||
void json_message_response(String message, const uint16_t response_code);
|
||||
String construct_json_firewall_rule(firewall_rule_t *);
|
||||
String construct_json_firewall();
|
||||
String construct_json_endpoint(api_endpoint_t *);
|
||||
String construct_json_endpoints();
|
||||
String construct_json_api_endpoint(api_endpoint_t *);
|
||||
String construct_json_api(const uint16_t response_code);
|
||||
String construct_json_array(String message, String array_name);
|
||||
|
||||
protected:
|
||||
String server_ip;
|
||||
uint16_t server_port;
|
||||
void handle_client();
|
||||
|
||||
public:
|
||||
API(const char *cert, const char *key, const char *username, const char *password, const uint16_t port);
|
||||
API(const char *cert, const char *key, const char *username, const char *password, const String ip, const uint16_t port);
|
||||
~API();
|
||||
};
|
||||
}
|
||||
|
|
Reference in a new issue