netfilter.mk 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. #
  2. # Copyright (C) 2006-2008 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. NF_MENU:=Netfilter Extensions
  8. NF_KMOD:=1
  9. include $(INCLUDE_DIR)/netfilter.mk
  10. define KernelPackage/ipt-core
  11. SUBMENU:=$(NF_MENU)
  12. TITLE:=Netfilter core
  13. KCONFIG:=$(KCONFIG_IPT_CORE)
  14. FILES:=$(foreach mod,$(IPT_CORE-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  15. AUTOLOAD:=$(call AutoLoad,40,$(notdir $(IPT_CORE-m)))
  16. endef
  17. define KernelPackage/ipt-core/description
  18. Netfilter core kernel modules
  19. Includes:
  20. - limit
  21. - LOG
  22. - mac
  23. - multiport
  24. - TCPMSS
  25. - REJECT
  26. endef
  27. $(eval $(call KernelPackage,ipt-core))
  28. define KernelPackage/ipt-conntrack
  29. SUBMENU:=$(NF_MENU)
  30. TITLE:=Basic connection tracking modules
  31. KCONFIG:=$(KCONFIG_IPT_CONNTRACK)
  32. FILES:=$(foreach mod,$(IPT_CONNTRACK-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  33. AUTOLOAD:=$(call AutoLoad,41,$(notdir $(IPT_CONNTRACK-m)))
  34. DEPENDS:= kmod-ipt-core
  35. endef
  36. define KernelPackage/ipt-conntrack/description
  37. Netfilter (IPv4) kernel modules for connection tracking
  38. Includes:
  39. - state
  40. endef
  41. $(eval $(call KernelPackage,ipt-conntrack))
  42. define KernelPackage/ipt-conntrack-extra
  43. SUBMENU:=$(NF_MENU)
  44. TITLE:=Extra connection tracking modules
  45. KCONFIG:=$(KCONFIG_IPT_CONNTRACK_EXTRA)
  46. FILES:=$(foreach mod,$(IPT_CONNTRACK_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  47. AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_CONNTRACK_EXTRA-m)))
  48. DEPENDS:= kmod-ipt-core +kmod-ipt-conntrack
  49. endef
  50. define KernelPackage/ipt-conntrack-extra/description
  51. Netfilter (IPv4) extra kernel modules for connection tracking
  52. Includes:
  53. - connbytes
  54. - connmark/CONNMARK
  55. - conntrack
  56. - helper
  57. - recent
  58. - NOTRACK
  59. endef
  60. $(eval $(call KernelPackage,ipt-conntrack-extra))
  61. define KernelPackage/ipt-filter
  62. SUBMENU:=$(NF_MENU)
  63. TITLE:=Modules for packet content inspection
  64. KCONFIG:=$(KCONFIG_IPT_FILTER)
  65. FILES:=$(foreach mod,$(IPT_FILTER-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  66. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_FILTER-m)))
  67. DEPENDS:=kmod-ipt-core +LINUX_2_6:kmod-textsearch
  68. endef
  69. define KernelPackage/ipt-filter/description
  70. Netfilter (IPv4) kernel modules for packet content inspection
  71. Includes:
  72. - ipt_layer7
  73. - ipt_string
  74. endef
  75. $(eval $(call KernelPackage,ipt-filter))
  76. define KernelPackage/ipt-ipopt
  77. SUBMENU:=$(NF_MENU)
  78. TITLE:=Modules for matching/changing IP packet options
  79. KCONFIG:=$(KCONFIG_IPT_IPOPT)
  80. FILES:=$(foreach mod,$(IPT_IPOPT-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  81. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPOPT-m)))
  82. DEPENDS:= kmod-ipt-core
  83. endef
  84. define KernelPackage/ipt-ipopt/description
  85. Netfilter (IPv4) modules for matching/changing IP packet options
  86. Includes:
  87. - ipt_CLASSIFY
  88. - ipt_dscp/DSCP
  89. - ipt_ecn/ECN
  90. - ipt_length
  91. - ipt_tos/TOS
  92. - ipt_tcpmms
  93. - ipt_ttl/TTL
  94. - ipt_unclean
  95. endef
  96. $(eval $(call KernelPackage,ipt-ipopt))
  97. define KernelPackage/ipt-ipsec
  98. SUBMENU:=$(NF_MENU)
  99. TITLE:=Modules for matching IPSec packets
  100. KCONFIG:=$(KCONFIG_IPT_IPSEC)
  101. FILES:=$(foreach mod,$(IPT_IPSEC-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  102. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPSEC-m)))
  103. DEPENDS:= kmod-ipt-core
  104. endef
  105. define KernelPackage/ipt-ipsec/description
  106. Netfilter (IPv4) modules for matching IPSec packets
  107. Includes:
  108. - ipt_ah
  109. - ipt_esp
  110. endef
  111. $(eval $(call KernelPackage,ipt-ipsec))
  112. define KernelPackage/ipt-nat
  113. SUBMENU:=$(NF_MENU)
  114. TITLE:=Basic NAT targets
  115. KCONFIG:=$(KCONFIG_IPT_NAT)
  116. FILES:=$(foreach mod,$(IPT_NAT-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  117. AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_NAT-m)))
  118. DEPENDS:= kmod-ipt-core +kmod-ipt-conntrack
  119. endef
  120. define KernelPackage/ipt-nat/description
  121. Netfilter (IPv4) kernel modules for basic NAT targets
  122. Includes:
  123. - MASQUERADE
  124. endef
  125. $(eval $(call KernelPackage,ipt-nat))
  126. define KernelPackage/ipt-nat-extra
  127. SUBMENU:=$(NF_MENU)
  128. TITLE:=Extra NAT targets
  129. KCONFIG:=$(KCONFIG_IPT_NAT_EXTRA)
  130. FILES:=$(foreach mod,$(IPT_NAT_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  131. AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_NAT_EXTRA-m)))
  132. DEPENDS:= kmod-ipt-core +kmod-ipt-nat
  133. endef
  134. define KernelPackage/ipt-nat-extra/description
  135. Netfilter (IPv4) kernel modules for extra NAT targets
  136. Includes:
  137. - MIRROR
  138. - NETMAP
  139. - REDIRECT
  140. endef
  141. $(eval $(call KernelPackage,ipt-nat-extra))
  142. define KernelPackage/ipt-nathelper
  143. SUBMENU:=$(NF_MENU)
  144. TITLE:=Basic Conntrack and NAT helpers
  145. KCONFIG:=$(KCONFIG_IPT_NATHELPER)
  146. FILES:=$(foreach mod,$(IPT_NATHELPER-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  147. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER-m)))
  148. DEPENDS:= kmod-ipt-core +kmod-ipt-nat
  149. endef
  150. define KernelPackage/ipt-nathelper/description
  151. Default Netfilter (IPv4) Conntrack and NAT helpers
  152. Includes:
  153. - conntrack_ftp
  154. - nat_ftp
  155. - conntrack_irc
  156. - nat_irc
  157. - conntrack_tftp
  158. - nat_tftp
  159. endef
  160. $(eval $(call KernelPackage,ipt-nathelper))
  161. define KernelPackage/ipt-nathelper-extra
  162. SUBMENU:=$(NF_MENU)
  163. TITLE:=Extra Conntrack and NAT helpers
  164. KCONFIG:=$(KCONFIG_IPT_NATHELPER_EXTRA)
  165. FILES:=$(foreach mod,$(IPT_NATHELPER_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  166. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER_EXTRA-m)))
  167. DEPENDS:= kmod-ipt-core +kmod-ipt-nat +LINUX_2_6:kmod-textsearch
  168. endef
  169. define KernelPackage/ipt-nathelper-extra/description
  170. Extra Netfilter (IPv4) Conntrack and NAT helpers
  171. Includes:
  172. - ip_conntrack_amanda
  173. - ip_conntrack_proto_gre
  174. - ip_nat_proto_gre
  175. - ip_conntrack_pptp
  176. - ip_nat_pptp
  177. - ip_conntrack_sip
  178. - ip_nat_sip
  179. - ip_nat_snmp_basic
  180. endef
  181. $(eval $(call KernelPackage,ipt-nathelper-extra))
  182. define KernelPackage/ipt-imq
  183. SUBMENU:=$(NF_MENU)
  184. TITLE:=Intermediate Queueing support
  185. KCONFIG:= \
  186. CONFIG_IMQ \
  187. CONFIG_IMQ_BEHAVIOR_BA=y \
  188. CONFIG_IMQ_NUM_DEVS=2 \
  189. CONFIG_NETFILTER_XT_TARGET_IMQ
  190. FILES:= \
  191. $(LINUX_DIR)/drivers/net/imq.$(LINUX_KMOD_SUFFIX) \
  192. $(foreach mod,$(IPT_IMQ-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  193. AUTOLOAD:=$(call AutoLoad,45,$(notdir \
  194. imq \
  195. $(IPT_IMQ-m) \
  196. ))
  197. DEPENDS:= kmod-ipt-core
  198. endef
  199. define KernelPackage/ipt-imq/description
  200. Kernel support for Intermediate Queueing devices
  201. endef
  202. $(eval $(call KernelPackage,ipt-imq))
  203. define KernelPackage/ipt-queue
  204. SUBMENU:=$(NF_MENU)
  205. TITLE:=Module for user-space packet queueing
  206. KCONFIG:=$(KCONFIG_IPT_QUEUE)
  207. FILES:=$(foreach mod,$(IPT_QUEUE-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  208. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_QUEUE-m)))
  209. DEPENDS:= kmod-ipt-core
  210. endef
  211. define KernelPackage/ipt-queue/description
  212. Netfilter (IPv4) module for user-space packet queueing
  213. Includes:
  214. - QUEUE
  215. endef
  216. $(eval $(call KernelPackage,ipt-queue))
  217. define KernelPackage/ipt-ulog
  218. SUBMENU:=$(NF_MENU)
  219. TITLE:=Module for user-space packet logging
  220. KCONFIG:=$(KCONFIG_IPT_ULOG)
  221. FILES:=$(foreach mod,$(IPT_ULOG-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  222. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_ULOG-m)))
  223. DEPENDS:= kmod-ipt-core
  224. endef
  225. define KernelPackage/ipt-ulog/description
  226. Netfilter (IPv4) module for user-space packet logging
  227. Includes:
  228. - ipt_ULOG
  229. endef
  230. $(eval $(call KernelPackage,ipt-ulog))
  231. define KernelPackage/ipt-iprange
  232. SUBMENU:=$(NF_MENU)
  233. TITLE:=Module for matching ip ranges
  234. FILES:=$(foreach mod,$(IPT_IPRANGE-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  235. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPRANGE-m)))
  236. DEPENDS:= kmod-ipt-core
  237. endef
  238. define KernelPackage/ipt-iprange/description
  239. Netfilter (IPv4) module for matching ip ranges
  240. Includes:
  241. - ipt_IPRANGE
  242. endef
  243. $(eval $(call KernelPackage,ipt-iprange))
  244. define KernelPackage/ipt-extra
  245. SUBMENU:=$(NF_MENU)
  246. TITLE:=Extra modules
  247. KCONFIG:=$(KCONFIG_IPT_EXTRA)
  248. FILES:=$(foreach mod,$(IPT_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  249. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_EXTRA-m)))
  250. DEPENDS:= kmod-ipt-core
  251. endef
  252. define KernelPackage/ipt-extra/description
  253. Other Netfilter (IPv4) kernel modules
  254. Includes:
  255. - ipt_owner
  256. - ipt_physdev
  257. - ipt_pkttype
  258. - ipt_recent
  259. - iptable_raw
  260. - xt_NOTRACK
  261. endef
  262. $(eval $(call KernelPackage,ipt-extra))
  263. define KernelPackage/ip6tables
  264. SUBMENU:=$(NF_MENU)
  265. TITLE:=IPv6 modules
  266. DEPENDS:=+kmod-ipv6
  267. KCONFIG:=$(KCONFIG_IPT_IPV6)
  268. FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  269. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPT_IPV6-m)))
  270. endef
  271. define KernelPackage/ip6tables/description
  272. Netfilter IPv6 firewalling support
  273. endef
  274. $(eval $(call KernelPackage,ip6tables))
  275. define KernelPackage/arptables
  276. SUBMENU:=$(NF_MENU)
  277. TITLE:=ARP firewalling modules
  278. FILES:=$(LINUX_DIR)/net/ipv4/netfilter/arp*.$(LINUX_KMOD_SUFFIX)
  279. KCONFIG:=CONFIG_IP_NF_ARPTABLES \
  280. CONFIG_IP_NF_ARPFILTER \
  281. CONFIG_IP_NF_ARP_MANGLE
  282. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(patsubst %.$(LINUX_KMOD_SUFFIX),%,$(wildcard $(LINUX_DIR)/net/ipv4/netfilter/arp*.$(LINUX_KMOD_SUFFIX)))))
  283. endef
  284. define KernelPackage/arptables/description
  285. Kernel modules for ARP firewalling
  286. endef
  287. $(eval $(call KernelPackage,arptables))
  288. define KernelPackage/ebtables
  289. SUBMENU:=$(NF_MENU)
  290. TITLE:=Bridge firewalling modules
  291. DEPENDS:=@LINUX_2_6
  292. FILES:=$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  293. KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
  294. $(KCONFIG_EBTABLES)
  295. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES-m)))
  296. endef
  297. define KernelPackage/ebtables/description
  298. ebtables is a general, extensible frame/packet identification
  299. framework. It provides you to do Ethernet
  300. filtering/NAT/brouting on the Ethernet bridge.
  301. endef
  302. $(eval $(call KernelPackage,ebtables))
  303. define KernelPackage/ebtables-ipv4
  304. SUBMENU:=$(NF_MENU)
  305. TITLE:=ebtables: IPv4 support
  306. DEPENDS:= kmod-ebtables
  307. FILES:=$(foreach mod,$(EBTABLES_IP4-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  308. KCONFIG:=$(KCONFIG_EBTABLES_IP4)
  309. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP4-m)))
  310. endef
  311. define KernelPackage/ebtables-ipv4/description
  312. This option adds the IPv4 support to ebtables, which allows basic
  313. IPv4 header field filtering, ARP filtering as well as SNAT, DNAT targets.
  314. endef
  315. $(eval $(call KernelPackage,ebtables-ipv4))
  316. define KernelPackage/ebtables-ipv6
  317. SUBMENU:=$(NF_MENU)
  318. TITLE:=ebtables: IPv6 support
  319. DEPENDS:= kmod-ebtables
  320. FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  321. KCONFIG:=$(KCONFIG_EBTABLES_IP6)
  322. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP6-m)))
  323. endef
  324. define KernelPackage/ebtables-ipv6/description
  325. This option adds the IPv6 support to ebtables, which allows basic
  326. IPv6 header field filtering and target support.
  327. endef
  328. $(eval $(call KernelPackage,ebtables-ipv6))
  329. define KernelPackage/ebtables-watchers
  330. SUBMENU:=$(NF_MENU)
  331. TITLE:=ebtables: watchers support
  332. DEPENDS:= kmod-ebtables
  333. FILES:=$(foreach mod,$(EBTABLES_WATCHERS-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  334. KCONFIG:=$(KCONFIG_EBTABLES_WATCHERS)
  335. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_WATCHERS-m)))
  336. endef
  337. define KernelPackage/ebtables-watchers/description
  338. This option adds the log watchers, that you can use in any rule
  339. in any ebtables table.
  340. endef
  341. $(eval $(call KernelPackage,ebtables-watchers))
  342. define KernelPackage/nfnetlink
  343. SUBMENU:=$(NF_MENU)
  344. TITLE:=Netlink-based userspace interface
  345. DEPENDS:=@LINUX_2_6 +kmod-ipt-core
  346. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink.$(LINUX_KMOD_SUFFIX)
  347. KCONFIG:=CONFIG_NETFILTER_NETLINK
  348. AUTOLOAD:=$(call AutoLoad,48,nfnetlink)
  349. endef
  350. define KernelPackage/nfnetlink/description
  351. Kernel modules support for a netlink-based userspace interface
  352. endef
  353. $(eval $(call KernelPackage,nfnetlink))
  354. define KernelPackage/nfnetlink-log
  355. SUBMENU:=$(NF_MENU)
  356. TITLE:=Netfilter LOG over NFNETLINK interface
  357. DEPENDS:=@LINUX_2_6 +kmod-nfnetlink
  358. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_log.$(LINUX_KMOD_SUFFIX)
  359. KCONFIG:=CONFIG_NETFILTER_NETLINK_LOG
  360. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_log)
  361. endef
  362. define KernelPackage/nfnetlink-log/description
  363. Kernel modules support for logging packets via NFNETLINK
  364. endef
  365. $(eval $(call KernelPackage,nfnetlink-log))
  366. define KernelPackage/nfnetlink-queue
  367. SUBMENU:=$(NF_MENU)
  368. TITLE:=Netfilter QUEUE over NFNETLINK interface
  369. DEPENDS:=@LINUX_2_6 +kmod-nfnetlink
  370. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_queue.$(LINUX_KMOD_SUFFIX)
  371. KCONFIG:=CONFIG_NETFILTER_NETLINK_QUEUE
  372. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_queue)
  373. endef
  374. define KernelPackage/nfnetlink-queue/description
  375. Kernel modules support for queueing packets via NFNETLINK
  376. endef
  377. $(eval $(call KernelPackage,nfnetlink-queue))
  378. define KernelPackage/nf-conntrack-netlink
  379. SUBMENU:=$(NF_MENU)
  380. TITLE:=Connection tracking netlink interface
  381. DEPENDS:=@LINUX_2_6 +kmod-nfnetlink +kmod-ipt-conntrack
  382. FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.$(LINUX_KMOD_SUFFIX)
  383. KCONFIG:=CONFIG_NF_CT_NETLINK
  384. AUTOLOAD:=$(call AutoLoad,49,nf_conntrack_netlink)
  385. endef
  386. define KernelPackage/nf-conntrack-netlink/description
  387. Kernel modules support for a netlink-based connection tracking
  388. userspace interface
  389. endef
  390. $(eval $(call KernelPackage,nf-conntrack-netlink))