Checkpoint (close to finished).

This commit is contained in:
Christian Deacon
2020-05-06 02:11:38 +00:00
parent f20776cc70
commit 138b3de1cc
4 changed files with 89 additions and 63 deletions

View File

@@ -14,6 +14,7 @@ void SetConfigDefaults(struct config_map *cfg)
{
cfg->updateTime = 0;
cfg->interface = "eth0";
cfg->nostats = 0;
for (uint16_t i = 0; i < MAX_FILTERS; i++)
{
@@ -138,6 +139,14 @@ int ReadConfig(struct config_map *cfg)
cfg->updateTime = updateTime;
// Get no stats.
int nostats;
if (config_lookup_bool(&conf, "nostats", &nostats) == CONFIG_TRUE)
{
cfg->nostats = nostats;
}
// Read filters in filters_map structure.
setting = config_lookup(&conf, "filters");
@@ -444,9 +453,6 @@ int ReadConfig(struct config_map *cfg)
filters++;
}
// Assign filter count to config.
cfg->filterCount = filters;
config_destroy(&conf);
return 0;