This repository has been archived on 2024-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
esp-firewall/SourceCode/arduino/lib/Firewall/esp32Storage.hpp

35 lines
755 B
C++
Raw Normal View History

2022-04-20 14:37:21 +02:00
#ifndef ESP32_STORAGE_HPP
#define ESP32_STORAGE_HPP
2022-04-20 11:40:00 +02:00
2022-04-20 15:43:02 +02:00
#include "Preferences.h"
#include "SPIFFS.h"
2022-04-20 13:08:12 +02:00
#include "FirewallTypes.h"
2022-04-20 15:53:54 +02:00
#include "SSLCert.hpp"
2022-04-20 11:40:00 +02:00
2022-04-20 13:08:12 +02:00
namespace firewall
2022-04-20 11:40:00 +02:00
{
2022-04-20 13:08:12 +02:00
class Storage
{
private:
2022-04-20 19:42:30 +02:00
Preferences memory;
void mount_spiffs();
2022-04-20 14:37:21 +02:00
2022-04-20 13:08:12 +02:00
protected:
2022-04-20 19:42:30 +02:00
uint8_t retrieve_settings_value(const char *);
void store_settings_value(const char *, const uint8_t);
2022-04-20 15:43:02 +02:00
firewall_rule_t *retrieve_firewall_rule(const uint8_t);
2022-04-20 21:35:36 +02:00
void store_all_firewall_rules(firewall_rule_t *);
2022-04-20 19:42:30 +02:00
void store_firewall_rule(firewall_rule_t *);
2022-04-20 16:02:10 +02:00
httpsserver::SSLCert *retrieve_certificate();
2022-04-20 21:35:36 +02:00
void store_certificate(httpsserver::SSLCert *);
2022-04-20 13:08:12 +02:00
public:
2022-04-20 15:43:02 +02:00
Storage();
2022-04-20 13:08:12 +02:00
~Storage();
};
}
2022-04-20 11:40:00 +02:00
#endif