|
|
@ -18,6 +18,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
static bool |
|
|
|
static bool |
|
|
|
f2b_filter_load_file(f2b_filter_t *filter, const char *path) { |
|
|
|
f2b_filter_load_file(f2b_filter_t *filter, const char *path) { |
|
|
|
|
|
|
|
f2b_config_param_t *param; |
|
|
|
FILE *f = NULL; |
|
|
|
FILE *f = NULL; |
|
|
|
size_t linenum = 0; |
|
|
|
size_t linenum = 0; |
|
|
|
char line[REGEX_LINE_MAX] = ""; |
|
|
|
char line[REGEX_LINE_MAX] = ""; |
|
|
@ -55,7 +56,13 @@ f2b_filter_load_file(f2b_filter_t *filter, const char *path) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
case ';': |
|
|
|
case ';': |
|
|
|
case '#': |
|
|
|
case '#': |
|
|
|
/* comment line */ |
|
|
|
if ((p = strstr(p, "set: ")) != NULL) { |
|
|
|
|
|
|
|
/* inline config line */ |
|
|
|
|
|
|
|
if ((param = f2b_config_param_create(p + 5)) != NULL) { |
|
|
|
|
|
|
|
filter->config(filter->h, param->name, param->value); |
|
|
|
|
|
|
|
free(param); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} /* else: just comment line */ |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
if (strstr(p, HOST_TOKEN) == NULL) { |
|
|
|
if (strstr(p, HOST_TOKEN) == NULL) { |
|
|
|