iipt-debug: create bundle of netfilter modules for debugging
[openwrt.git] / package / kernel / modules / netfilter.mk
1
2 #
3 # Copyright (C) 2006-2010 OpenWrt.org
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 NF_MENU:=Netfilter Extensions
10 NF_KMOD:=1
11 include $(INCLUDE_DIR)/netfilter.mk
12
13 define KernelPackage/ipt-core
14   SUBMENU:=$(NF_MENU)
15   TITLE:=Netfilter core
16   KCONFIG:= \
17         CONFIG_NETFILTER=y \
18         CONFIG_NETFILTER_ADVANCED=y \
19         $(KCONFIG_IPT_CORE)
20   FILES:=$(foreach mod,$(IPT_CORE-m),$(LINUX_DIR)/net/$(mod).ko)
21   AUTOLOAD:=$(call AutoLoad,40,$(notdir $(IPT_CORE-m)))
22 endef
23
24 define KernelPackage/ipt-core/description
25  Netfilter core kernel modules
26  Includes:
27  - comment (2.6)
28  - limit
29  - LOG
30  - mac
31  - multiport
32  - REJECT
33  - TCPMSS
34 endef
35
36 $(eval $(call KernelPackage,ipt-core))
37
38
39 define AddDepends/ipt
40   SUBMENU:=$(NF_MENU)
41   DEPENDS+= kmod-ipt-core $(1)
42 endef
43
44
45 define KernelPackage/ipt-conntrack
46   TITLE:=Basic connection tracking modules
47   KCONFIG:=$(KCONFIG_IPT_CONNTRACK)
48   FILES:=$(foreach mod,$(IPT_CONNTRACK-m),$(LINUX_DIR)/net/$(mod).ko)
49   AUTOLOAD:=$(call AutoLoad,41,$(notdir $(IPT_CONNTRACK-m)))
50   $(call AddDepends/ipt)
51 endef
52
53 define KernelPackage/ipt-conntrack/description
54  Netfilter (IPv4) kernel modules for connection tracking
55  Includes:
56  - conntrack
57  - defrag (2.6)
58  - iptables_raw
59  - NOTRACK
60  - state
61 endef
62
63 $(eval $(call KernelPackage,ipt-conntrack))
64
65
66 define KernelPackage/ipt-conntrack-extra
67   TITLE:=Extra connection tracking modules
68   KCONFIG:=$(KCONFIG_IPT_CONNTRACK_EXTRA)
69   FILES:=$(foreach mod,$(IPT_CONNTRACK_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
70   AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_CONNTRACK_EXTRA-m)))
71   $(call AddDepends/ipt,+kmod-ipt-conntrack)
72 endef
73
74 define KernelPackage/ipt-conntrack-extra/description
75  Netfilter (IPv4) extra kernel modules for connection tracking
76  Includes:
77  - connbytes
78  - connmark/CONNMARK
79  - conntrack
80  - helper
81  - recent
82 endef
83
84 $(eval $(call KernelPackage,ipt-conntrack-extra))
85
86
87 define KernelPackage/ipt-filter
88   TITLE:=Modules for packet content inspection
89   KCONFIG:=$(KCONFIG_IPT_FILTER)
90   FILES:=$(foreach mod,$(IPT_FILTER-m),$(LINUX_DIR)/net/$(mod).ko)
91   AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_FILTER-m)))
92   $(call AddDepends/ipt,+kmod-textsearch)
93 endef
94
95 define KernelPackage/ipt-filter/description
96  Netfilter (IPv4) kernel modules for packet content inspection
97  Includes:
98  - layer7
99  - string
100 endef
101
102 $(eval $(call KernelPackage,ipt-filter))
103
104
105 define KernelPackage/ipt-ipopt
106   TITLE:=Modules for matching/changing IP packet options
107   KCONFIG:=$(KCONFIG_IPT_IPOPT)
108   FILES:=$(foreach mod,$(IPT_IPOPT-m),$(LINUX_DIR)/net/$(mod).ko)
109   AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPOPT-m)))
110   $(call AddDepends/ipt)
111 endef
112
113 define KernelPackage/ipt-ipopt/description
114  Netfilter (IPv4) modules for matching/changing IP packet options
115  Includes:
116  - CLASSIFY
117  - dscp/DSCP
118  - ecn/ECN
119  - hl/HL (2.6.30 and later)
120  - length
121  - mark/MARK
122  - statistic (2.6)
123  - tcpmss
124  - time
125  - tos/TOS (prior to 2.6.25)
126  - ttl/TTL (prior to 2.6.30)
127  - unclean
128 endef
129
130 $(eval $(call KernelPackage,ipt-ipopt))
131
132
133 define KernelPackage/ipt-ipsec
134   TITLE:=Modules for matching IPSec packets
135   KCONFIG:=$(KCONFIG_IPT_IPSEC)
136   FILES:=$(foreach mod,$(IPT_IPSEC-m),$(LINUX_DIR)/net/$(mod).ko)
137   AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPSEC-m)))
138   $(call AddDepends/ipt)
139 endef
140
141 define KernelPackage/ipt-ipsec/description
142  Netfilter (IPv4) modules for matching IPSec packets
143  Includes:
144  - ah
145  - esp
146  - policy (2.6)
147 endef
148
149 $(eval $(call KernelPackage,ipt-ipsec))
150
151
152 define KernelPackage/ipt-nat
153   TITLE:=Basic NAT targets
154   KCONFIG:=$(KCONFIG_IPT_NAT)
155   FILES:=$(foreach mod,$(IPT_NAT-m),$(LINUX_DIR)/net/$(mod).ko)
156   AUTOLOAD:=$(call AutoLoad,42,$(notdir $(IPT_NAT-m)))
157   $(call AddDepends/ipt,+kmod-ipt-conntrack)
158 endef
159
160 define KernelPackage/ipt-nat/description
161  Netfilter (IPv4) kernel modules for basic NAT targets
162  Includes:
163  - MASQUERADE
164 endef
165
166 $(eval $(call KernelPackage,ipt-nat))
167
168
169 define KernelPackage/ipt-nat-extra
170   TITLE:=Extra NAT targets
171   KCONFIG:=$(KCONFIG_IPT_NAT_EXTRA)
172   FILES:=$(foreach mod,$(IPT_NAT_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
173   AUTOLOAD:=$(call AutoLoad,43,$(notdir $(IPT_NAT_EXTRA-m)))
174   $(call AddDepends/ipt,+kmod-ipt-nat)
175 endef
176
177 define KernelPackage/ipt-nat-extra/description
178  Netfilter (IPv4) kernel modules for extra NAT targets
179  Includes:
180  - MIRROR (2.4)
181  - NETMAP
182  - REDIRECT
183 endef
184
185 $(eval $(call KernelPackage,ipt-nat-extra))
186
187
188 define KernelPackage/ipt-nathelper
189   TITLE:=Basic Conntrack and NAT helpers
190   KCONFIG:=$(KCONFIG_IPT_NATHELPER)
191   FILES:=$(foreach mod,$(IPT_NATHELPER-m),$(LINUX_DIR)/net/$(mod).ko)
192   AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER-m)))
193   $(call AddDepends/ipt,+kmod-ipt-nat)
194 endef
195
196 define KernelPackage/ipt-nathelper/description
197  Default Netfilter (IPv4) Conntrack and NAT helpers
198  Includes:
199  - ftp
200  - irc
201  - tftp
202 endef
203
204 $(eval $(call KernelPackage,ipt-nathelper))
205
206
207 define KernelPackage/ipt-nathelper-extra
208   TITLE:=Extra Conntrack and NAT helpers
209   KCONFIG:=$(KCONFIG_IPT_NATHELPER_EXTRA)
210   FILES:=$(foreach mod,$(IPT_NATHELPER_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
211   AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_NATHELPER_EXTRA-m)))
212   $(call AddDepends/ipt,+kmod-ipt-nat +kmod-textsearch)
213 endef
214
215 define KernelPackage/ipt-nathelper-extra/description
216  Extra Netfilter (IPv4) Conntrack and NAT helpers
217  Includes:
218  - amanda
219  - h323
220  - mms
221  - pptp (2.6)
222  - proto_gre (2.6)
223  - rtsp
224  - sip (2.6)
225  - snmp_basic
226 endef
227
228 $(eval $(call KernelPackage,ipt-nathelper-extra))
229
230
231 define KernelPackage/ipt-queue
232   TITLE:=Module for user-space packet queueing
233   KCONFIG:=$(KCONFIG_IPT_QUEUE)
234   FILES:=$(foreach mod,$(IPT_QUEUE-m),$(LINUX_DIR)/net/$(mod).ko)
235   AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_QUEUE-m)))
236   $(call AddDepends/ipt)
237 endef
238
239 define KernelPackage/ipt-queue/description
240  Netfilter (IPv4) module for user-space packet queueing
241  Includes:
242  - QUEUE
243 endef
244
245 $(eval $(call KernelPackage,ipt-queue))
246
247
248 define KernelPackage/ipt-ulog
249   TITLE:=Module for user-space packet logging
250   KCONFIG:=$(KCONFIG_IPT_ULOG)
251   FILES:=$(foreach mod,$(IPT_ULOG-m),$(LINUX_DIR)/net/$(mod).ko)
252   AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_ULOG-m)))
253   $(call AddDepends/ipt)
254 endef
255
256 define KernelPackage/ipt-ulog/description
257  Netfilter (IPv4) module for user-space packet logging
258  Includes:
259  - ULOG
260 endef
261
262 $(eval $(call KernelPackage,ipt-ulog))
263
264
265 define KernelPackage/ipt-debug
266   TITLE:=Module for debugging/development
267   KCONFIG:=$(KCONFIG_IPT_DEBUG)
268   DEFAULT:=n
269   FILES:=$(foreach mod,$(IPT_DEBUG-m),$(LINUX_DIR)/net/$(mod).ko)
270   AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_DEBUG-m)))
271   $(call AddDepends/ipt)
272 endef
273
274 define KernelPackage/ipt-debug/description
275  Netfilter modules for debugging/development of the firewall
276  Includes:
277  - TRACE
278 endef
279
280 $(eval $(call KernelPackage,ipt-debug))
281
282
283 define KernelPackage/ipt-led
284   TITLE:=Module to trigger a LED with a Netfilter rule
285   KCONFIG:=$(KCONFIG_IPT_LED)
286   FILES:=$(foreach mod,$(IPT_LED-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
287   AUTOLOAD:=$(call AutoLoad,61,$(notdir $(IPT_LED-m)))
288   $(call AddDepends/ipt)
289 endef
290
291 define KernelPackage/ipt-led/description
292  Netfilter target to trigger a LED when a network packet is matched.
293 endef
294
295 $(eval $(call KernelPackage,ipt-led))
296
297 define KernelPackage/ipt-tproxy
298   TITLE:=Transparent proxying support
299   KCONFIG:= \
300         CONFIG_NETFILTER_TPROXY \
301         CONFIG_NETFILTER_XT_MATCH_SOCKET \
302         CONFIG_NETFILTER_XT_TARGET_TPROXY
303   FILES:= \
304         $(LINUX_DIR)/net/netfilter/nf_tproxy_core.ko \
305         $(foreach mod,$(IPT_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko)
306   AUTOLOAD:=$(call AutoLoad,45,$(notdir nf_tproxy_core $(IPT_TPROXY-m)))
307   $(call AddDepends/ipt)
308 endef
309
310 define KernelPackage/ipt-tproxy/description
311   Kernel modules for Transparent Proxying
312 endef
313
314 $(eval $(call KernelPackage,ipt-tproxy))
315
316
317 define KernelPackage/ipt-iprange
318   TITLE:=Module for matching ip ranges
319   KCONFIG:=$(KCONFIG_IPT_IPRANGE)
320   FILES:=$(foreach mod,$(IPT_IPRANGE-m),$(LINUX_DIR)/net/$(mod).ko)
321   AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_IPRANGE-m)))
322   $(call AddDepends/ipt)
323 endef
324
325 define KernelPackage/ipt-iprange/description
326  Netfilter (IPv4) module for matching ip ranges
327  Includes:
328  - iprange
329 endef
330
331 $(eval $(call KernelPackage,ipt-iprange))
332
333
334 define KernelPackage/ipt-extra
335   TITLE:=Extra modules
336   KCONFIG:=$(KCONFIG_IPT_EXTRA)
337   FILES:=$(foreach mod,$(IPT_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
338   AUTOLOAD:=$(call AutoLoad,45,$(notdir $(IPT_EXTRA-m)))
339   $(call AddDepends/ipt)
340 endef
341
342 define KernelPackage/ipt-extra/description
343  Other Netfilter (IPv4) kernel modules
344  Includes:
345  - condition (2.4 only)
346  - owner
347  - physdev (if bridge support was enabled in kernel)
348  - pkttype
349  - quota
350 endef
351
352 $(eval $(call KernelPackage,ipt-extra))
353
354
355 define KernelPackage/ip6tables
356   SUBMENU:=$(NF_MENU)
357   TITLE:=IPv6 modules
358   DEPENDS:=+kmod-ipv6
359   KCONFIG:=$(KCONFIG_IPT_IPV6)
360   FILES:=$(foreach mod,$(IPT_IPV6-m),$(LINUX_DIR)/net/$(mod).ko)
361   AUTOLOAD:=$(call AutoLoad,49,$(notdir $(IPT_IPV6-m)))
362 endef
363
364 define KernelPackage/ip6tables/description
365  Netfilter IPv6 firewalling support
366 endef
367
368 $(eval $(call KernelPackage,ip6tables))
369
370
371 define KernelPackage/arptables
372   SUBMENU:=$(NF_MENU)
373   TITLE:=ARP firewalling modules
374   FILES:=$(LINUX_DIR)/net/ipv4/netfilter/arp*.ko
375   KCONFIG:=CONFIG_IP_NF_ARPTABLES \
376     CONFIG_IP_NF_ARPFILTER \
377     CONFIG_IP_NF_ARP_MANGLE
378   AUTOLOAD:=$(call AutoLoad,49,$(notdir $(patsubst %.ko,%,$(wildcard $(LINUX_DIR)/net/ipv4/netfilter/arp*.ko))))
379 endef
380
381 define KernelPackage/arptables/description
382  Kernel modules for ARP firewalling
383 endef
384
385 $(eval $(call KernelPackage,arptables))
386
387
388 define KernelPackage/ebtables
389   SUBMENU:=$(NF_MENU)
390   TITLE:=Bridge firewalling modules
391   FILES:=$(foreach mod,$(EBTABLES-m),$(LINUX_DIR)/net/$(mod).ko)
392   KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
393         $(KCONFIG_EBTABLES)
394   AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES-m)))
395 endef
396
397 define KernelPackage/ebtables/description
398   ebtables is a general, extensible frame/packet identification
399   framework. It provides you to do Ethernet
400   filtering/NAT/brouting on the Ethernet bridge.
401 endef
402
403 $(eval $(call KernelPackage,ebtables))
404
405
406 define AddDepends/ebtables
407   SUBMENU:=$(NF_MENU)
408   DEPENDS+=kmod-ebtables $(1)
409 endef
410
411
412 define KernelPackage/ebtables-ipv4
413   TITLE:=ebtables: IPv4 support
414   FILES:=$(foreach mod,$(EBTABLES_IP4-m),$(LINUX_DIR)/net/$(mod).ko)
415   KCONFIG:=$(KCONFIG_EBTABLES_IP4)
416   AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP4-m)))
417   $(call AddDepends/ebtables)
418 endef
419
420 define KernelPackage/ebtables-ipv4/description
421  This option adds the IPv4 support to ebtables, which allows basic
422  IPv4 header field filtering, ARP filtering as well as SNAT, DNAT targets.
423 endef
424
425 $(eval $(call KernelPackage,ebtables-ipv4))
426
427
428 define KernelPackage/ebtables-ipv6
429   TITLE:=ebtables: IPv6 support
430   FILES:=$(foreach mod,$(EBTABLES_IP6-m),$(LINUX_DIR)/net/$(mod).ko)
431   KCONFIG:=$(KCONFIG_EBTABLES_IP6)
432   AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_IP6-m)))
433   $(call AddDepends/ebtables)
434 endef
435
436 define KernelPackage/ebtables-ipv6/description
437  This option adds the IPv6 support to ebtables, which allows basic
438  IPv6 header field filtering and target support.
439 endef
440
441 $(eval $(call KernelPackage,ebtables-ipv6))
442
443
444 define KernelPackage/ebtables-watchers
445   TITLE:=ebtables: watchers support
446   FILES:=$(foreach mod,$(EBTABLES_WATCHERS-m),$(LINUX_DIR)/net/$(mod).ko)
447   KCONFIG:=$(KCONFIG_EBTABLES_WATCHERS)
448   AUTOLOAD:=$(call AutoLoad,49,$(notdir $(EBTABLES_WATCHERS-m)))
449   $(call AddDepends/ebtables)
450 endef
451
452 define KernelPackage/ebtables-watchers/description
453  This option adds the log watchers, that you can use in any rule
454  in any ebtables table.
455 endef
456
457 $(eval $(call KernelPackage,ebtables-watchers))
458
459
460 define KernelPackage/nfnetlink
461   SUBMENU:=$(NF_MENU)
462   TITLE:=Netlink-based userspace interface
463   DEPENDS:=+kmod-ipt-core
464   FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink.ko
465   KCONFIG:=CONFIG_NETFILTER_NETLINK
466   AUTOLOAD:=$(call AutoLoad,48,nfnetlink)
467 endef
468
469 define KernelPackage/nfnetlink/description
470  Kernel modules support for a netlink-based userspace interface
471 endef
472
473 $(eval $(call KernelPackage,nfnetlink))
474
475
476 define AddDepends/nfnetlink
477   SUBMENU:=$(NF_MENU)
478   DEPENDS+=+kmod-nfnetlink $(1)
479 endef
480
481
482 define KernelPackage/nfnetlink-log
483   TITLE:=Netfilter LOG over NFNETLINK interface
484   FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_log.ko
485   KCONFIG:=CONFIG_NETFILTER_NETLINK_LOG
486   AUTOLOAD:=$(call AutoLoad,48,nfnetlink_log)
487   $(call AddDepends/nfnetlink)
488 endef
489
490 define KernelPackage/nfnetlink-log/description
491  Kernel modules support for logging packets via NFNETLINK
492 endef
493
494 $(eval $(call KernelPackage,nfnetlink-log))
495
496
497 define KernelPackage/nfnetlink-queue
498   TITLE:=Netfilter QUEUE over NFNETLINK interface
499   FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_queue.ko
500   KCONFIG:=CONFIG_NETFILTER_NETLINK_QUEUE
501   AUTOLOAD:=$(call AutoLoad,48,nfnetlink_queue)
502   $(call AddDepends/nfnetlink)
503 endef
504
505 define KernelPackage/nfnetlink-queue/description
506  Kernel modules support for queueing packets via NFNETLINK
507 endef
508
509 $(eval $(call KernelPackage,nfnetlink-queue))
510
511
512 define KernelPackage/nf-conntrack-netlink
513   TITLE:=Connection tracking netlink interface
514   FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.ko
515   KCONFIG:=CONFIG_NF_CT_NETLINK
516   AUTOLOAD:=$(call AutoLoad,49,nf_conntrack_netlink)
517   $(call AddDepends/nfnetlink,+kmod-ipt-conntrack)
518 endef
519
520 define KernelPackage/nf-conntrack-netlink/description
521  Kernel modules support for a netlink-based connection tracking 
522  userspace interface
523 endef
524
525 $(eval $(call KernelPackage,nf-conntrack-netlink))
526
527 define KernelPackage/ipt-hashlimit
528   SUBMENU:=$(NF_MENU)
529   TITLE:=Netfilter hashlimit match
530   KCONFIG:=$(KCONFIG_IPT_HASHLIMIT)
531   FILES:=$(LINUX_DIR)/net/netfilter/xt_hashlimit.ko
532   AUTOLOAD:=$(call AutoLoad,50,xt_hashlimit)
533   $(call KernelPackage/ipt)
534 endef
535
536 define KernelPackage/ipt-hashlimit/description
537  Kernel modules support for the hashlimit bucket match module
538 endef
539
540 $(eval $(call KernelPackage,ipt-hashlimit))