modules.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /**
  2. * @file modules.h
  3. * @author Ambroz Bizjak <ambrop7@gmail.com>
  4. *
  5. * @section LICENSE
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. * 3. Neither the name of the author nor the
  15. * names of its contributors may be used to endorse or promote products
  16. * derived from this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  19. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  22. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  23. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  24. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  25. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  27. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. */
  29. #ifndef BADVPN_NCD_MODULES_MODULES_H
  30. #define BADVPN_NCD_MODULES_MODULES_H
  31. #include <stddef.h>
  32. #include <ncd/NCDModule.h>
  33. extern const struct NCDModuleGroup ncdmodule_var;
  34. extern const struct NCDModuleGroup ncdmodule_list;
  35. extern const struct NCDModuleGroup ncdmodule_depend;
  36. extern const struct NCDModuleGroup ncdmodule_multidepend;
  37. extern const struct NCDModuleGroup ncdmodule_dynamic_depend;
  38. extern const struct NCDModuleGroup ncdmodule_concat;
  39. extern const struct NCDModuleGroup ncdmodule_if;
  40. extern const struct NCDModuleGroup ncdmodule_strcmp;
  41. extern const struct NCDModuleGroup ncdmodule_logical;
  42. extern const struct NCDModuleGroup ncdmodule_sleep;
  43. extern const struct NCDModuleGroup ncdmodule_print;
  44. extern const struct NCDModuleGroup ncdmodule_blocker;
  45. extern const struct NCDModuleGroup ncdmodule_spawn;
  46. extern const struct NCDModuleGroup ncdmodule_imperative;
  47. extern const struct NCDModuleGroup ncdmodule_ref;
  48. extern const struct NCDModuleGroup ncdmodule_index;
  49. extern const struct NCDModuleGroup ncdmodule_alias;
  50. extern const struct NCDModuleGroup ncdmodule_process_manager;
  51. extern const struct NCDModuleGroup ncdmodule_ondemand;
  52. extern const struct NCDModuleGroup ncdmodule_foreach;
  53. extern const struct NCDModuleGroup ncdmodule_choose;
  54. extern const struct NCDModuleGroup ncdmodule_from_string;
  55. extern const struct NCDModuleGroup ncdmodule_to_string;
  56. extern const struct NCDModuleGroup ncdmodule_value;
  57. extern const struct NCDModuleGroup ncdmodule_try;
  58. extern const struct NCDModuleGroup ncdmodule_exit;
  59. extern const struct NCDModuleGroup ncdmodule_getargs;
  60. extern const struct NCDModuleGroup ncdmodule_arithmetic;
  61. extern const struct NCDModuleGroup ncdmodule_parse;
  62. extern const struct NCDModuleGroup ncdmodule_valuemetic;
  63. extern const struct NCDModuleGroup ncdmodule_file;
  64. extern const struct NCDModuleGroup ncdmodule_netmask;
  65. extern const struct NCDModuleGroup ncdmodule_implode;
  66. extern const struct NCDModuleGroup ncdmodule_call2;
  67. extern const struct NCDModuleGroup ncdmodule_assert;
  68. extern const struct NCDModuleGroup ncdmodule_explode;
  69. extern const struct NCDModuleGroup ncdmodule_net_ipv4_addr_in_network;
  70. extern const struct NCDModuleGroup ncdmodule_net_ipv6_addr_in_network;
  71. extern const struct NCDModuleGroup ncdmodule_timer;
  72. extern const struct NCDModuleGroup ncdmodule_file_open;
  73. extern const struct NCDModuleGroup ncdmodule_backtrack;
  74. extern const struct NCDModuleGroup ncdmodule_depend_scope;
  75. extern const struct NCDModuleGroup ncdmodule_substr;
  76. extern const struct NCDModuleGroup ncdmodule_log;
  77. #ifndef BADVPN_EMSCRIPTEN
  78. extern const struct NCDModuleGroup ncdmodule_regex_match;
  79. extern const struct NCDModuleGroup ncdmodule_run;
  80. extern const struct NCDModuleGroup ncdmodule_runonce;
  81. extern const struct NCDModuleGroup ncdmodule_daemon;
  82. extern const struct NCDModuleGroup ncdmodule_net_backend_waitdevice;
  83. extern const struct NCDModuleGroup ncdmodule_net_backend_waitlink;
  84. extern const struct NCDModuleGroup ncdmodule_net_backend_badvpn;
  85. extern const struct NCDModuleGroup ncdmodule_net_backend_wpa_supplicant;
  86. #ifdef BADVPN_USE_LINUX_RFKILL
  87. extern const struct NCDModuleGroup ncdmodule_net_backend_rfkill;
  88. #endif
  89. extern const struct NCDModuleGroup ncdmodule_net_up;
  90. extern const struct NCDModuleGroup ncdmodule_net_dns;
  91. extern const struct NCDModuleGroup ncdmodule_net_iptables;
  92. extern const struct NCDModuleGroup ncdmodule_net_ipv4_addr;
  93. extern const struct NCDModuleGroup ncdmodule_net_ipv4_route;
  94. extern const struct NCDModuleGroup ncdmodule_net_ipv4_dhcp;
  95. extern const struct NCDModuleGroup ncdmodule_net_ipv4_arp_probe;
  96. extern const struct NCDModuleGroup ncdmodule_net_watch_interfaces;
  97. extern const struct NCDModuleGroup ncdmodule_sys_watch_input;
  98. extern const struct NCDModuleGroup ncdmodule_sys_watch_usb;
  99. #ifdef BADVPN_USE_LINUX_INPUT
  100. extern const struct NCDModuleGroup ncdmodule_sys_evdev;
  101. #endif
  102. #ifdef BADVPN_USE_INOTIFY
  103. extern const struct NCDModuleGroup ncdmodule_sys_watch_directory;
  104. #endif
  105. extern const struct NCDModuleGroup ncdmodule_sys_request_server;
  106. extern const struct NCDModuleGroup ncdmodule_net_ipv6_wait_dynamic_addr;
  107. extern const struct NCDModuleGroup ncdmodule_sys_request_client;
  108. extern const struct NCDModuleGroup ncdmodule_reboot;
  109. extern const struct NCDModuleGroup ncdmodule_net_ipv6_addr;
  110. extern const struct NCDModuleGroup ncdmodule_net_ipv6_route;
  111. extern const struct NCDModuleGroup ncdmodule_socket;
  112. extern const struct NCDModuleGroup ncdmodule_sys_start_process;
  113. #endif
  114. static const struct NCDModuleGroup *ncd_modules[] = {
  115. &ncdmodule_var,
  116. &ncdmodule_list,
  117. &ncdmodule_depend,
  118. &ncdmodule_multidepend,
  119. &ncdmodule_dynamic_depend,
  120. &ncdmodule_concat,
  121. &ncdmodule_if,
  122. &ncdmodule_strcmp,
  123. &ncdmodule_logical,
  124. &ncdmodule_sleep,
  125. &ncdmodule_print,
  126. &ncdmodule_blocker,
  127. &ncdmodule_spawn,
  128. &ncdmodule_imperative,
  129. &ncdmodule_ref,
  130. &ncdmodule_index,
  131. &ncdmodule_alias,
  132. &ncdmodule_process_manager,
  133. &ncdmodule_ondemand,
  134. &ncdmodule_foreach,
  135. &ncdmodule_choose,
  136. &ncdmodule_from_string,
  137. &ncdmodule_to_string,
  138. &ncdmodule_value,
  139. &ncdmodule_try,
  140. &ncdmodule_exit,
  141. &ncdmodule_getargs,
  142. &ncdmodule_arithmetic,
  143. &ncdmodule_parse,
  144. &ncdmodule_valuemetic,
  145. &ncdmodule_file,
  146. &ncdmodule_netmask,
  147. &ncdmodule_implode,
  148. &ncdmodule_call2,
  149. &ncdmodule_assert,
  150. &ncdmodule_explode,
  151. &ncdmodule_net_ipv4_addr_in_network,
  152. &ncdmodule_net_ipv6_addr_in_network,
  153. &ncdmodule_timer,
  154. &ncdmodule_file_open,
  155. &ncdmodule_backtrack,
  156. &ncdmodule_depend_scope,
  157. &ncdmodule_substr,
  158. &ncdmodule_log,
  159. #ifndef BADVPN_EMSCRIPTEN
  160. &ncdmodule_regex_match,
  161. &ncdmodule_run,
  162. &ncdmodule_runonce,
  163. &ncdmodule_daemon,
  164. &ncdmodule_net_backend_waitdevice,
  165. &ncdmodule_net_backend_waitlink,
  166. &ncdmodule_net_backend_badvpn,
  167. &ncdmodule_net_backend_wpa_supplicant,
  168. #ifdef BADVPN_USE_LINUX_RFKILL
  169. &ncdmodule_net_backend_rfkill,
  170. #endif
  171. &ncdmodule_net_up,
  172. &ncdmodule_net_dns,
  173. &ncdmodule_net_iptables,
  174. &ncdmodule_net_ipv4_addr,
  175. &ncdmodule_net_ipv4_route,
  176. &ncdmodule_net_ipv4_dhcp,
  177. &ncdmodule_net_ipv4_arp_probe,
  178. &ncdmodule_net_watch_interfaces,
  179. &ncdmodule_sys_watch_input,
  180. &ncdmodule_sys_watch_usb,
  181. #ifdef BADVPN_USE_LINUX_INPUT
  182. &ncdmodule_sys_evdev,
  183. #endif
  184. #ifdef BADVPN_USE_INOTIFY
  185. &ncdmodule_sys_watch_directory,
  186. #endif
  187. &ncdmodule_sys_request_server,
  188. &ncdmodule_net_ipv6_wait_dynamic_addr,
  189. &ncdmodule_sys_request_client,
  190. &ncdmodule_reboot,
  191. &ncdmodule_net_ipv6_addr,
  192. &ncdmodule_net_ipv6_route,
  193. &ncdmodule_socket,
  194. &ncdmodule_sys_start_process,
  195. #endif
  196. NULL
  197. };
  198. #endif