netfilter.mk 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  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. KCONFIG:=$(KCONFIG_IPT_IPRANGE)
  235. FILES:=$(foreach mod,$(IPT_IPRANGE-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  236. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPRANGE-m)))
  237. DEPENDS:= kmod-ipt-core
  238. endef
  239. define KernelPackage/ipt-iprange/description
  240. Netfilter (IPv4) module for matching ip ranges
  241. Includes:
  242. - ipt_IPRANGE
  243. endef
  244. $(eval $(call KernelPackage,ipt-iprange))
  245. define KernelPackage/ipt-extra
  246. SUBMENU:=$(NF_MENU)
  247. TITLE:=Extra modules
  248. KCONFIG:=$(KCONFIG_IPT_EXTRA)
  249. FILES:=$(foreach mod,$(IPT_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  250. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_EXTRA-m)))
  251. DEPENDS:= kmod-ipt-core
  252. endef
  253. define KernelPackage/ipt-extra/description
  254. Other Netfilter (IPv4) kernel modules
  255. Includes:
  256. - ipt_owner
  257. - ipt_physdev
  258. - ipt_pkttype
  259. - ipt_recent
  260. - iptable_raw
  261. - xt_NOTRACK
  262. endef
  263. $(eval $(call KernelPackage,ipt-extra))
  264. define KernelPackage/ip6tables
  265. SUBMENU:=$(NF_MENU)
  266. TITLE:=IPv6 modules
  267. DEPENDS:=+kmod-ipv6
  268. KCONFIG:=$(KCONFIG_IPT_IPV6)
  269. FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  270. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPT_IPV6-m)))
  271. endef
  272. define KernelPackage/ip6tables/description
  273. Netfilter IPv6 firewalling support
  274. endef
  275. $(eval $(call KernelPackage,ip6tables))
  276. define KernelPackage/arptables
  277. SUBMENU:=$(NF_MENU)
  278. TITLE:=ARP firewalling modules
  279. FILES:=$(LINUX_DIR)/net/ipv4/netfilter/arp*.$(LINUX_KMOD_SUFFIX)
  280. KCONFIG:=CONFIG_IP_NF_ARPTABLES \
  281. CONFIG_IP_NF_ARPFILTER \
  282. CONFIG_IP_NF_ARP_MANGLE
  283. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(patsubst %.$(LINUX_KMOD_SUFFIX),%,$(wildcard $(LINUX_DIR)/net/ipv4/netfilter/arp*.$(LINUX_KMOD_SUFFIX)))))
  284. endef
  285. define KernelPackage/arptables/description
  286. Kernel modules for ARP firewalling
  287. endef
  288. $(eval $(call KernelPackage,arptables))
  289. define KernelPackage/ebtables
  290. SUBMENU:=$(NF_MENU)
  291. TITLE:=Bridge firewalling modules
  292. DEPENDS:=@LINUX_2_6
  293. FILES:=$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  294. KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
  295. $(KCONFIG_EBTABLES)
  296. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES-m)))
  297. endef
  298. define KernelPackage/ebtables/description
  299. ebtables is a general, extensible frame/packet identification
  300. framework. It provides you to do Ethernet
  301. filtering/NAT/brouting on the Ethernet bridge.
  302. endef
  303. $(eval $(call KernelPackage,ebtables))
  304. define KernelPackage/ebtables-ipv4
  305. SUBMENU:=$(NF_MENU)
  306. TITLE:=ebtables: IPv4 support
  307. DEPENDS:= kmod-ebtables
  308. FILES:=$(foreach mod,$(EBTABLES_IP4-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  309. KCONFIG:=$(KCONFIG_EBTABLES_IP4)
  310. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP4-m)))
  311. endef
  312. define KernelPackage/ebtables-ipv4/description
  313. This option adds the IPv4 support to ebtables, which allows basic
  314. IPv4 header field filtering, ARP filtering as well as SNAT, DNAT targets.
  315. endef
  316. $(eval $(call KernelPackage,ebtables-ipv4))
  317. define KernelPackage/ebtables-ipv6
  318. SUBMENU:=$(NF_MENU)
  319. TITLE:=ebtables: IPv6 support
  320. DEPENDS:= kmod-ebtables
  321. FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  322. KCONFIG:=$(KCONFIG_EBTABLES_IP6)
  323. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP6-m)))
  324. endef
  325. define KernelPackage/ebtables-ipv6/description
  326. This option adds the IPv6 support to ebtables, which allows basic
  327. IPv6 header field filtering and target support.
  328. endef
  329. $(eval $(call KernelPackage,ebtables-ipv6))
  330. define KernelPackage/ebtables-watchers
  331. SUBMENU:=$(NF_MENU)
  332. TITLE:=ebtables: watchers support
  333. DEPENDS:= kmod-ebtables
  334. FILES:=$(foreach mod,$(EBTABLES_WATCHERS-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  335. KCONFIG:=$(KCONFIG_EBTABLES_WATCHERS)
  336. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_WATCHERS-m)))
  337. endef
  338. define KernelPackage/ebtables-watchers/description
  339. This option adds the log watchers, that you can use in any rule
  340. in any ebtables table.
  341. endef
  342. $(eval $(call KernelPackage,ebtables-watchers))
  343. define KernelPackage/nfnetlink
  344. SUBMENU:=$(NF_MENU)
  345. TITLE:=Netlink-based userspace interface
  346. DEPENDS:=@LINUX_2_6 +kmod-ipt-core
  347. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink.$(LINUX_KMOD_SUFFIX)
  348. KCONFIG:=CONFIG_NETFILTER_NETLINK
  349. AUTOLOAD:=$(call AutoLoad,48,nfnetlink)
  350. endef
  351. define KernelPackage/nfnetlink/description
  352. Kernel modules support for a netlink-based userspace interface
  353. endef
  354. $(eval $(call KernelPackage,nfnetlink))
  355. define KernelPackage/nfnetlink-log
  356. SUBMENU:=$(NF_MENU)
  357. TITLE:=Netfilter LOG over NFNETLINK interface
  358. DEPENDS:=@LINUX_2_6 +kmod-nfnetlink
  359. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_log.$(LINUX_KMOD_SUFFIX)
  360. KCONFIG:=CONFIG_NETFILTER_NETLINK_LOG
  361. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_log)
  362. endef
  363. define KernelPackage/nfnetlink-log/description
  364. Kernel modules support for logging packets via NFNETLINK
  365. endef
  366. $(eval $(call KernelPackage,nfnetlink-log))
  367. define KernelPackage/nfnetlink-queue
  368. SUBMENU:=$(NF_MENU)
  369. TITLE:=Netfilter QUEUE over NFNETLINK interface
  370. DEPENDS:=@LINUX_2_6 +kmod-nfnetlink
  371. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_queue.$(LINUX_KMOD_SUFFIX)
  372. KCONFIG:=CONFIG_NETFILTER_NETLINK_QUEUE
  373. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_queue)
  374. endef
  375. define KernelPackage/nfnetlink-queue/description
  376. Kernel modules support for queueing packets via NFNETLINK
  377. endef
  378. $(eval $(call KernelPackage,nfnetlink-queue))
  379. define KernelPackage/nf-conntrack-netlink
  380. SUBMENU:=$(NF_MENU)
  381. TITLE:=Connection tracking netlink interface
  382. DEPENDS:=@LINUX_2_6 +kmod-nfnetlink +kmod-ipt-conntrack
  383. FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.$(LINUX_KMOD_SUFFIX)
  384. KCONFIG:=CONFIG_NF_CT_NETLINK
  385. AUTOLOAD:=$(call AutoLoad,49,nf_conntrack_netlink)
  386. endef
  387. define KernelPackage/nf-conntrack-netlink/description
  388. Kernel modules support for a netlink-based connection tracking
  389. userspace interface
  390. endef
  391. $(eval $(call KernelPackage,nf-conntrack-netlink))