#ifndef ESP32_STORAGE_HPP
#define ESP32_STORAGE_HPP
#include "EEPROM.h"
#include "FirewallTypes.h"
#include "mbedtls/md.h"
namespace firewall
{
class Storage
private:
uint16_t eeprom_size;
uint16_t settings_start = 0;
uint16_t settings_head = settings_start;
uint16_t rules_start = 100;
uint16_t rules_head = rules_start;
uint16_t certificate_start = 800;
uint16_t certificate_head = certificate_start;
void clear_eeprom();
void get_eeprom_hash();
unsigned char *Storage::get_hash(const char *);
protected:
uint8_t amount_of_rules;
uint8_t get_amount_of_firewall_rules();
void set_amount_of_firewall_rules(const uint8_t);
public:
Storage(const uint16_t = 1000);
~Storage();
};
}
#endif