netfilter.mk 14 KB

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