]> git.meshlink.io Git - meshlink/blob - src/conf.h
Change my email address.
[meshlink] / src / conf.h
1 /*
2     conf.h -- header for conf.c
3     Copyright (C) 1998-2005 Ivo Timmermans
4                   2000-2013 Guus Sliepen <guus@meshlink.io>
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License along
17     with this program; if not, write to the Free Software Foundation, Inc.,
18     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #ifndef __TINC_CONF_H__
22 #define __TINC_CONF_H__
23
24 #include "splay_tree.h"
25 #include "list.h"
26
27 typedef struct config_t {
28         char *variable;
29         char *value;
30         char *file;
31         int line;
32 } config_t;
33
34 extern splay_tree_t *config_tree;
35
36 extern int pinginterval;
37 extern int pingtimeout;
38 extern int maxtimeout;
39 extern bool bypass_security;
40 extern list_t *cmdline_conf;
41
42 extern void init_configuration(splay_tree_t **);
43 extern void exit_configuration(splay_tree_t **);
44 extern config_t *new_config(void) __attribute__ ((__malloc__));
45 extern void free_config(config_t *);
46 extern void config_add(splay_tree_t *, config_t *);
47 extern config_t *lookup_config(splay_tree_t *, char *);
48 extern config_t *lookup_config_next(splay_tree_t *, const config_t *);
49 extern bool get_config_bool(const config_t *, bool *);
50 extern bool get_config_int(const config_t *, int *);
51 extern bool get_config_string(const config_t *, char **);
52 extern bool get_config_address(const config_t *, struct addrinfo **);
53
54 extern config_t *parse_config_line(char *, const char *, int);
55 extern bool read_config_file(splay_tree_t *, const char *);
56 extern void read_config_options(splay_tree_t *, const char *);
57 extern bool read_server_config(void);
58 extern bool read_host_config(splay_tree_t *, const char *);
59 extern bool append_config_file(const char *, const char *, const char *);
60
61 #endif /* __TINC_CONF_H__ */