netfilter.mk 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. #
  2. # Copyright (C) 2006-2010 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:= \
  14. CONFIG_NETFILTER=y \
  15. CONFIG_NETFILTER_ADVANCED=y \
  16. $(KCONFIG_IPT_CORE)
  17. FILES:=$(foreach mod,$(IPT_CORE-m),$(LINUX_DIR)/net/$(mod).ko)
  18. AUTOLOAD:=$(call AutoLoad,40,$(notdir $(IPT_CORE-m)))
  19. endef
  20. define KernelPackage/ipt-core/description
  21. Netfilter core kernel modules
  22. Includes:
  23. - comment (2.6)
  24. - limit
  25. - LOG
  26. - mac
  27. - multiport
  28. - REJECT
  29. - TCPMSS
  30. endef
  31. $(eval $(call KernelPackage,ipt-core))
  32. define AddDepends/ipt
  33. SUBMENU:=$(NF_MENU)
  34. DEPENDS+= kmod-ipt-core $(1)
  35. endef
  36. define KernelPackage/ipt-conntrack
  37. TITLE:=Basic connection tracking modules
  38. KCONFIG:=$(KCONFIG_IPT_CONNTRACK)
  39. FILES:=$(foreach mod,$(IPT_CONNTRACK-m),$(LINUX_DIR)/net/$(mod).ko)
  40. AUTOLOAD:=$(call AutoLoad,41,$(notdir $(IPT_CONNTRACK-m)))
  41. $(call AddDepends/ipt)
  42. endef
  43. define KernelPackage/ipt-conntrack/description
  44. Netfilter (IPv4) kernel modules for connection tracking
  45. Includes:
  46. - conntrack
  47. - defrag (2.6)
  48. - iptables_raw
  49. - NOTRACK
  50. - state
  51. endef
  52. $(eval $(call KernelPackage,ipt-conntrack))
  53. define KernelPackage/ipt-conntrack-extra
  54. TITLE:=Extra connection tracking modules
  55. KCONFIG:=$(KCONFIG_IPT_CONNTRACK_EXTRA)
  56. FILES:=$(foreach mod,$(IPT_CONNTRACK_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
  57. AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_CONNTRACK_EXTRA-m)))
  58. $(call AddDepends/ipt,+kmod-ipt-conntrack)
  59. endef
  60. define KernelPackage/ipt-conntrack-extra/description
  61. Netfilter (IPv4) extra kernel modules for connection tracking
  62. Includes:
  63. - connbytes
  64. - connmark/CONNMARK
  65. - conntrack
  66. - helper
  67. - recent
  68. endef
  69. $(eval $(call KernelPackage,ipt-conntrack-extra))
  70. define KernelPackage/ipt-filter
  71. TITLE:=Modules for packet content inspection
  72. KCONFIG:=$(KCONFIG_IPT_FILTER)
  73. FILES:=$(foreach mod,$(IPT_FILTER-m),$(LINUX_DIR)/net/$(mod).ko)
  74. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_FILTER-m)))
  75. $(call AddDepends/ipt,+kmod-textsearch)
  76. endef
  77. define KernelPackage/ipt-filter/description
  78. Netfilter (IPv4) kernel modules for packet content inspection
  79. Includes:
  80. - layer7
  81. - string
  82. endef
  83. $(eval $(call KernelPackage,ipt-filter))
  84. define KernelPackage/ipt-ipopt
  85. TITLE:=Modules for matching/changing IP packet options
  86. KCONFIG:=$(KCONFIG_IPT_IPOPT)
  87. FILES:=$(foreach mod,$(IPT_IPOPT-m),$(LINUX_DIR)/net/$(mod).ko)
  88. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPOPT-m)))
  89. $(call AddDepends/ipt)
  90. endef
  91. define KernelPackage/ipt-ipopt/description
  92. Netfilter (IPv4) modules for matching/changing IP packet options
  93. Includes:
  94. - CLASSIFY
  95. - dscp/DSCP
  96. - ecn/ECN
  97. - hl/HL (2.6.30 and later)
  98. - length
  99. - mark/MARK
  100. - statistic (2.6)
  101. - tcpmss
  102. - time
  103. - tos/TOS (prior to 2.6.25)
  104. - ttl/TTL (prior to 2.6.30)
  105. - unclean
  106. endef
  107. $(eval $(call KernelPackage,ipt-ipopt))
  108. define KernelPackage/ipt-ipsec
  109. TITLE:=Modules for matching IPSec packets
  110. KCONFIG:=$(KCONFIG_IPT_IPSEC)
  111. FILES:=$(foreach mod,$(IPT_IPSEC-m),$(LINUX_DIR)/net/$(mod).ko)
  112. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPSEC-m)))
  113. $(call AddDepends/ipt)
  114. endef
  115. define KernelPackage/ipt-ipsec/description
  116. Netfilter (IPv4) modules for matching IPSec packets
  117. Includes:
  118. - ah
  119. - esp
  120. - policy (2.6)
  121. endef
  122. $(eval $(call KernelPackage,ipt-ipsec))
  123. define KernelPackage/ipt-nat
  124. TITLE:=Basic NAT targets
  125. KCONFIG:=$(KCONFIG_IPT_NAT)
  126. FILES:=$(foreach mod,$(IPT_NAT-m),$(LINUX_DIR)/net/$(mod).ko)
  127. AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_NAT-m)))
  128. $(call AddDepends/ipt,+kmod-ipt-conntrack)
  129. endef
  130. define KernelPackage/ipt-nat/description
  131. Netfilter (IPv4) kernel modules for basic NAT targets
  132. Includes:
  133. - MASQUERADE
  134. endef
  135. $(eval $(call KernelPackage,ipt-nat))
  136. define KernelPackage/ipt-nat-extra
  137. TITLE:=Extra NAT targets
  138. KCONFIG:=$(KCONFIG_IPT_NAT_EXTRA)
  139. FILES:=$(foreach mod,$(IPT_NAT_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
  140. AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_NAT_EXTRA-m)))
  141. $(call AddDepends/ipt,+kmod-ipt-nat)
  142. endef
  143. define KernelPackage/ipt-nat-extra/description
  144. Netfilter (IPv4) kernel modules for extra NAT targets
  145. Includes:
  146. - MIRROR (2.4)
  147. - NETMAP
  148. - REDIRECT
  149. endef
  150. $(eval $(call KernelPackage,ipt-nat-extra))
  151. define KernelPackage/ipt-nathelper
  152. TITLE:=Basic Conntrack and NAT helpers
  153. KCONFIG:=$(KCONFIG_IPT_NATHELPER)
  154. FILES:=$(foreach mod,$(IPT_NATHELPER-m),$(LINUX_DIR)/net/$(mod).ko)
  155. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER-m)))
  156. $(call AddDepends/ipt,+kmod-ipt-nat)
  157. endef
  158. define KernelPackage/ipt-nathelper/description
  159. Default Netfilter (IPv4) Conntrack and NAT helpers
  160. Includes:
  161. - ftp
  162. - irc
  163. - tftp
  164. endef
  165. $(eval $(call KernelPackage,ipt-nathelper))
  166. define KernelPackage/ipt-nathelper-extra
  167. TITLE:=Extra Conntrack and NAT helpers
  168. KCONFIG:=$(KCONFIG_IPT_NATHELPER_EXTRA)
  169. FILES:=$(foreach mod,$(IPT_NATHELPER_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
  170. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER_EXTRA-m)))
  171. $(call AddDepends/ipt,+kmod-ipt-nat +kmod-textsearch)
  172. endef
  173. define KernelPackage/ipt-nathelper-extra/description
  174. Extra Netfilter (IPv4) Conntrack and NAT helpers
  175. Includes:
  176. - amanda
  177. - h323
  178. - mms
  179. - pptp (2.6)
  180. - proto_gre (2.6)
  181. - rtsp
  182. - sip (2.6)
  183. - snmp_basic
  184. endef
  185. $(eval $(call KernelPackage,ipt-nathelper-extra))
  186. define KernelPackage/ipt-imq
  187. TITLE:=Intermediate Queueing support
  188. KCONFIG:= \
  189. CONFIG_IMQ \
  190. CONFIG_IMQ_BEHAVIOR_BA=y \
  191. CONFIG_IMQ_NUM_DEVS=2 \
  192. CONFIG_NETFILTER_XT_TARGET_IMQ
  193. FILES:= \
  194. $(LINUX_DIR)/drivers/net/imq.ko \
  195. $(foreach mod,$(IPT_IMQ-m),$(LINUX_DIR)/net/$(mod).ko)
  196. AUTOLOAD:=$(call AutoLoad,46,$(notdir \
  197. imq \
  198. $(IPT_IMQ-m) \
  199. ))
  200. $(call AddDepends/ipt)
  201. endef
  202. define KernelPackage/ipt-imq/description
  203. Kernel support for Intermediate Queueing devices
  204. endef
  205. $(eval $(call KernelPackage,ipt-imq))
  206. define KernelPackage/ipt-queue
  207. TITLE:=Module for user-space packet queueing
  208. KCONFIG:=$(KCONFIG_IPT_QUEUE)
  209. FILES:=$(foreach mod,$(IPT_QUEUE-m),$(LINUX_DIR)/net/$(mod).ko)
  210. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_QUEUE-m)))
  211. $(call AddDepends/ipt)
  212. endef
  213. define KernelPackage/ipt-queue/description
  214. Netfilter (IPv4) module for user-space packet queueing
  215. Includes:
  216. - QUEUE
  217. endef
  218. $(eval $(call KernelPackage,ipt-queue))
  219. define KernelPackage/ipt-ulog
  220. TITLE:=Module for user-space packet logging
  221. KCONFIG:=$(KCONFIG_IPT_ULOG)
  222. FILES:=$(foreach mod,$(IPT_ULOG-m),$(LINUX_DIR)/net/$(mod).ko)
  223. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_ULOG-m)))
  224. $(call AddDepends/ipt)
  225. endef
  226. define KernelPackage/ipt-ulog/description
  227. Netfilter (IPv4) module for user-space packet logging
  228. Includes:
  229. - ULOG
  230. endef
  231. $(eval $(call KernelPackage,ipt-ulog))
  232. define KernelPackage/ipt-tproxy
  233. TITLE:=Transparent proxying support
  234. KCONFIG:= \
  235. CONFIG_NETFILTER_TPROXY \
  236. CONFIG_NETFILTER_XT_MATCH_SOCKET \
  237. CONFIG_NETFILTER_XT_TARGET_TPROXY
  238. FILES:= \
  239. $(LINUX_DIR)/net/netfilter/nf_tproxy_core.ko \
  240. $(foreach mod,$(IPT_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko)
  241. AUTOLOAD:=$(call AutoLoad,45,$(notdir nf_tproxy_core $(IPT_TPROXY-m)))
  242. $(call AddDepends/ipt)
  243. endef
  244. define KernelPackage/ipt-tproxy/description
  245. Kernel modules for Transparent Proxying
  246. endef
  247. $(eval $(call KernelPackage,ipt-tproxy))
  248. define KernelPackage/ipt-iprange
  249. TITLE:=Module for matching ip ranges
  250. KCONFIG:=$(KCONFIG_IPT_IPRANGE)
  251. FILES:=$(foreach mod,$(IPT_IPRANGE-m),$(LINUX_DIR)/net/$(mod).ko)
  252. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPRANGE-m)))
  253. $(call AddDepends/ipt)
  254. endef
  255. define KernelPackage/ipt-iprange/description
  256. Netfilter (IPv4) module for matching ip ranges
  257. Includes:
  258. - iprange
  259. endef
  260. $(eval $(call KernelPackage,ipt-iprange))
  261. define KernelPackage/ipt-extra
  262. TITLE:=Extra modules
  263. KCONFIG:=$(KCONFIG_IPT_EXTRA)
  264. FILES:=$(foreach mod,$(IPT_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
  265. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_EXTRA-m)))
  266. $(call AddDepends/ipt)
  267. endef
  268. define KernelPackage/ipt-extra/description
  269. Other Netfilter (IPv4) kernel modules
  270. Includes:
  271. - condition (2.4 only)
  272. - owner
  273. - physdev (if bridge support was enabled in kernel)
  274. - pkttype
  275. - quota
  276. endef
  277. $(eval $(call KernelPackage,ipt-extra))
  278. define KernelPackage/ip6tables
  279. SUBMENU:=$(NF_MENU)
  280. TITLE:=IPv6 modules
  281. DEPENDS:=+kmod-ipv6
  282. KCONFIG:=$(KCONFIG_IPT_IPV6)
  283. FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).ko)
  284. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPT_IPV6-m)))
  285. endef
  286. define KernelPackage/ip6tables/description
  287. Netfilter IPv6 firewalling support
  288. endef
  289. $(eval $(call KernelPackage,ip6tables))
  290. define KernelPackage/arptables
  291. SUBMENU:=$(NF_MENU)
  292. TITLE:=ARP firewalling modules
  293. FILES:=$(LINUX_DIR)/net/ipv4/netfilter/arp*.ko
  294. KCONFIG:=CONFIG_IP_NF_ARPTABLES \
  295. CONFIG_IP_NF_ARPFILTER \
  296. CONFIG_IP_NF_ARP_MANGLE
  297. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(patsubst %.ko,%,$(wildcard $(LINUX_DIR)/net/ipv4/netfilter/arp*.ko))))
  298. endef
  299. define KernelPackage/arptables/description
  300. Kernel modules for ARP firewalling
  301. endef
  302. $(eval $(call KernelPackage,arptables))
  303. define KernelPackage/ebtables
  304. SUBMENU:=$(NF_MENU)
  305. TITLE:=Bridge firewalling modules
  306. FILES:=$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).ko)
  307. KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
  308. $(KCONFIG_EBTABLES)
  309. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES-m)))
  310. endef
  311. define KernelPackage/ebtables/description
  312. ebtables is a general, extensible frame/packet identification
  313. framework. It provides you to do Ethernet
  314. filtering/NAT/brouting on the Ethernet bridge.
  315. endef
  316. $(eval $(call KernelPackage,ebtables))
  317. define AddDepends/ebtables
  318. SUBMENU:=$(NF_MENU)
  319. DEPENDS+=kmod-ebtables $(1)
  320. endef
  321. define KernelPackage/ebtables-ipv4
  322. TITLE:=ebtables: IPv4 support
  323. FILES:=$(foreach mod,$(EBTABLES_IP4-m),$(LINUX_DIR)/net/$(mod).ko)
  324. KCONFIG:=$(KCONFIG_EBTABLES_IP4)
  325. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP4-m)))
  326. $(call AddDepends/ebtables)
  327. endef
  328. define KernelPackage/ebtables-ipv4/description
  329. This option adds the IPv4 support to ebtables, which allows basic
  330. IPv4 header field filtering, ARP filtering as well as SNAT, DNAT targets.
  331. endef
  332. $(eval $(call KernelPackage,ebtables-ipv4))
  333. define KernelPackage/ebtables-ipv6
  334. TITLE:=ebtables: IPv6 support
  335. FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).ko)
  336. KCONFIG:=$(KCONFIG_EBTABLES_IP6)
  337. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP6-m)))
  338. $(call AddDepends/ebtables)
  339. endef
  340. define KernelPackage/ebtables-ipv6/description
  341. This option adds the IPv6 support to ebtables, which allows basic
  342. IPv6 header field filtering and target support.
  343. endef
  344. $(eval $(call KernelPackage,ebtables-ipv6))
  345. define KernelPackage/ebtables-watchers
  346. TITLE:=ebtables: watchers support
  347. FILES:=$(foreach mod,$(EBTABLES_WATCHERS-m),$(LINUX_DIR)/net/$(mod).ko)
  348. KCONFIG:=$(KCONFIG_EBTABLES_WATCHERS)
  349. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_WATCHERS-m)))
  350. $(call AddDepends/ebtables)
  351. endef
  352. define KernelPackage/ebtables-watchers/description
  353. This option adds the log watchers, that you can use in any rule
  354. in any ebtables table.
  355. endef
  356. $(eval $(call KernelPackage,ebtables-watchers))
  357. define KernelPackage/nfnetlink
  358. SUBMENU:=$(NF_MENU)
  359. TITLE:=Netlink-based userspace interface
  360. DEPENDS:=+kmod-ipt-core
  361. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink.ko
  362. KCONFIG:=CONFIG_NETFILTER_NETLINK
  363. AUTOLOAD:=$(call AutoLoad,48,nfnetlink)
  364. endef
  365. define KernelPackage/nfnetlink/description
  366. Kernel modules support for a netlink-based userspace interface
  367. endef
  368. $(eval $(call KernelPackage,nfnetlink))
  369. define AddDepends/nfnetlink
  370. SUBMENU:=$(NF_MENU)
  371. DEPENDS+=+kmod-nfnetlink $(1)
  372. endef
  373. define KernelPackage/nfnetlink-log
  374. TITLE:=Netfilter LOG over NFNETLINK interface
  375. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_log.ko
  376. KCONFIG:=CONFIG_NETFILTER_NETLINK_LOG
  377. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_log)
  378. $(call AddDepends/nfnetlink)
  379. endef
  380. define KernelPackage/nfnetlink-log/description
  381. Kernel modules support for logging packets via NFNETLINK
  382. endef
  383. $(eval $(call KernelPackage,nfnetlink-log))
  384. define KernelPackage/nfnetlink-queue
  385. TITLE:=Netfilter QUEUE over NFNETLINK interface
  386. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_queue.ko
  387. KCONFIG:=CONFIG_NETFILTER_NETLINK_QUEUE
  388. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_queue)
  389. $(call AddDepends/nfnetlink)
  390. endef
  391. define KernelPackage/nfnetlink-queue/description
  392. Kernel modules support for queueing packets via NFNETLINK
  393. endef
  394. $(eval $(call KernelPackage,nfnetlink-queue))
  395. define KernelPackage/nf-conntrack-netlink
  396. TITLE:=Connection tracking netlink interface
  397. FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.ko
  398. KCONFIG:=CONFIG_NF_CT_NETLINK
  399. AUTOLOAD:=$(call AutoLoad,49,nf_conntrack_netlink)
  400. $(call AddDepends/nfnetlink,+kmod-ipt-conntrack)
  401. endef
  402. define KernelPackage/nf-conntrack-netlink/description
  403. Kernel modules support for a netlink-based connection tracking
  404. userspace interface
  405. endef
  406. $(eval $(call KernelPackage,nf-conntrack-netlink))
  407. define KernelPackage/ipt-hashlimit
  408. SUBMENU:=$(NF_MENU)
  409. TITLE:=Netfilter hashlimit match
  410. KCONFIG:=$(KCONFIG_IPT_HASHLIMIT)
  411. FILES:=$(LINUX_DIR)/net/netfilter/xt_hashlimit.ko
  412. AUTOLOAD:=$(call AutoLoad,50,xt_hashlimit)
  413. $(call KernelPackage/ipt)
  414. endef
  415. define KernelPackage/ipt-hashlimit/description
  416. Kernel modules support for the hashlimit bucket match module
  417. endef
  418. $(eval $(call KernelPackage,ipt-hashlimit))