From 3f16390ec96d157eb7fa9cfdd8f814a63329b392 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Tue, 23 Mar 2021 16:59:31 +1000 Subject: [PATCH] * support for [csocket] section in config parser --- src/config.c | 7 +++++++ src/config.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/config.c b/src/config.c index d44f758..f569d75 100644 --- a/src/config.c +++ b/src/config.c @@ -126,6 +126,12 @@ f2b_config_section_create(const char *src) { return section; } + name = "csocket"; + if (strncmp(line, name, strlen(name)) == 0) { + section->type = t_csocket; + return section; + } + name = "defaults"; if (strncmp(line, name, strlen(name)) == 0) { section->type = t_defaults; @@ -184,6 +190,7 @@ f2b_config_section_append(f2b_config_t *config, f2b_config_section_t *section) { switch (section->type) { case t_main: s = &config->main; break; + case t_csocket: s = &config->csocket; break; case t_defaults: s = &config->defaults; break; case t_source: s = &config->sources; break; case t_filter: s = &config->filters; break; diff --git a/src/config.h b/src/config.h index 9d0ba58..4e1d774 100644 --- a/src/config.h +++ b/src/config.h @@ -32,6 +32,7 @@ typedef enum f2b_section_type { t_unknown = 0, /**< default value */ t_main, /**< [main] section */ + t_csocket, /**< [csocket] section */ t_defaults, /**< [defaults] section */ t_source, /**< [source:*] section */ t_filter, /**< [filter:*] section */ @@ -58,6 +59,7 @@ typedef struct f2b_config_section_t { /** topmost f2b config struct */ typedef struct f2b_config_t { f2b_config_section_t *main; /**< section [main] */ + f2b_config_section_t *csocket; /**< section [csocket] */ f2b_config_section_t *defaults; /**< section [defaults] */ f2b_config_section_t *sources; /**< sections [source:*] */ f2b_config_section_t *filters; /**< sections [filter:*] */