-typedef struct internal_config_t {
- char *name;
- enum which_t which;
- int argtype;
-} internal_config_t;
-
-enum {
- stupid_false = 1,
- stupid_true
-};
-
-enum {
- TYPE_NAME = 1,
- TYPE_INT,
- TYPE_IP,
- TYPE_BOOL
-};
-
-extern config_t *config;
-extern int debug_lvl;
-extern int timeout;
-extern int upstreamindex;
-extern int sighup;
-extern char *configfilename;
-
-extern config_t *add_config_val(config_t **, int, char *);
-extern int read_config_file(const char *);
-extern const config_t *get_config_val(which_t type);
-extern const config_t *get_next_config_val(which_t type, int);
-extern void clear_config();
-
-#endif /* __TINC_CONF_H__ */
+#include "subnet.h"
+
+extern avl_tree_t *config_tree;
+
+extern int pinginterval;
+extern int pingtimeout;
+extern int maxtimeout;
+extern int mintimeout;
+extern bool bypass_security;
+extern char *confbase;
+extern char *netname;
+extern list_t *cmdline_conf;
+
+extern void init_configuration(avl_tree_t **config_tree);
+extern void exit_configuration(avl_tree_t **config_tree);
+extern config_t *new_config(void) __attribute__((__malloc__));
+extern void free_config(config_t *cfg);
+extern void config_add(avl_tree_t *config_tree, config_t *cfg);
+extern config_t *lookup_config(const avl_tree_t *config_tree, char *variable);
+extern config_t *lookup_config_next(const avl_tree_t *config_tree, const config_t *cfg);
+extern bool get_config_bool(const config_t *cfg, bool *result);
+extern bool get_config_int(const config_t *cfg, int *result);
+extern bool get_config_string(const config_t *cfg, char **result);
+extern bool get_config_address(const config_t *cfg, struct addrinfo **result);
+extern bool get_config_subnet(const config_t *cfg, struct subnet_t **result);
+
+extern config_t *parse_config_line(char *line, const char *fname, int lineno);
+extern bool read_config_file(avl_tree_t *config_tree, const char *fname);
+extern void read_config_options(avl_tree_t *config_tree, const char *prefix);
+extern bool read_server_config(void);
+extern bool read_connection_config(struct connection_t *c);
+extern FILE *ask_and_open(const char *fname, const char *what);
+
+#endif