Load default configuration values for modules

Filters, monitors and routers can now declare parameters and those
parameters will always be present. Currently, this removes the need to
parse simple values like booleans and integers.

Some of the more common parameter types could be added in the future
e.g. paths to files.
This commit is contained in:
Markus Mäkelä
2017-01-04 09:00:00 +02:00
parent 241dbb464a
commit f7c6accaa0
3 changed files with 56 additions and 0 deletions

View File

@ -1658,6 +1658,17 @@ int service_refresh_users(SERVICE *service)
return ret;
}
void service_add_parameters(SERVICE *service, const CONFIG_PARAMETER *param)
{
while (param)
{
CONFIG_PARAMETER *new_param = config_clone_param(param);
new_param->next = service->svc_config_param;
service->svc_config_param = new_param;
param = param->next;
}
}
bool service_set_param_value(SERVICE* service,
CONFIG_PARAMETER* param,
char* valstr,