Checkpoint (close to finished).
This commit is contained in:
12
src/config.c
12
src/config.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user