netfilter.mk 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  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. - comment (2.6)
  21. - limit
  22. - LOG
  23. - mac
  24. - multiport
  25. - REJECT
  26. - TCPMSS
  27. endef
  28. $(eval $(call KernelPackage,ipt-core))
  29. define KernelPackage/ipt/Depends
  30. SUBMENU:=$(NF_MENU)
  31. DEPENDS:= kmod-ipt-core $(1)
  32. endef
  33. define KernelPackage/ipt-conntrack
  34. $(call KernelPackage/ipt/Depends,)
  35. TITLE:=Basic connection tracking modules
  36. KCONFIG:=$(KCONFIG_IPT_CONNTRACK)
  37. FILES:=$(foreach mod,$(IPT_CONNTRACK-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  38. AUTOLOAD:=$(call AutoLoad,41,$(notdir $(IPT_CONNTRACK-m)))
  39. endef
  40. define KernelPackage/ipt-conntrack/description
  41. Netfilter (IPv4) kernel modules for connection tracking
  42. Includes:
  43. - conntrack
  44. - defrag (2.6)
  45. - iptables_raw
  46. - NOTRACK
  47. - state
  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. - layer7
  78. - 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. - CLASSIFY
  92. - dscp/DSCP
  93. - ecn/ECN
  94. - hl/HL (2.6.30 and later)
  95. - length
  96. - mark/MARK
  97. - statistic (2.6)
  98. - tcpmss
  99. - time
  100. - tos/TOS (prior to 2.6.25)
  101. - ttl/TTL (prior to 2.6.30)
  102. - unclean
  103. endef
  104. $(eval $(call KernelPackage,ipt-ipopt))
  105. define KernelPackage/ipt-ipsec
  106. $(call KernelPackage/ipt/Depends,)
  107. TITLE:=Modules for matching IPSec packets
  108. KCONFIG:=$(KCONFIG_IPT_IPSEC)
  109. FILES:=$(foreach mod,$(IPT_IPSEC-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  110. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPSEC-m)))
  111. endef
  112. define KernelPackage/ipt-ipsec/description
  113. Netfilter (IPv4) modules for matching IPSec packets
  114. Includes:
  115. - ah
  116. - esp
  117. - policy (2.6)
  118. endef
  119. $(eval $(call KernelPackage,ipt-ipsec))
  120. define KernelPackage/ipt-nat
  121. $(call KernelPackage/ipt/Depends,+kmod-ipt-conntrack)
  122. TITLE:=Basic NAT targets
  123. KCONFIG:=$(KCONFIG_IPT_NAT)
  124. FILES:=$(foreach mod,$(IPT_NAT-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  125. AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_NAT-m)))
  126. endef
  127. define KernelPackage/ipt-nat/description
  128. Netfilter (IPv4) kernel modules for basic NAT targets
  129. Includes:
  130. - MASQUERADE
  131. endef
  132. $(eval $(call KernelPackage,ipt-nat))
  133. define KernelPackage/ipt-nat-extra
  134. $(call KernelPackage/ipt/Depends,+kmod-ipt-nat)
  135. TITLE:=Extra NAT targets
  136. KCONFIG:=$(KCONFIG_IPT_NAT_EXTRA)
  137. FILES:=$(foreach mod,$(IPT_NAT_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  138. AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_NAT_EXTRA-m)))
  139. endef
  140. define KernelPackage/ipt-nat-extra/description
  141. Netfilter (IPv4) kernel modules for extra NAT targets
  142. Includes:
  143. - MIRROR (2.4)
  144. - NETMAP
  145. - REDIRECT
  146. endef
  147. $(eval $(call KernelPackage,ipt-nat-extra))
  148. define KernelPackage/ipt-nathelper
  149. $(call KernelPackage/ipt/Depends,+kmod-ipt-nat)
  150. TITLE:=Basic Conntrack and NAT helpers
  151. KCONFIG:=$(KCONFIG_IPT_NATHELPER)
  152. FILES:=$(foreach mod,$(IPT_NATHELPER-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  153. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER-m)))
  154. endef
  155. define KernelPackage/ipt-nathelper/description
  156. Default Netfilter (IPv4) Conntrack and NAT helpers
  157. Includes:
  158. - ftp
  159. - irc
  160. - tftp
  161. endef
  162. $(eval $(call KernelPackage,ipt-nathelper))
  163. define KernelPackage/ipt-nathelper-extra
  164. $(call KernelPackage/ipt/Depends,+kmod-ipt-nat +LINUX_2_6:kmod-textsearch)
  165. TITLE:=Extra Conntrack and NAT helpers
  166. KCONFIG:=$(KCONFIG_IPT_NATHELPER_EXTRA)
  167. FILES:=$(foreach mod,$(IPT_NATHELPER_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  168. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER_EXTRA-m)))
  169. endef
  170. define KernelPackage/ipt-nathelper-extra/description
  171. Extra Netfilter (IPv4) Conntrack and NAT helpers
  172. Includes:
  173. - amanda
  174. - h323
  175. - mms
  176. - pptp (2.6)
  177. - proto_gre (2.6)
  178. - rtsp
  179. - sip (2.6)
  180. - snmp_basic
  181. endef
  182. $(eval $(call KernelPackage,ipt-nathelper-extra))
  183. define KernelPackage/ipt-imq
  184. $(call KernelPackage/ipt/Depends,)
  185. TITLE:=Intermediate Queueing support
  186. KCONFIG:= \
  187. CONFIG_IMQ \
  188. CONFIG_IMQ_BEHAVIOR_BA=y \
  189. CONFIG_IMQ_NUM_DEVS=2 \
  190. CONFIG_NETFILTER_XT_TARGET_IMQ
  191. FILES:= \
  192. $(LINUX_DIR)/drivers/net/imq.$(LINUX_KMOD_SUFFIX) \
  193. $(foreach mod,$(IPT_IMQ-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  194. AUTOLOAD:=$(call AutoLoad,45,$(notdir \
  195. imq \
  196. $(IPT_IMQ-m) \
  197. ))
  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. $(call KernelPackage/ipt/Depends,)
  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. endef
  210. define KernelPackage/ipt-queue/description
  211. Netfilter (IPv4) module for user-space packet queueing
  212. Includes:
  213. - QUEUE
  214. endef
  215. $(eval $(call KernelPackage,ipt-queue))
  216. define KernelPackage/ipt-ulog
  217. $(call KernelPackage/ipt/Depends,)
  218. TITLE:=Module for user-space packet logging
  219. KCONFIG:=$(KCONFIG_IPT_ULOG)
  220. FILES:=$(foreach mod,$(IPT_ULOG-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  221. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_ULOG-m)))
  222. endef
  223. define KernelPackage/ipt-ulog/description
  224. Netfilter (IPv4) module for user-space packet logging
  225. Includes:
  226. - ULOG
  227. endef
  228. $(eval $(call KernelPackage,ipt-ulog))
  229. define KernelPackage/ipt-iprange
  230. $(call KernelPackage/ipt/Depends,)
  231. TITLE:=Module for matching ip ranges
  232. KCONFIG:=$(KCONFIG_IPT_IPRANGE)
  233. FILES:=$(foreach mod,$(IPT_IPRANGE-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  234. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPRANGE-m)))
  235. endef
  236. define KernelPackage/ipt-iprange/description
  237. Netfilter (IPv4) module for matching ip ranges
  238. Includes:
  239. - iprange
  240. endef
  241. $(eval $(call KernelPackage,ipt-iprange))
  242. define KernelPackage/ipt-extra
  243. $(call KernelPackage/ipt/Depends,)
  244. TITLE:=Extra modules
  245. KCONFIG:=$(KCONFIG_IPT_EXTRA)
  246. FILES:=$(foreach mod,$(IPT_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  247. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_EXTRA-m)))
  248. endef
  249. define KernelPackage/ipt-extra/description
  250. Other Netfilter (IPv4) kernel modules
  251. Includes:
  252. - condition (2.4 only)
  253. - owner
  254. - physdev (if bridge support was enabled in kernel)
  255. - pkttype
  256. - quota
  257. endef
  258. $(eval $(call KernelPackage,ipt-extra))
  259. define KernelPackage/ip6tables
  260. SUBMENU:=$(NF_MENU)
  261. TITLE:=IPv6 modules
  262. DEPENDS:=+kmod-ipv6
  263. KCONFIG:=$(KCONFIG_IPT_IPV6)
  264. FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  265. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPT_IPV6-m)))
  266. endef
  267. define KernelPackage/ip6tables/description
  268. Netfilter IPv6 firewalling support
  269. endef
  270. $(eval $(call KernelPackage,ip6tables))
  271. define KernelPackage/arptables
  272. SUBMENU:=$(NF_MENU)
  273. TITLE:=ARP firewalling modules
  274. FILES:=$(LINUX_DIR)/net/ipv4/netfilter/arp*.$(LINUX_KMOD_SUFFIX)
  275. KCONFIG:=CONFIG_IP_NF_ARPTABLES \
  276. CONFIG_IP_NF_ARPFILTER \
  277. CONFIG_IP_NF_ARP_MANGLE
  278. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(patsubst %.$(LINUX_KMOD_SUFFIX),%,$(wildcard $(LINUX_DIR)/net/ipv4/netfilter/arp*.$(LINUX_KMOD_SUFFIX)))))
  279. endef
  280. define KernelPackage/arptables/description
  281. Kernel modules for ARP firewalling
  282. endef
  283. $(eval $(call KernelPackage,arptables))
  284. define KernelPackage/ebtables
  285. SUBMENU:=$(NF_MENU)
  286. TITLE:=Bridge firewalling modules
  287. DEPENDS:=@LINUX_2_6
  288. FILES:=$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  289. KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
  290. $(KCONFIG_EBTABLES)
  291. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES-m)))
  292. endef
  293. define KernelPackage/ebtables/description
  294. ebtables is a general, extensible frame/packet identification
  295. framework. It provides you to do Ethernet
  296. filtering/NAT/brouting on the Ethernet bridge.
  297. endef
  298. $(eval $(call KernelPackage,ebtables))
  299. define KernelPackage/ebtables/Depends
  300. SUBMENU:=$(NF_MENU)
  301. DEPENDS:=kmod-ebtables $(1)
  302. endef
  303. define KernelPackage/ebtables-ipv4
  304. $(call KernelPackage/ebtables/Depends,)
  305. TITLE:=ebtables: IPv4 support
  306. FILES:=$(foreach mod,$(EBTABLES_IP4-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  307. KCONFIG:=$(KCONFIG_EBTABLES_IP4)
  308. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP4-m)))
  309. endef
  310. define KernelPackage/ebtables-ipv4/description
  311. This option adds the IPv4 support to ebtables, which allows basic
  312. IPv4 header field filtering, ARP filtering as well as SNAT, DNAT targets.
  313. endef
  314. $(eval $(call KernelPackage,ebtables-ipv4))
  315. define KernelPackage/ebtables-ipv6
  316. $(call KernelPackage/ebtables/Depends,)
  317. TITLE:=ebtables: IPv6 support
  318. FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  319. KCONFIG:=$(KCONFIG_EBTABLES_IP6)
  320. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP6-m)))
  321. endef
  322. define KernelPackage/ebtables-ipv6/description
  323. This option adds the IPv6 support to ebtables, which allows basic
  324. IPv6 header field filtering and target support.
  325. endef
  326. $(eval $(call KernelPackage,ebtables-ipv6))
  327. define KernelPackage/ebtables-watchers
  328. $(call KernelPackage/ebtables/Depends,)
  329. TITLE:=ebtables: watchers support
  330. FILES:=$(foreach mod,$(EBTABLES_WATCHERS-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  331. KCONFIG:=$(KCONFIG_EBTABLES_WATCHERS)
  332. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_WATCHERS-m)))
  333. endef
  334. define KernelPackage/ebtables-watchers/description
  335. This option adds the log watchers, that you can use in any rule
  336. in any ebtables table.
  337. endef
  338. $(eval $(call KernelPackage,ebtables-watchers))
  339. define KernelPackage/nfnetlink
  340. SUBMENU:=$(NF_MENU)
  341. TITLE:=Netlink-based userspace interface
  342. DEPENDS:=@LINUX_2_6 +kmod-ipt-core
  343. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink.$(LINUX_KMOD_SUFFIX)
  344. KCONFIG:=CONFIG_NETFILTER_NETLINK
  345. AUTOLOAD:=$(call AutoLoad,48,nfnetlink)
  346. endef
  347. define KernelPackage/nfnetlink/description
  348. Kernel modules support for a netlink-based userspace interface
  349. endef
  350. $(eval $(call KernelPackage,nfnetlink))
  351. define KernelPackage/nfnetlink/Depends
  352. SUBMENU:=$(NF_MENU)
  353. DEPENDS:=@LINUX_2_6 +kmod-nfnetlink $(1)
  354. endef
  355. define KernelPackage/nfnetlink-log
  356. $(call KernelPackage/nfnetlink/Depends,)
  357. TITLE:=Netfilter LOG over NFNETLINK interface
  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. $(call KernelPackage/nfnetlink/Depends,)
  368. TITLE:=Netfilter QUEUE over NFNETLINK interface
  369. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_queue.$(LINUX_KMOD_SUFFIX)
  370. KCONFIG:=CONFIG_NETFILTER_NETLINK_QUEUE
  371. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_queue)
  372. endef
  373. define KernelPackage/nfnetlink-queue/description
  374. Kernel modules support for queueing packets via NFNETLINK
  375. endef
  376. $(eval $(call KernelPackage,nfnetlink-queue))
  377. define KernelPackage/nf-conntrack-netlink
  378. $(call KernelPackage/nfnetlink/Depends,+kmod-ipt-conntrack)
  379. TITLE:=Connection tracking netlink interface
  380. FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.$(LINUX_KMOD_SUFFIX)
  381. KCONFIG:=CONFIG_NF_CT_NETLINK
  382. AUTOLOAD:=$(call AutoLoad,49,nf_conntrack_netlink)
  383. endef
  384. define KernelPackage/nf-conntrack-netlink/description
  385. Kernel modules support for a netlink-based connection tracking
  386. userspace interface
  387. endef
  388. $(eval $(call KernelPackage,nf-conntrack-netlink))