#ifndef ESP32_FIREWALL_HPP #define ESP32_FIREWALL_HPP #include "Utils.hpp" #include "Storage.hpp" #include "WiFiClient.h" namespace fw { class Firewall : public Storage { public: Firewall(); ~Firewall(); firewall_rule_t *get_rule_head(); void add_rule_to_firewall(firewall_rule_t *rule_ptr, const bool save_in_eeprom = true); firewall_rule_t *add_rule_to_firewall(String source, String destination, String port_from, String port_to, String protocol, String target); firewall_rule_t *get_rule_from_firewall(const uint8_t key); ok_t delete_rule_from_firewall(const uint8_t key); bool is_included_in_firewall(const char *ip, const uint16_t port); bool is_client_allowed(WiFiClient client); protected: uint8_t amount_of_rules = 0; firewall_rule_t *rule_head = NULL; }; } #endif