netfilter.mk 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  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
  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
  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
  98. - length
  99. - mark/MARK
  100. - statistic
  101. - tcpmss
  102. - time
  103. - unclean
  104. endef
  105. $(eval $(call KernelPackage,ipt-ipopt))
  106. define KernelPackage/ipt-ipsec
  107. TITLE:=Modules for matching IPSec packets
  108. KCONFIG:=$(KCONFIG_IPT_IPSEC)
  109. FILES:=$(foreach mod,$(IPT_IPSEC-m),$(LINUX_DIR)/net/$(mod).ko)
  110. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPSEC-m)))
  111. $(call AddDepends/ipt)
  112. endef
  113. define KernelPackage/ipt-ipsec/description
  114. Netfilter (IPv4) modules for matching IPSec packets
  115. Includes:
  116. - ah
  117. - esp
  118. - policy
  119. endef
  120. $(eval $(call KernelPackage,ipt-ipsec))
  121. define KernelPackage/ipt-nat
  122. TITLE:=Basic NAT targets
  123. KCONFIG:=$(KCONFIG_IPT_NAT)
  124. FILES:=$(foreach mod,$(IPT_NAT-m),$(LINUX_DIR)/net/$(mod).ko)
  125. AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_NAT-m)))
  126. $(call AddDepends/ipt,+kmod-ipt-conntrack)
  127. endef
  128. define KernelPackage/ipt-nat/description
  129. Netfilter (IPv4) kernel modules for basic NAT targets
  130. Includes:
  131. - MASQUERADE
  132. endef
  133. $(eval $(call KernelPackage,ipt-nat))
  134. define KernelPackage/ipt-nat-extra
  135. TITLE:=Extra NAT targets
  136. KCONFIG:=$(KCONFIG_IPT_NAT_EXTRA)
  137. FILES:=$(foreach mod,$(IPT_NAT_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
  138. AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_NAT_EXTRA-m)))
  139. $(call AddDepends/ipt,+kmod-ipt-nat)
  140. endef
  141. define KernelPackage/ipt-nat-extra/description
  142. Netfilter (IPv4) kernel modules for extra NAT targets
  143. Includes:
  144. - NETMAP
  145. - REDIRECT
  146. endef
  147. $(eval $(call KernelPackage,ipt-nat-extra))
  148. define KernelPackage/ipt-nathelper
  149. TITLE:=Basic Conntrack and NAT helpers
  150. KCONFIG:=$(KCONFIG_IPT_NATHELPER)
  151. FILES:=$(foreach mod,$(IPT_NATHELPER-m),$(LINUX_DIR)/net/$(mod).ko)
  152. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER-m)))
  153. $(call AddDepends/ipt,+kmod-ipt-nat)
  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. TITLE:=Extra Conntrack and NAT helpers
  165. KCONFIG:=$(KCONFIG_IPT_NATHELPER_EXTRA)
  166. FILES:=$(foreach mod,$(IPT_NATHELPER_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
  167. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER_EXTRA-m)))
  168. $(call AddDepends/ipt,+kmod-ipt-nat +kmod-textsearch)
  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
  177. - proto_gre
  178. - rtsp
  179. - sip
  180. - snmp_basic
  181. endef
  182. $(eval $(call KernelPackage,ipt-nathelper-extra))
  183. define KernelPackage/ipt-queue
  184. TITLE:=Module for user-space packet queueing
  185. KCONFIG:=$(KCONFIG_IPT_QUEUE)
  186. FILES:=$(foreach mod,$(IPT_QUEUE-m),$(LINUX_DIR)/net/$(mod).ko)
  187. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_QUEUE-m)))
  188. $(call AddDepends/ipt)
  189. endef
  190. define KernelPackage/ipt-queue/description
  191. Netfilter (IPv4) module for user-space packet queueing
  192. Includes:
  193. - QUEUE
  194. endef
  195. $(eval $(call KernelPackage,ipt-queue))
  196. define KernelPackage/ipt-ulog
  197. TITLE:=Module for user-space packet logging
  198. KCONFIG:=$(KCONFIG_IPT_ULOG)
  199. FILES:=$(foreach mod,$(IPT_ULOG-m),$(LINUX_DIR)/net/$(mod).ko)
  200. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_ULOG-m)))
  201. $(call AddDepends/ipt)
  202. endef
  203. define KernelPackage/ipt-ulog/description
  204. Netfilter (IPv4) module for user-space packet logging
  205. Includes:
  206. - ULOG
  207. endef
  208. $(eval $(call KernelPackage,ipt-ulog))
  209. define KernelPackage/ipt-debug
  210. TITLE:=Module for debugging/development
  211. KCONFIG:=$(KCONFIG_IPT_DEBUG)
  212. DEFAULT:=n
  213. FILES:=$(foreach mod,$(IPT_DEBUG-m),$(LINUX_DIR)/net/$(mod).ko)
  214. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_DEBUG-m)))
  215. $(call AddDepends/ipt)
  216. endef
  217. define KernelPackage/ipt-debug/description
  218. Netfilter modules for debugging/development of the firewall
  219. Includes:
  220. - TRACE
  221. endef
  222. $(eval $(call KernelPackage,ipt-debug))
  223. define KernelPackage/ipt-led
  224. TITLE:=Module to trigger a LED with a Netfilter rule
  225. KCONFIG:=$(KCONFIG_IPT_LED)
  226. FILES:=$(foreach mod,$(IPT_LED-m),$(LINUX_DIR)/net/$(mod).ko)
  227. AUTOLOAD:=$(call AutoLoad,61,$(notdir $(IPT_LED-m)))
  228. $(call AddDepends/ipt)
  229. endef
  230. define KernelPackage/ipt-led/description
  231. Netfilter target to trigger a LED when a network packet is matched.
  232. endef
  233. $(eval $(call KernelPackage,ipt-led))
  234. define KernelPackage/ipt-tproxy
  235. TITLE:=Transparent proxying support
  236. DEPENDS+=+IPV6:kmod-ipv6
  237. KCONFIG:= \
  238. CONFIG_NETFILTER_TPROXY \
  239. CONFIG_NETFILTER_XT_MATCH_SOCKET \
  240. CONFIG_NETFILTER_XT_TARGET_TPROXY
  241. FILES:= \
  242. $(LINUX_DIR)/net/netfilter/nf_tproxy_core.ko \
  243. $(foreach mod,$(IPT_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko)
  244. AUTOLOAD:=$(call AutoLoad,50,$(notdir nf_tproxy_core $(IPT_TPROXY-m)))
  245. $(call AddDepends/ipt)
  246. endef
  247. define KernelPackage/ipt-tproxy/description
  248. Kernel modules for Transparent Proxying
  249. endef
  250. $(eval $(call KernelPackage,ipt-tproxy))
  251. define KernelPackage/ipt-iprange
  252. TITLE:=Module for matching ip ranges
  253. KCONFIG:=$(KCONFIG_IPT_IPRANGE)
  254. FILES:=$(foreach mod,$(IPT_IPRANGE-m),$(LINUX_DIR)/net/$(mod).ko)
  255. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPRANGE-m)))
  256. $(call AddDepends/ipt)
  257. endef
  258. define KernelPackage/ipt-iprange/description
  259. Netfilter (IPv4) module for matching ip ranges
  260. Includes:
  261. - iprange
  262. endef
  263. $(eval $(call KernelPackage,ipt-iprange))
  264. define KernelPackage/ipt-extra
  265. TITLE:=Extra modules
  266. KCONFIG:=$(KCONFIG_IPT_EXTRA)
  267. FILES:=$(foreach mod,$(IPT_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
  268. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_EXTRA-m)))
  269. $(call AddDepends/ipt)
  270. endef
  271. define KernelPackage/ipt-extra/description
  272. Other Netfilter (IPv4) kernel modules
  273. Includes:
  274. - owner
  275. - physdev (if bridge support was enabled in kernel)
  276. - pkttype
  277. - quota
  278. endef
  279. $(eval $(call KernelPackage,ipt-extra))
  280. define KernelPackage/ip6tables
  281. SUBMENU:=$(NF_MENU)
  282. TITLE:=IPv6 modules
  283. DEPENDS:=+kmod-ipv6
  284. KCONFIG:=$(KCONFIG_IPT_IPV6)
  285. FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).ko)
  286. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPT_IPV6-m)))
  287. endef
  288. define KernelPackage/ip6tables/description
  289. Netfilter IPv6 firewalling support
  290. endef
  291. $(eval $(call KernelPackage,ip6tables))
  292. define KernelPackage/arptables
  293. SUBMENU:=$(NF_MENU)
  294. TITLE:=ARP firewalling modules
  295. FILES:=$(LINUX_DIR)/net/ipv4/netfilter/arp*.ko
  296. KCONFIG:=CONFIG_IP_NF_ARPTABLES \
  297. CONFIG_IP_NF_ARPFILTER \
  298. CONFIG_IP_NF_ARP_MANGLE
  299. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(patsubst %.ko,%,$(wildcard $(LINUX_DIR)/net/ipv4/netfilter/arp*.ko))))
  300. endef
  301. define KernelPackage/arptables/description
  302. Kernel modules for ARP firewalling
  303. endef
  304. $(eval $(call KernelPackage,arptables))
  305. define KernelPackage/ebtables
  306. SUBMENU:=$(NF_MENU)
  307. TITLE:=Bridge firewalling modules
  308. FILES:=$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).ko)
  309. KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
  310. $(KCONFIG_EBTABLES)
  311. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES-m)))
  312. endef
  313. define KernelPackage/ebtables/description
  314. ebtables is a general, extensible frame/packet identification
  315. framework. It provides you to do Ethernet
  316. filtering/NAT/brouting on the Ethernet bridge.
  317. endef
  318. $(eval $(call KernelPackage,ebtables))
  319. define AddDepends/ebtables
  320. SUBMENU:=$(NF_MENU)
  321. DEPENDS+=kmod-ebtables $(1)
  322. endef
  323. define KernelPackage/ebtables-ipv4
  324. TITLE:=ebtables: IPv4 support
  325. FILES:=$(foreach mod,$(EBTABLES_IP4-m),$(LINUX_DIR)/net/$(mod).ko)
  326. KCONFIG:=$(KCONFIG_EBTABLES_IP4)
  327. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP4-m)))
  328. $(call AddDepends/ebtables)
  329. endef
  330. define KernelPackage/ebtables-ipv4/description
  331. This option adds the IPv4 support to ebtables, which allows basic
  332. IPv4 header field filtering, ARP filtering as well as SNAT, DNAT targets.
  333. endef
  334. $(eval $(call KernelPackage,ebtables-ipv4))
  335. define KernelPackage/ebtables-ipv6
  336. TITLE:=ebtables: IPv6 support
  337. FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).ko)
  338. KCONFIG:=$(KCONFIG_EBTABLES_IP6)
  339. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP6-m)))
  340. $(call AddDepends/ebtables)
  341. endef
  342. define KernelPackage/ebtables-ipv6/description
  343. This option adds the IPv6 support to ebtables, which allows basic
  344. IPv6 header field filtering and target support.
  345. endef
  346. $(eval $(call KernelPackage,ebtables-ipv6))
  347. define KernelPackage/ebtables-watchers
  348. TITLE:=ebtables: watchers support
  349. FILES:=$(foreach mod,$(EBTABLES_WATCHERS-m),$(LINUX_DIR)/net/$(mod).ko)
  350. KCONFIG:=$(KCONFIG_EBTABLES_WATCHERS)
  351. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_WATCHERS-m)))
  352. $(call AddDepends/ebtables)
  353. endef
  354. define KernelPackage/ebtables-watchers/description
  355. This option adds the log watchers, that you can use in any rule
  356. in any ebtables table.
  357. endef
  358. $(eval $(call KernelPackage,ebtables-watchers))
  359. define KernelPackage/nfnetlink
  360. SUBMENU:=$(NF_MENU)
  361. TITLE:=Netlink-based userspace interface
  362. DEPENDS:=+kmod-ipt-core
  363. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink.ko
  364. KCONFIG:=CONFIG_NETFILTER_NETLINK
  365. AUTOLOAD:=$(call AutoLoad,48,nfnetlink)
  366. endef
  367. define KernelPackage/nfnetlink/description
  368. Kernel modules support for a netlink-based userspace interface
  369. endef
  370. $(eval $(call KernelPackage,nfnetlink))
  371. define AddDepends/nfnetlink
  372. SUBMENU:=$(NF_MENU)
  373. DEPENDS+=+kmod-nfnetlink $(1)
  374. endef
  375. define KernelPackage/nfnetlink-log
  376. TITLE:=Netfilter LOG over NFNETLINK interface
  377. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_log.ko
  378. KCONFIG:=CONFIG_NETFILTER_NETLINK_LOG
  379. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_log)
  380. $(call AddDepends/nfnetlink)
  381. endef
  382. define KernelPackage/nfnetlink-log/description
  383. Kernel modules support for logging packets via NFNETLINK
  384. endef
  385. $(eval $(call KernelPackage,nfnetlink-log))
  386. define KernelPackage/nfnetlink-queue
  387. TITLE:=Netfilter QUEUE over NFNETLINK interface
  388. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_queue.ko
  389. KCONFIG:=CONFIG_NETFILTER_NETLINK_QUEUE
  390. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_queue)
  391. $(call AddDepends/nfnetlink)
  392. endef
  393. define KernelPackage/nfnetlink-queue/description
  394. Kernel modules support for queueing packets via NFNETLINK
  395. endef
  396. $(eval $(call KernelPackage,nfnetlink-queue))
  397. define KernelPackage/nf-conntrack-netlink
  398. TITLE:=Connection tracking netlink interface
  399. FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.ko
  400. KCONFIG:=CONFIG_NF_CT_NETLINK
  401. AUTOLOAD:=$(call AutoLoad,49,nf_conntrack_netlink)
  402. $(call AddDepends/nfnetlink,+kmod-ipt-conntrack)
  403. endef
  404. define KernelPackage/nf-conntrack-netlink/description
  405. Kernel modules support for a netlink-based connection tracking
  406. userspace interface
  407. endef
  408. $(eval $(call KernelPackage,nf-conntrack-netlink))
  409. define KernelPackage/ipt-hashlimit
  410. SUBMENU:=$(NF_MENU)
  411. TITLE:=Netfilter hashlimit match
  412. KCONFIG:=$(KCONFIG_IPT_HASHLIMIT)
  413. FILES:=$(LINUX_DIR)/net/netfilter/xt_hashlimit.ko
  414. AUTOLOAD:=$(call AutoLoad,50,xt_hashlimit)
  415. $(call KernelPackage/ipt)
  416. endef
  417. define KernelPackage/ipt-hashlimit/description
  418. Kernel modules support for the hashlimit bucket match module
  419. endef
  420. $(eval $(call KernelPackage,ipt-hashlimit))