netfilter.mk 13 KB

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