NCDInterfaceModule.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @file NCDInterfaceModule.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_NCD_NCDINTERFACEMODULE_H
  23. #define BADVPN_NCD_NCDINTERFACEMODULE_H
  24. #include <system/BReactor.h>
  25. #include <ncdconfig/NCDConfig.h>
  26. #define NCDINTERFACEMODULE_EVENT_UP 1
  27. #define NCDINTERFACEMODULE_EVENT_DOWN 2
  28. #define NCDINTERFACEMODULE_EVENT_ERROR 3
  29. typedef void (*NCDInterfaceModule_handler_event) (void *user, int event);
  30. struct NCDInterfaceModule_ncd_params {
  31. BReactor *reactor;
  32. struct NCDConfig_interfaces *conf;
  33. NCDInterfaceModule_handler_event handler_event;
  34. void *user;
  35. };
  36. typedef void * (*NCDInterfaceModule_func_new) (struct NCDInterfaceModule_ncd_params params, int *initial_up_state);
  37. typedef void (*NCDInterfaceModule_func_free) (void *o);
  38. struct NCDInterfaceModule {
  39. const char *type;
  40. NCDInterfaceModule_func_new func_new;
  41. NCDInterfaceModule_func_free func_free;
  42. };
  43. #endif