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