netfilter.mk 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  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-queue
  187. TITLE:=Module for user-space packet queueing
  188. KCONFIG:=$(KCONFIG_IPT_QUEUE)
  189. FILES:=$(foreach mod,$(IPT_QUEUE-m),$(LINUX_DIR)/net/$(mod).ko)
  190. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_QUEUE-m)))
  191. $(call AddDepends/ipt)
  192. endef
  193. define KernelPackage/ipt-queue/description
  194. Netfilter (IPv4) module for user-space packet queueing
  195. Includes:
  196. - QUEUE
  197. endef
  198. $(eval $(call KernelPackage,ipt-queue))
  199. define KernelPackage/ipt-ulog
  200. TITLE:=Module for user-space packet logging
  201. KCONFIG:=$(KCONFIG_IPT_ULOG)
  202. FILES:=$(foreach mod,$(IPT_ULOG-m),$(LINUX_DIR)/net/$(mod).ko)
  203. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_ULOG-m)))
  204. $(call AddDepends/ipt)
  205. endef
  206. define KernelPackage/ipt-ulog/description
  207. Netfilter (IPv4) module for user-space packet logging
  208. Includes:
  209. - ULOG
  210. endef
  211. $(eval $(call KernelPackage,ipt-ulog))
  212. define KernelPackage/ipt-led
  213. TITLE:=Module to trigger a LED with a Netfilter rule
  214. KCONFIG:=$(KCONFIG_IPT_LED)
  215. FILES:=$(foreach mod,$(IPT_LED-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
  216. AUTOLOAD:=$(call AutoLoad,61,$(notdir $(IPT_LED-m)))
  217. $(call AddDepends/ipt)
  218. endef
  219. define KernelPackage/ipt-led/description
  220. Netfilter target to trigger a LED when a network packet is matched.
  221. endef
  222. $(eval $(call KernelPackage,ipt-led))
  223. define KernelPackage/ipt-tproxy
  224. TITLE:=Transparent proxying support
  225. KCONFIG:= \
  226. CONFIG_NETFILTER_TPROXY \
  227. CONFIG_NETFILTER_XT_MATCH_SOCKET \
  228. CONFIG_NETFILTER_XT_TARGET_TPROXY
  229. FILES:= \
  230. $(LINUX_DIR)/net/netfilter/nf_tproxy_core.ko \
  231. $(foreach mod,$(IPT_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko)
  232. AUTOLOAD:=$(call AutoLoad,45,$(notdir nf_tproxy_core $(IPT_TPROXY-m)))
  233. $(call AddDepends/ipt)
  234. endef
  235. define KernelPackage/ipt-tproxy/description
  236. Kernel modules for Transparent Proxying
  237. endef
  238. $(eval $(call KernelPackage,ipt-tproxy))
  239. define KernelPackage/ipt-iprange
  240. TITLE:=Module for matching ip ranges
  241. KCONFIG:=$(KCONFIG_IPT_IPRANGE)
  242. FILES:=$(foreach mod,$(IPT_IPRANGE-m),$(LINUX_DIR)/net/$(mod).ko)
  243. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPRANGE-m)))
  244. $(call AddDepends/ipt)
  245. endef
  246. define KernelPackage/ipt-iprange/description
  247. Netfilter (IPv4) module for matching ip ranges
  248. Includes:
  249. - iprange
  250. endef
  251. $(eval $(call KernelPackage,ipt-iprange))
  252. define KernelPackage/ipt-extra
  253. TITLE:=Extra modules
  254. KCONFIG:=$(KCONFIG_IPT_EXTRA)
  255. FILES:=$(foreach mod,$(IPT_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
  256. AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_EXTRA-m)))
  257. $(call AddDepends/ipt)
  258. endef
  259. define KernelPackage/ipt-extra/description
  260. Other Netfilter (IPv4) kernel modules
  261. Includes:
  262. - condition (2.4 only)
  263. - owner
  264. - physdev (if bridge support was enabled in kernel)
  265. - pkttype
  266. - quota
  267. endef
  268. $(eval $(call KernelPackage,ipt-extra))
  269. define KernelPackage/ip6tables
  270. SUBMENU:=$(NF_MENU)
  271. TITLE:=IPv6 modules
  272. DEPENDS:=+kmod-ipv6
  273. KCONFIG:=$(KCONFIG_IPT_IPV6)
  274. FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).ko)
  275. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPT_IPV6-m)))
  276. endef
  277. define KernelPackage/ip6tables/description
  278. Netfilter IPv6 firewalling support
  279. endef
  280. $(eval $(call KernelPackage,ip6tables))
  281. define KernelPackage/arptables
  282. SUBMENU:=$(NF_MENU)
  283. TITLE:=ARP firewalling modules
  284. FILES:=$(LINUX_DIR)/net/ipv4/netfilter/arp*.ko
  285. KCONFIG:=CONFIG_IP_NF_ARPTABLES \
  286. CONFIG_IP_NF_ARPFILTER \
  287. CONFIG_IP_NF_ARP_MANGLE
  288. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(patsubst %.ko,%,$(wildcard $(LINUX_DIR)/net/ipv4/netfilter/arp*.ko))))
  289. endef
  290. define KernelPackage/arptables/description
  291. Kernel modules for ARP firewalling
  292. endef
  293. $(eval $(call KernelPackage,arptables))
  294. define KernelPackage/ebtables
  295. SUBMENU:=$(NF_MENU)
  296. TITLE:=Bridge firewalling modules
  297. FILES:=$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).ko)
  298. KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
  299. $(KCONFIG_EBTABLES)
  300. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES-m)))
  301. endef
  302. define KernelPackage/ebtables/description
  303. ebtables is a general, extensible frame/packet identification
  304. framework. It provides you to do Ethernet
  305. filtering/NAT/brouting on the Ethernet bridge.
  306. endef
  307. $(eval $(call KernelPackage,ebtables))
  308. define AddDepends/ebtables
  309. SUBMENU:=$(NF_MENU)
  310. DEPENDS+=kmod-ebtables $(1)
  311. endef
  312. define KernelPackage/ebtables-ipv4
  313. TITLE:=ebtables: IPv4 support
  314. FILES:=$(foreach mod,$(EBTABLES_IP4-m),$(LINUX_DIR)/net/$(mod).ko)
  315. KCONFIG:=$(KCONFIG_EBTABLES_IP4)
  316. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP4-m)))
  317. $(call AddDepends/ebtables)
  318. endef
  319. define KernelPackage/ebtables-ipv4/description
  320. This option adds the IPv4 support to ebtables, which allows basic
  321. IPv4 header field filtering, ARP filtering as well as SNAT, DNAT targets.
  322. endef
  323. $(eval $(call KernelPackage,ebtables-ipv4))
  324. define KernelPackage/ebtables-ipv6
  325. TITLE:=ebtables: IPv6 support
  326. FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).ko)
  327. KCONFIG:=$(KCONFIG_EBTABLES_IP6)
  328. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP6-m)))
  329. $(call AddDepends/ebtables)
  330. endef
  331. define KernelPackage/ebtables-ipv6/description
  332. This option adds the IPv6 support to ebtables, which allows basic
  333. IPv6 header field filtering and target support.
  334. endef
  335. $(eval $(call KernelPackage,ebtables-ipv6))
  336. define KernelPackage/ebtables-watchers
  337. TITLE:=ebtables: watchers support
  338. FILES:=$(foreach mod,$(EBTABLES_WATCHERS-m),$(LINUX_DIR)/net/$(mod).ko)
  339. KCONFIG:=$(KCONFIG_EBTABLES_WATCHERS)
  340. AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_WATCHERS-m)))
  341. $(call AddDepends/ebtables)
  342. endef
  343. define KernelPackage/ebtables-watchers/description
  344. This option adds the log watchers, that you can use in any rule
  345. in any ebtables table.
  346. endef
  347. $(eval $(call KernelPackage,ebtables-watchers))
  348. define KernelPackage/nfnetlink
  349. SUBMENU:=$(NF_MENU)
  350. TITLE:=Netlink-based userspace interface
  351. DEPENDS:=+kmod-ipt-core
  352. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink.ko
  353. KCONFIG:=CONFIG_NETFILTER_NETLINK
  354. AUTOLOAD:=$(call AutoLoad,48,nfnetlink)
  355. endef
  356. define KernelPackage/nfnetlink/description
  357. Kernel modules support for a netlink-based userspace interface
  358. endef
  359. $(eval $(call KernelPackage,nfnetlink))
  360. define AddDepends/nfnetlink
  361. SUBMENU:=$(NF_MENU)
  362. DEPENDS+=+kmod-nfnetlink $(1)
  363. endef
  364. define KernelPackage/nfnetlink-log
  365. TITLE:=Netfilter LOG over NFNETLINK interface
  366. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_log.ko
  367. KCONFIG:=CONFIG_NETFILTER_NETLINK_LOG
  368. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_log)
  369. $(call AddDepends/nfnetlink)
  370. endef
  371. define KernelPackage/nfnetlink-log/description
  372. Kernel modules support for logging packets via NFNETLINK
  373. endef
  374. $(eval $(call KernelPackage,nfnetlink-log))
  375. define KernelPackage/nfnetlink-queue
  376. TITLE:=Netfilter QUEUE over NFNETLINK interface
  377. FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_queue.ko
  378. KCONFIG:=CONFIG_NETFILTER_NETLINK_QUEUE
  379. AUTOLOAD:=$(call AutoLoad,48,nfnetlink_queue)
  380. $(call AddDepends/nfnetlink)
  381. endef
  382. define KernelPackage/nfnetlink-queue/description
  383. Kernel modules support for queueing packets via NFNETLINK
  384. endef
  385. $(eval $(call KernelPackage,nfnetlink-queue))
  386. define KernelPackage/nf-conntrack-netlink
  387. TITLE:=Connection tracking netlink interface
  388. FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.ko
  389. KCONFIG:=CONFIG_NF_CT_NETLINK
  390. AUTOLOAD:=$(call AutoLoad,49,nf_conntrack_netlink)
  391. $(call AddDepends/nfnetlink,+kmod-ipt-conntrack)
  392. endef
  393. define KernelPackage/nf-conntrack-netlink/description
  394. Kernel modules support for a netlink-based connection tracking
  395. userspace interface
  396. endef
  397. $(eval $(call KernelPackage,nf-conntrack-netlink))
  398. define KernelPackage/ipt-hashlimit
  399. SUBMENU:=$(NF_MENU)
  400. TITLE:=Netfilter hashlimit match
  401. KCONFIG:=$(KCONFIG_IPT_HASHLIMIT)
  402. FILES:=$(LINUX_DIR)/net/netfilter/xt_hashlimit.ko
  403. AUTOLOAD:=$(call AutoLoad,50,xt_hashlimit)
  404. $(call KernelPackage/ipt)
  405. endef
  406. define KernelPackage/ipt-hashlimit/description
  407. Kernel modules support for the hashlimit bucket match module
  408. endef
  409. $(eval $(call KernelPackage,ipt-hashlimit))