NCDConfig.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @file NCDConfig.h
  3. * @author Ambroz Bizjak <ambrop7@gmail.com>
  4. *
  5. * @section LICENSE
  6. *
  7. * This file is part of BadVPN.
  8. *
  9. * BadVPN is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2
  11. * as published by the Free Software Foundation.
  12. *
  13. * BadVPN is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. */
  22. #ifndef BADVPN_NCDCONFIG_NCDCONFIG_H
  23. #define BADVPN_NCDCONFIG_NCDCONFIG_H
  24. struct NCDConfig_interfaces;
  25. struct NCDConfig_statements;
  26. struct NCDConfig_strings;
  27. struct NCDConfig_interfaces {
  28. char *name;
  29. struct NCDConfig_statements *statements;
  30. struct NCDConfig_interfaces *next;
  31. };
  32. struct NCDConfig_statements {
  33. struct NCDConfig_strings *names;
  34. struct NCDConfig_strings *args;
  35. struct NCDConfig_statements *next;
  36. };
  37. struct NCDConfig_strings {
  38. char *value;
  39. struct NCDConfig_strings *next;
  40. };
  41. void NCDConfig_free_interfaces (struct NCDConfig_interfaces *v);
  42. void NCDConfig_free_statements (struct NCDConfig_statements *v);
  43. void NCDConfig_free_strings (struct NCDConfig_strings *v);
  44. struct NCDConfig_interfaces * NCDConfig_make_interfaces (char *name, struct NCDConfig_statements *statements, int have_next, struct NCDConfig_interfaces *next);
  45. struct NCDConfig_statements * NCDConfig_make_statements (struct NCDConfig_strings *names, int have_args, struct NCDConfig_strings *args, int have_next, struct NCDConfig_statements *next);
  46. struct NCDConfig_strings * NCDConfig_make_strings (char *value, int have_next, struct NCDConfig_strings *next);
  47. #endif