all working as expected
This commit is contained in:
parent
89886a65e3
commit
71b6fee0a6
1 changed files with 3 additions and 28 deletions
|
@ -4,31 +4,6 @@ namespace firewall
|
||||||
{
|
{
|
||||||
Storage::Storage()
|
Storage::Storage()
|
||||||
{
|
{
|
||||||
store_settings_value("amount_of_rules", 21);
|
|
||||||
log_i("Amount: %i", retrieve_settings_value("amount_of_rules"));
|
|
||||||
|
|
||||||
firewall_rule_t *rule_ptr = (firewall_rule_t *)malloc(sizeof(firewall_rule_t));
|
|
||||||
rule_ptr->key = 0;
|
|
||||||
strcpy(rule_ptr->source, "192.168.0.12");
|
|
||||||
strcpy(rule_ptr->destination, "192.168.0.12");
|
|
||||||
rule_ptr->protocol = FW_TCP;
|
|
||||||
rule_ptr->target = FW_DROP;
|
|
||||||
store_firewall_rule(rule_ptr);
|
|
||||||
free(rule_ptr);
|
|
||||||
rule_ptr = retrieve_firewall_rule(0);
|
|
||||||
log_i("%s, %s, %i, %i",
|
|
||||||
rule_ptr->source,
|
|
||||||
rule_ptr->destination,
|
|
||||||
rule_ptr->protocol,
|
|
||||||
rule_ptr->target);
|
|
||||||
free(rule_ptr);
|
|
||||||
rule_ptr = retrieve_firewall_rule(1);
|
|
||||||
log_i("%s, %s, %i, %i",
|
|
||||||
rule_ptr->source,
|
|
||||||
rule_ptr->destination,
|
|
||||||
rule_ptr->protocol,
|
|
||||||
rule_ptr->target);
|
|
||||||
free(rule_ptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Storage::~Storage()
|
Storage::~Storage()
|
||||||
|
@ -111,10 +86,10 @@ namespace firewall
|
||||||
uint16_t cert_length = certificate->getCertLength();
|
uint16_t cert_length = certificate->getCertLength();
|
||||||
|
|
||||||
this->memory.begin("certificate", false);
|
this->memory.begin("certificate", false);
|
||||||
this->memory.putBytes("pk_data", pk_data, pk_length);
|
this->memory.putBytes("pk_data", pk_data, sizeof(pk_data));
|
||||||
this->memory.putBytes("cert_data", cert_data, cert_length);
|
this->memory.putBytes("cert_data", cert_data, sizeof(cert_data));
|
||||||
this->memory.putUInt("pk_length", pk_length);
|
this->memory.putUInt("pk_length", pk_length);
|
||||||
this->memory.putUInt("pk_length", cert_length);
|
this->memory.putUInt("cert_length", cert_length);
|
||||||
this->memory.end();
|
this->memory.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue