netfilter.mk 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  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. - ipt_limit
  21. - xt_limit
  22. - ipt_mac
  23. - xt_mac
  24. - ipt_multiport
  25. - xt_multiport
  26. - ipt_comment
  27. - xt_comment
  28. - ipt_LOG
  29. - ipt_TCPMSS
  30. - xt_TCPMSS
  31. - ipt_REJECT
  32. endef
  33. $(eval $(call KernelPackage,ipt-core))
  34. define KernelPackage/ipt/Depends
  35. SUBMENU:=$(NF_MENU)
  36. DEPENDS:= kmod-ipt-core $(1)
  37. endef
  38. define KernelPackage/ipt-conntrack
  39. $(call KernelPackage/ipt/Depends,)
  40. TITLE:=Basic connection tracking modules
  41. KCONFIG:=$(KCONFIG_IPT_CONNTRACK)
  42. FILES:=$(foreach mod,$(IPT_CONNTRACK-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  43. AUTOLOAD:=$(call AutoLoad,41,$(notdir $(IPT_CONNTRACK-m)))
  44. endef
  45. define KernelPackage/ipt-conntrack/description
  46. Netfilter (IPv4) kernel modules for connection tracking
  47. Includes:
  48. - conntrack
  49. - defrag
  50. - iptables_raw
  51. - NOTRACK
  52. - state
  53. - xt_NOTRACK
  54. endef
  55. $(eval $(call KernelPackage,ipt-conntrack))
  56. define KernelPackage/ipt-conntrack-extra
  57. $(call KernelPackage/ipt/Depends,+kmod-ipt-conntrack)
  58. TITLE:=Extra connection tracking modules
  59. KCONFIG:=$(KCONFIG_IPT_CONNTRACK_EXTRA)
  60. FILES:=$(foreach mod,$(IPT_CONNTRACK_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  61. AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_CONNTRACK_EXTRA-m)))
  62. endef
  63. define KernelPackage/ipt-conntrack-extra/description
  64. Netfilter (IPv4) extra kernel modules for connection tracking
  65. Includes:
  66. - connbytes
  67. - connmark/CONNMARK
  68. - conntrack
  69. - helper
  70. - recent
  71. endef
  72. $(eval $(call KernelPackage,ipt-conntrack-extra))
  73. define KernelPackage/ipt-filter
  74. $(call KernelPackage/ipt/Depends,+LINUX_2_6:kmod-textsearch)
  75. TITLE:=Modules for packet content inspection
  76. KCONFIG:=$(KCONFIG_IPT_FILTER)
  77. FILES:=$(foreach mod,$(IPT_FILTER-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  78. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_FILTER-m)))
  79. endef
  80. define KernelPackage/ipt-filter/description
  81. Netfilter (IPv4) kernel modules for packet content inspection
  82. Includes:
  83. - ipt_layer7
  84. - ipt_string
  85. - xt_layer7
  86. - xt_string
  87. endef
  88. $(eval $(call KernelPackage,ipt-filter))
  89. define KernelPackage/ipt-ipopt
  90. $(call KernelPackage/ipt/Depends,)
  91. TITLE:=Modules for matching/changing IP packet options
  92. KCONFIG:=$(KCONFIG_IPT_IPOPT)
  93. FILES:=$(foreach mod,$(IPT_IPOPT-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  94. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPOPT-m)))
  95. endef
  96. define KernelPackage/ipt-ipopt/description
  97. Netfilter (IPv4) modules for matching/changing IP packet options
  98. Includes:
  99. - ipt_dscp
  100. - xt_dscp
  101. - xt_DSCP
  102. - ipt_ecn
  103. - ipt_length
  104. - xt_length
  105. - ipt_mark
  106. - xt_mark
  107. - xt_statistic
  108. - ipt_tcpmss
  109. - xt_tcpmss
  110. - ipt_time
  111. - xt_time
  112. - ipt_unclean
  113. - ipt_CLASSIFY
  114. - xt_CLASSIFY
  115. - ipt_DSCP
  116. - ipt_ECN
  117. - ipt_MARK
  118. - xt_MARK
  119. - xt_tos
  120. - xt_TOS
  121. - xt_hl
  122. - xt_HL
  123. endef
  124. $(eval $(call KernelPackage,ipt-ipopt))
  125. define KernelPackage/ipt-ipsec
  126. $(call KernelPackage/ipt/Depends,)
  127. TITLE:=Modules for matching IPSec packets
  128. KCONFIG:=$(KCONFIG_IPT_IPSEC)
  129. FILES:=$(foreach mod,$(IPT_IPSEC-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  130. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPSEC-m)))
  131. endef
  132. define KernelPackage/ipt-ipsec/description
  133. Netfilter (IPv4) modules for matching IPSec packets
  134. Includes:
  135. - ipt_ah
  136. - ipt_esp
  137. - xt_esp
  138. - xt_policy
  139. endef
  140. $(eval $(call KernelPackage,ipt-ipsec))
  141. define KernelPackage/ipt-nat
  142. $(call KernelPackage/ipt/Depends,+kmod-ipt-conntrack)
  143. TITLE:=Basic NAT targets
  144. KCONFIG:=$(KCONFIG_IPT_NAT)
  145. FILES:=$(foreach mod,$(IPT_NAT-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  146. AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_NAT-m)))
  147. endef
  148. define KernelPackage/ipt-nat/description
  149. Netfilter (IPv4) kernel modules for basic NAT targets
  150. Includes:
  151. - MASQUERADE
  152. endef
  153. $(eval $(call KernelPackage,ipt-nat))
  154. define KernelPackage/ipt-nat-extra
  155. $(call KernelPackage/ipt/Depends,+kmod-ipt-nat)
  156. TITLE:=Extra NAT targets
  157. KCONFIG:=$(KCONFIG_IPT_NAT_EXTRA)
  158. FILES:=$(foreach mod,$(IPT_NAT_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  159. AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_NAT_EXTRA-m)))
  160. endef
  161. define KernelPackage/ipt-nat-extra/description
  162. Netfilter (IPv4) kernel modules for extra NAT targets
  163. Includes:
  164. - MIRROR
  165. - NETMAP
  166. - REDIRECT
  167. endef
  168. $(eval $(call KernelPackage,ipt-nat-extra))
  169. define KernelPackage/ipt-nathelper
  170. $(call KernelPackage/ipt/Depends,+kmod-ipt-nat)
  171. TITLE:=Basic Conntrack and NAT helpers
  172. KCONFIG:=$(KCONFIG_IPT_NATHELPER)
  173. FILES:=$(foreach mod,$(IPT_NATHELPER-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  174. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER-m)))
  175. endef
  176. define KernelPackage/ipt-nathelper/description
  177. Default Netfilter (IPv4) Conntrack and NAT helpers
  178. Includes:
  179. - ip_conntrack_ftp
  180. - ip_nat_ftp
  181. - nf_conntrack_ftp
  182. - nf_nat_ftp
  183. - ip_conntrack_irc
  184. - ip_nat_irc
  185. - nf_conntrack_irc
  186. - nf_nat_irc
  187. - ip_conntrack_tftp
  188. - nf_conntrack_tftp
  189. - nf_nat_tftp
  190. endef
  191. $(eval $(call KernelPackage,ipt-nathelper))
  192. define KernelPackage/ipt-nathelper-extra
  193. $(call KernelPackage/ipt/Depends,+kmod-ipt-nat +LINUX_2_6:kmod-textsearch)
  194. TITLE:=Extra Conntrack and NAT helpers
  195. KCONFIG:=$(KCONFIG_IPT_NATHELPER_EXTRA)
  196. FILES:=$(foreach mod,$(IPT_NATHELPER_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  197. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER_EXTRA-m)))
  198. endef
  199. define KernelPackage/ipt-nathelper-extra/description
  200. Extra Netfilter (IPv4) Conntrack and NAT helpers
  201. Includes:
  202. - ip_conntrack_amanda
  203. - nf_conntrack_amanda
  204. - nf_nat_amanda
  205. - ip_conntrack_proto_gre
  206. - ip_nat_proto_gre
  207. - nf_conntrack_proto_gre
  208. - nf_nat_proto_gre
  209. - ip_conntrack_h323
  210. - ip_nat_h323
  211. - nf_conntrack_h323
  212. - nf_nat_h323
  213. - ip_conntrack_mms
  214. - ip_nat_mms
  215. - ip_conntrack_pptp
  216. - ip_nat_pptp
  217. - nf_conntrack_pptp
  218. - nf_nat_pptp
  219. - ip_conntrack_rtsp
  220. - ip_nat_rtsp
  221. - nf_conntrack_rtsp
  222. - nf_nat_rtsp
  223. - ip_conntrack_sip
  224. - ip_nat_sip
  225. - nf_conntrack_sip
  226. - nf_nat_sip
  227. - ip_nat_snmp_basic
  228. - nf_nat_snmp_basic
  229. endef
  230. $(eval $(call KernelPackage,ipt-nathelper-extra))
  231. define KernelPackage/ipt-imq
  232. $(call KernelPackage/ipt/Depends,)
  233. TITLE:=Intermediate Queueing support
  234. KCONFIG:= \
  235. CONFIG_IMQ \
  236. CONFIG_IMQ_BEHAVIOR_BA=y \
  237. CONFIG_IMQ_NUM_DEVS=2 \
  238. CONFIG_NETFILTER_XT_TARGET_IMQ
  239. FILES:= \
  240. $(LINUX_DIR)/drivers/net/imq.$(LINUX_KMOD_SUFFIX) \
  241. $(foreach mod,$(IPT_IMQ-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  242. AUTOLOAD:=$(call AutoLoad,45,$(notdir \
  243. imq \
  244. $(IPT_IMQ-m) \
  245. ))
  246. endef
  247. define KernelPackage/ipt-imq/description
  248. Kernel support for Intermediate Queueing devices
  249. endef
  250. $(eval $(call KernelPackage,ipt-imq))
  251. define KernelPackage/ipt-queue
  252. $(call KernelPackage/ipt/Depends,)
  253. TITLE:=Module for user-space packet queueing
  254. KCONFIG:=$(KCONFIG_IPT_QUEUE)
  255. FILES:=$(foreach mod,$(IPT_QUEUE-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  256. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_QUEUE-m)))
  257. endef
  258. define KernelPackage/ipt-queue/description
  259. Netfilter (IPv4) module for user-space packet queueing
  260. Includes:
  261. - QUEUE
  262. endef
  263. $(eval $(call KernelPackage,ipt-queue))
  264. define KernelPackage/ipt-ulog
  265. $(call KernelPackage/ipt/Depends,)
  266. TITLE:=Module for user-space packet logging
  267. KCONFIG:=$(KCONFIG_IPT_ULOG)
  268. FILES:=$(foreach mod,$(IPT_ULOG-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  269. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_ULOG-m)))
  270. endef
  271. define KernelPackage/ipt-ulog/description
  272. Netfilter (IPv4) module for user-space packet logging
  273. Includes:
  274. - ipt_ULOG
  275. endef
  276. $(eval $(call KernelPackage,ipt-ulog))
  277. define KernelPackage/ipt-iprange
  278. $(call KernelPackage/ipt/Depends,)
  279. TITLE:=Module for matching ip ranges
  280. KCONFIG:=$(KCONFIG_IPT_IPRANGE)
  281. FILES:=$(foreach mod,$(IPT_IPRANGE-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  282. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPRANGE-m)))
  283. endef
  284. define KernelPackage/ipt-iprange/description
  285. Netfilter (IPv4) module for matching ip ranges
  286. Includes:
  287. - ipt_IPRANGE
  288. endef
  289. $(eval $(call KernelPackage,ipt-iprange))
  290. define KernelPackage/ipt-extra
  291. $(call KernelPackage/ipt/Depends,)
  292. TITLE:=Extra modules
  293. KCONFIG:=$(KCONFIG_IPT_EXTRA)
  294. FILES:=$(foreach mod,$(IPT_EXTRA-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  295. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_EXTRA-m)))
  296. endef
  297. define KernelPackage/ipt-extra/description
  298. Other Netfilter (IPv4) kernel modules
  299. Includes:
  300. - ipt_condition
  301. - ipt_owner
  302. - xt_physdev
  303. - ipt_pkttype
  304. - xt_pkttype
  305. - xt_quota
  306. endef
  307. $(eval $(call KernelPackage,ipt-extra))
  308. define KernelPackage/ip6tables
  309. SUBMENU:=$(NF_MENU)
  310. TITLE:=IPv6 modules
  311. DEPENDS:=+kmod-ipv6
  312. KCONFIG:=$(KCONFIG_IPT_IPV6)
  313. FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  314. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPT_IPV6-m)))
  315. endef
  316. define KernelPackage/ip6tables/description
  317. Netfilter IPv6 firewalling support
  318. endef
  319. $(eval $(call KernelPackage,ip6tables))
  320. define KernelPackage/arptables
  321. SUBMENU:=$(NF_MENU)
  322. TITLE:=ARP firewalling modules
  323. FILES:=$(LINUX_DIR)/net/ipv4/netfilter/arp*.$(LINUX_KMOD_SUFFIX)
  324. KCONFIG:=CONFIG_IP_NF_ARPTABLES \
  325. CONFIG_IP_NF_ARPFILTER \
  326. CONFIG_IP_NF_ARP_MANGLE
  327. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(patsubst %.$(LINUX_KMOD_SUFFIX),%,$(wildcard $(LINUX_DIR)/net/ipv4/netfilter/arp*.$(LINUX_KMOD_SUFFIX)))))
  328. endef
  329. define KernelPackage/arptables/description
  330. Kernel modules for ARP firewalling
  331. endef
  332. $(eval $(call KernelPackage,arptables))
  333. define KernelPackage/ebtables
  334. SUBMENU:=$(NF_MENU)
  335. TITLE:=Bridge firewalling modules
  336. DEPENDS:=@LINUX_2_6
  337. FILES:=$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  338. KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
  339. $(KCONFIG_EBTABLES)
  340. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES-m)))
  341. endef
  342. define KernelPackage/ebtables/description
  343. ebtables is a general, extensible frame/packet identification
  344. framework. It provides you to do Ethernet
  345. filtering/NAT/brouting on the Ethernet bridge.
  346. endef
  347. $(eval $(call KernelPackage,ebtables))
  348. define KernelPackage/ebtables/Depends
  349. SUBMENU:=$(NF_MENU)
  350. DEPENDS:=kmod-ebtables $(1)
  351. endef
  352. define KernelPackage/ebtables-ipv4
  353. $(call KernelPackage/ebtables/Depends,)
  354. TITLE:=ebtables: IPv4 support
  355. FILES:=$(foreach mod,$(EBTABLES_IP4-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  356. KCONFIG:=$(KCONFIG_EBTABLES_IP4)
  357. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP4-m)))
  358. endef
  359. define KernelPackage/ebtables-ipv4/description
  360. This option adds the IPv4 support to ebtables, which allows basic
  361. IPv4 header field filtering, ARP filtering as well as SNAT, DNAT targets.
  362. endef
  363. $(eval $(call KernelPackage,ebtables-ipv4))
  364. define KernelPackage/ebtables-ipv6
  365. $(call KernelPackage/ebtables/Depends,)
  366. TITLE:=ebtables: IPv6 support
  367. FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  368. KCONFIG:=$(KCONFIG_EBTABLES_IP6)
  369. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP6-m)))
  370. endef
  371. define KernelPackage/ebtables-ipv6/description
  372. This option adds the IPv6 support to ebtables, which allows basic
  373. IPv6 header field filtering and target support.
  374. endef
  375. $(eval $(call KernelPackage,ebtables-ipv6))
  376. define KernelPackage/ebtables-watchers
  377. $(call KernelPackage/ebtables/Depends,)
  378. TITLE:=ebtables: watchers support
  379. FILES:=$(foreach mod,$(EBTABLES_WATCHERS-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  380. KCONFIG:=$(KCONFIG_EBTABLES_WATCHERS)
  381. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_WATCHERS-m)))
  382. endef
  383. define KernelPackage/ebtables-watchers/description
  384. This option adds the log watchers, that you can use in any rule
  385. in any ebtables table.
  386. endef
  387. $(eval $(call KernelPackage,ebtables-watchers))
  388. define KernelPackage/nfnetlink
  389. SUBMENU:=$(NF_MENU)
  390. TITLE:=Netlink-based userspace interface
  391. DEPENDS:=@LINUX_2_6 +kmod-ipt-core
  392. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink.$(LINUX_KMOD_SUFFIX)
  393. KCONFIG:=CONFIG_NETFILTER_NETLINK
  394. AUTOLOAD:=$(call AutoLoad,48,nfnetlink)
  395. endef
  396. define KernelPackage/nfnetlink/description
  397. Kernel modules support for a netlink-based userspace interface
  398. endef
  399. $(eval $(call KernelPackage,nfnetlink))
  400. define KernelPackage/nfnetlink/Depends
  401. SUBMENU:=$(NF_MENU)
  402. DEPENDS:=@LINUX_2_6 +kmod-nfnetlink $(1)
  403. endef
  404. define KernelPackage/nfnetlink-log
  405. $(call KernelPackage/nfnetlink/Depends,)
  406. TITLE:=Netfilter LOG over NFNETLINK interface
  407. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_log.$(LINUX_KMOD_SUFFIX)
  408. KCONFIG:=CONFIG_NETFILTER_NETLINK_LOG
  409. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_log)
  410. endef
  411. define KernelPackage/nfnetlink-log/description
  412. Kernel modules support for logging packets via NFNETLINK
  413. endef
  414. $(eval $(call KernelPackage,nfnetlink-log))
  415. define KernelPackage/nfnetlink-queue
  416. $(call KernelPackage/nfnetlink/Depends,)
  417. TITLE:=Netfilter QUEUE over NFNETLINK interface
  418. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_queue.$(LINUX_KMOD_SUFFIX)
  419. KCONFIG:=CONFIG_NETFILTER_NETLINK_QUEUE
  420. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_queue)
  421. endef
  422. define KernelPackage/nfnetlink-queue/description
  423. Kernel modules support for queueing packets via NFNETLINK
  424. endef
  425. $(eval $(call KernelPackage,nfnetlink-queue))
  426. define KernelPackage/nf-conntrack-netlink
  427. $(call KernelPackage/nfnetlink/Depends,+kmod-ipt-conntrack)
  428. TITLE:=Connection tracking netlink interface
  429. FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.$(LINUX_KMOD_SUFFIX)
  430. KCONFIG:=CONFIG_NF_CT_NETLINK
  431. AUTOLOAD:=$(call AutoLoad,49,nf_conntrack_netlink)
  432. endef
  433. define KernelPackage/nf-conntrack-netlink/description
  434. Kernel modules support for a netlink-based connection tracking
  435. userspace interface
  436. endef
  437. $(eval $(call KernelPackage,nf-conntrack-netlink))