netfilter.mk 14 KB

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