5 conf.h -- header for conf.c
6 Copyright (C) 1998-2005 Ivo Timmermans
7 2000-2022 Guus Sliepen <guus@tinc-vpn.org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include "splay_tree.h"
28 typedef struct config_t {
35 extern splay_tree_t config_tree;
37 extern int pinginterval;
38 extern int pingtimeout;
39 extern int maxtimeout;
40 extern bool bypass_security;
41 extern list_t cmdline_conf;
43 extern splay_tree_t *create_configuration(void);
44 extern void init_configuration(splay_tree_t *);
45 extern void exit_configuration(splay_tree_t **config_tree);
46 extern config_t *new_config(void) __attribute__((__malloc__));
47 extern void free_config(config_t *config);
48 extern void config_add(splay_tree_t *config_tree, config_t *config);
49 extern config_t *lookup_config(splay_tree_t *config_tree, const char *variable);
50 extern config_t *lookup_config_next(splay_tree_t *config_tree, const config_t *config);
51 extern bool get_config_bool(const config_t *config, bool *result);
52 extern bool get_config_int(const config_t *config, int *result);
53 extern bool get_config_string(const config_t *config, char **result);
54 extern bool get_config_address(const config_t *config, struct addrinfo **result);
56 extern config_t *parse_config_line(char *line, const char *fname, int lineno);
57 extern bool read_config_file(splay_tree_t *config_tree, const char *filename, bool verbose);
58 extern void read_config_options(splay_tree_t *config_tree, const char *prefix);
59 extern bool read_server_config(splay_tree_t *config_tree);
60 extern bool read_host_config(splay_tree_t *config_tree, const char *name, bool verbose);
61 extern bool append_config_file(const char *name, const char *key, const char *value);