netfilter.mk 13 KB

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