Ensure all parameters have names in header files.
[tinc] / src / conf.h
1 #ifndef TINC_CONF_H
2 #define TINC_CONF_H
3
4 /*
5     conf.h -- header for conf.c
6     Copyright (C) 1998-2005 Ivo Timmermans
7                   2000-2013 Guus Sliepen <guus@tinc-vpn.org>
8
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.
13
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.
18
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.
22 */
23
24 #include "list.h"
25 #include "splay_tree.h"
26 #include "subnet.h"
27
28 typedef struct config_t {
29         char *variable;
30         char *value;
31         char *file;
32         int line;
33 } config_t;
34
35
36 extern splay_tree_t *config_tree;
37
38 extern int pinginterval;
39 extern int pingtimeout;
40 extern int maxtimeout;
41 extern bool bypass_security;
42 extern list_t *cmdline_conf;
43
44 extern void init_configuration(splay_tree_t **config_tree);
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, 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);
55 extern bool get_config_subnet(const config_t *config, struct subnet_t **result);
56
57 extern config_t *parse_config_line(char *line, const char *fname, int lineno);
58 extern bool read_config_file(splay_tree_t *config_tree, const char *filename, bool verbose);
59 extern void read_config_options(splay_tree_t *config_tree, const char *prefix);
60 extern bool read_server_config(void);
61 extern bool read_host_config(splay_tree_t *config_tree, const char *name, bool verbose);
62 extern bool append_config_file(const char *name, const char *key, const char *value);
63
64 #endif