netfilter.mk 13 KB

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