Major cleanup, looking at it after break
This commit is contained in:
parent
6461b71799
commit
f757b06235
8 changed files with 55 additions and 203 deletions
|
@ -4,7 +4,7 @@ namespace fw
|
|||
{
|
||||
Firewall::Firewall()
|
||||
{
|
||||
this->amount_of_rules = retrieve_settings_value("amount_of_rules");
|
||||
this->amount_of_rules = retrieve_amount_of_rules();
|
||||
for (uint8_t i = 1; i <= this->amount_of_rules; i++)
|
||||
{
|
||||
firewall_rule_t *rule_ptr = retrieve_firewall_rule(i);
|
||||
|
@ -23,7 +23,7 @@ namespace fw
|
|||
|
||||
void Firewall::add_rule_to_firewall(firewall_rule_t *rule_ptr, const bool save_in_eeprom)
|
||||
{
|
||||
store_settings_value("amount_of_rules", this->amount_of_rules);
|
||||
store_amount_of_rules(this->amount_of_rules);
|
||||
if (save_in_eeprom)
|
||||
Storage::store_firewall_rule(rule_ptr);
|
||||
if (this->rule_head == NULL)
|
||||
|
@ -104,7 +104,7 @@ namespace fw
|
|||
}
|
||||
free(current_rule);
|
||||
this->amount_of_rules--;
|
||||
Storage::store_settings_value("amount_of_rules", this->amount_of_rules);
|
||||
Storage::store_amount_of_rules(this->amount_of_rules);
|
||||
if (this->amount_of_rules != 0)
|
||||
Storage::store_all_firewall_rules(rule_head);
|
||||
return SUCCESS;
|
||||
|
|
Reference in a new issue