conf.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef TINC_CONF_H
  2. #define TINC_CONF_H
  3. /*
  4. conf.h -- header for conf.c
  5. Copyright (C) 1998-2005 Ivo Timmermans
  6. 2000-2012 Guus Sliepen <guus@tinc-vpn.org>
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  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. 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. #include "avl_tree.h"
  20. #include "list.h"
  21. typedef struct config_t {
  22. char *variable;
  23. char *value;
  24. char *file;
  25. int line;
  26. } config_t;
  27. #include "subnet.h"
  28. extern avl_tree_t *config_tree;
  29. extern int pinginterval;
  30. extern int pingtimeout;
  31. extern int maxtimeout;
  32. extern int mintimeout;
  33. extern bool bypass_security;
  34. extern char *confbase;
  35. extern char *netname;
  36. extern list_t *cmdline_conf;
  37. extern void init_configuration(avl_tree_t **);
  38. extern void exit_configuration(avl_tree_t **);
  39. extern config_t *new_config(void) __attribute__ ((__malloc__));
  40. extern void free_config(config_t *);
  41. extern void config_add(avl_tree_t *, config_t *);
  42. extern config_t *lookup_config(const avl_tree_t *, char *);
  43. extern config_t *lookup_config_next(const avl_tree_t *, const config_t *);
  44. extern bool get_config_bool(const config_t *, bool *);
  45. extern bool get_config_int(const config_t *, int *);
  46. extern bool get_config_string(const config_t *, char **);
  47. extern bool get_config_address(const config_t *, struct addrinfo **);
  48. extern bool get_config_subnet(const config_t *, struct subnet_t **);
  49. extern config_t *parse_config_line(char *, const char *, int);
  50. extern bool read_config_file(avl_tree_t *, const char *);
  51. extern void read_config_options(avl_tree_t *, const char *);
  52. extern bool read_server_config(void);
  53. extern bool read_connection_config(struct connection_t *);
  54. extern FILE *ask_and_open(const char *, const char *);
  55. extern bool is_safe_path(const char *);
  56. #endif