netfilter.mk 14 KB

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