summaryrefslogtreecommitdiffstats
path: root/src/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/config.h b/src/config.h
index 3231f6d..f4e1de5 100644
--- a/src/config.h
+++ b/src/config.h
@@ -35,20 +35,31 @@
#include "fastd.h"
+/** State of the config parser */
+struct fastd_parser_state {
+ fastd_peer_group_t *peer_group; /**< The current peer group */
+ fastd_peer_config_t *peer; /**< The peer currently being loaded */
+
+ const char *const filename; /**< The filename of the currently parsed file */
+ const int depth; /**< The include depth */
+};
+
+
void fastd_config_protocol(const char *name);
void fastd_config_method(const char *name);
void fastd_config_cipher(const char *name, const char *impl);
void fastd_config_mac(const char *name, const char *impl);
void fastd_config_bind_address(const fastd_peer_address_t *address, const char *bindtodev, bool default_v4, bool default_v6);
-void fastd_config_peer_group_push(const char *name);
-void fastd_config_peer_group_pop(void);
void fastd_config_release(void);
void fastd_config_handle_options(int argc, char *const argv[]);
void fastd_config_verify(void);
+bool fastd_config_read(const char *filename, fastd_peer_group_t *peer_group, fastd_peer_config_t *peer_config, int depth);
+void fastd_config_peer_group_push(fastd_parser_state_t *state, const char *name);
+void fastd_config_peer_group_pop(fastd_parser_state_t *state);
+void fastd_config_add_peer_dir(fastd_peer_group_t *group, const char *dir);
+
void fastd_configure(int argc, char *const argv[]);
void fastd_config_check(void);
void fastd_config_load_peer_dirs(void);
-void fastd_add_peer_dir(const char *dir);
-bool fastd_read_config(const char *filename, bool peer_config, int depth);