2 # Copyright (C) 2006-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/kernel.mk
15 PKG_MD5SUM
:=f382fe693f0b59d87bd47bea65eca198
16 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
17 PKG_SOURCE_URL
:=http
://www.netfilter.org
/projects
/iptables
/files \
18 ftp
://ftp.be.netfilter.org
/pub
/netfilter
/iptables
/ \
19 ftp
://ftp.de.netfilter.org
/pub
/netfilter
/iptables
/ \
20 ftp
://ftp.no.netfilter.org
/pub
/netfilter
/iptables
/
26 ifneq ($(CONFIG_EXTERNAL_KERNEL_TREE
),"")
30 include $(INCLUDE_DIR
)/package.mk
32 -include $(LINUX_DIR
)/.config
33 include $(INCLUDE_DIR
)/netfilter.mk
34 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell $(SH_FUNC
) grep
'NETFILTER' $(LINUX_DIR
)/.config | md5s
)
38 define Package
/iptables
/Default
42 URL
:=http
://netfilter.org
/
45 define Package
/iptables
/Module
46 $(call Package
/iptables
/Default
)
47 DEPENDS
:=iptables
$(1)
50 define Package
/iptables
51 $(call Package
/iptables
/Default
)
52 TITLE
:=IPv4 firewall administration tool
54 DEPENDS
+= +kmod-ipt-core
+libip4tc
+libxtables
57 define Package
/iptables
/description
58 IPv4 firewall administration tool.
82 define Package
/iptables-mod-conntrack
83 $(call Package
/iptables
/Module
, +kmod-ipt-conntrack
)
84 TITLE
:=Basic connection tracking extensions
87 define Package
/iptables-mod-conntrack
/description
88 Basic iptables extensions for connection tracking.
102 define Package
/iptables-mod-conntrack-extra
103 $(call Package
/iptables
/Module
, +kmod-ipt-conntrack-extra
)
104 TITLE
:=Extra connection tracking extensions
107 define Package
/iptables-mod-conntrack-extra
/description
108 Extra iptables extensions for connection tracking.
121 define Package
/iptables-mod-filter
122 $(call Package
/iptables
/Module
, +kmod-ipt-filter
)
123 TITLE
:=Content inspection extensions
126 define Package
/iptables-mod-filter
/description
127 iptables extensions for packet content inspection.
128 Includes support for
:
136 define Package
/iptables-mod-ipopt
137 $(call Package
/iptables
/Module
, +kmod-ipt-ipopt
)
138 TITLE
:=IP
/Packet option extensions
141 define Package
/iptables-mod-ipopt
/description
142 iptables extensions for matching
/changing IP packet options.
164 define Package
/iptables-mod-ipsec
165 $(call Package
/iptables
/Module
, +kmod-ipt-ipsec
)
166 TITLE
:=IPsec extensions
169 define Package
/iptables-mod-ipsec
/description
170 iptables extensions for matching ipsec traffic.
179 define Package
/iptables-mod-ipset
180 $(call Package
/iptables
/Module
,)
181 TITLE
:=IPset iptables extensions
184 define Package
/iptables-mod-ipset
/description
185 IPset iptables extensions.
195 define Package
/iptables-mod-nat
196 $(call Package
/iptables
/Module
, +kmod-ipt-nat
)
197 TITLE
:=Basic NAT extensions
200 define Package
/iptables-mod-nat
/description
201 iptables extensions for basic NAT targets.
213 define Package
/iptables-mod-nat-extra
214 $(call Package
/iptables
/Module
, +kmod-ipt-nat-extra
)
215 TITLE
:=Extra NAT extensions
218 define Package
/iptables-mod-nat-extra
/description
219 iptables extensions for extra NAT targets.
227 define Package
/iptables-mod-ulog
228 $(call Package
/iptables
/Module
, +kmod-ipt-ulog
)
229 TITLE
:=user-space packet logging
232 define Package
/iptables-mod-ulog
/description
233 iptables extensions for user-space packet logging.
240 define Package
/iptables-mod-hashlimit
241 $(call Package
/iptables
/Module
, +kmod-ipt-hashlimit
)
242 TITLE
:=hashlimit matching
245 define Package
/iptables-mod-hashlimit
/description
246 iptables extensions for hashlimit matching
253 define Package
/iptables-mod-iprange
254 $(call Package
/iptables
/Module
, +kmod-ipt-iprange
)
255 TITLE
:=IP range extension
258 define Package
/iptables-mod-iprange
/description
259 iptables extensions for matching ip ranges.
266 define Package
/iptables-mod-extra
267 $(call Package
/iptables
/Module
, +kmod-ipt-extra
)
268 TITLE
:=Other extra iptables extensions
271 define Package
/iptables-mod-extra
/description
272 Other extra iptables extensions.
277 - physdev
(if ebtables is enabled
)
283 define Package
/iptables-mod-led
284 $(call Package
/iptables
/Module
, +kmod-ipt-led
)
285 TITLE
:=LED trigger iptables extension
288 define Package
/iptables-mod-led
/description
289 iptables extension for triggering a LED.
296 define Package
/iptables-mod-tproxy
297 $(call Package
/iptables
/Module
, +kmod-ipt-tproxy
)
298 TITLE
:=Transparent proxy iptables extensions
301 define Package
/iptables-mod-tproxy
/description
302 Transparent proxy iptables extensions.
312 define Package
/iptables-mod-tee
313 $(call Package
/iptables
/Module
, +kmod-ipt-tee
)
314 TITLE
:=TEE iptables extensions
317 define Package
/iptables-mod-tee
/description
318 TEE iptables extensions.
325 define Package
/iptables-mod-u32
326 $(call Package
/iptables
/Module
, +kmod-ipt-u32
)
327 TITLE
:=U32 iptables extensions
330 define Package
/iptables-mod-u32
/description
331 U32 iptables extensions.
338 define Package
/ip6tables
339 $(call Package
/iptables
/Default
)
340 DEPENDS
:=+kmod-ip6tables
+libip6tc
+libxtables
342 TITLE
:=IPv6 firewall administration tool
346 define Package
/libiptc
347 $(call Package
/iptables
/Default
)
350 DEPENDS
:=+libip4tc
+libip6tc
351 TITLE
:=IPv4
/IPv6 firewall
- shared libiptc library
(compatibility stub
)
354 define Package
/libip4tc
355 $(call Package
/iptables
/Default
)
358 TITLE
:=IPv4 firewall
- shared libiptc library
361 define Package
/libip6tc
362 $(call Package
/iptables
/Default
)
365 TITLE
:=IPv6 firewall
- shared libiptc library
368 define Package
/libxtables
369 $(call Package
/iptables
/Default
)
372 TITLE
:=IPv4
/IPv6 firewall
- shared xtables library
375 define Package
/libipq
376 $(call Package
/iptables
/Default
)
379 TITLE
:=IPv4
/IPv6 firewall
- shared libipq library
383 -I
$(PKG_BUILD_DIR
)/include \
384 -I
$(LINUX_DIR
)/arch
/$(LINUX_KARCH
)/include \
388 -I
$(PKG_BUILD_DIR
)/include \
389 -I
$(LINUX_DIR
)/arch
/$(LINUX_KARCH
)/include
394 $(if
$(CONFIG_IPV6
),--enable-ipv6
,--disable-ipv6
) \
396 --with-kernel
="$(LINUX_DIR)" \
397 --with-xtlibdir
=/usr
/lib
/iptables
400 $(TARGET_CONFIGURE_OPTS
) \
401 COPT_FLAGS
="$(TARGET_CFLAGS)" \
402 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
403 KBUILD_OUTPUT
="$(LINUX_DIR)" \
405 define Build
/InstallDev
406 $(INSTALL_DIR
) $(1)/usr
/include
407 $(INSTALL_DIR
) $(1)/usr
/include/iptables
408 $(INSTALL_DIR
) $(1)/usr
/include/net
/netfilter
410 # XXX: iptables header fixup, some headers are not installed by iptables anymore
411 $(CP
) $(PKG_BUILD_DIR
)/include/net
/netfilter
/*.h
$(1)/usr
/include/net
/netfilter
/
412 $(CP
) $(PKG_BUILD_DIR
)/include/iptables
/*.h
$(1)/usr
/include/iptables
/
413 $(CP
) $(PKG_BUILD_DIR
)/include/iptables.h
$(1)/usr
/include/
414 $(CP
) $(PKG_BUILD_DIR
)/include/libipq
/libipq.h
$(1)/usr
/include/
415 $(CP
) $(PKG_BUILD_DIR
)/include/libipulog
$(1)/usr
/include/
416 $(CP
) $(PKG_BUILD_DIR
)/include/libiptc
$(1)/usr
/include/
418 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/* $(1)/usr
/include/
419 $(INSTALL_DIR
) $(1)/usr
/lib
420 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libxtables.so
* $(1)/usr
/lib
/
421 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libip
*tc.so
* $(1)/usr
/lib
/
422 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libipq.so
* $(1)/usr
/lib
/
423 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
424 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/xtables.
pc $(1)/usr
/lib
/pkgconfig
/
425 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libiptc.
pc $(1)/usr
/lib
/pkgconfig
/
428 define Package
/iptables
/install
429 $(INSTALL_DIR
) $(1)/usr
/sbin
430 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables
$(1)/usr
/sbin
/
431 $(LN
) iptables
$(1)/usr
/sbin
/iptables-save
432 $(LN
) iptables
$(1)/usr
/sbin
/iptables-restore
433 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
434 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
435 for m in
$(patsubst xt_
%,ipt_
%,$(IPT_BUILTIN
)) $(patsubst ipt_
%,xt_
%,$(IPT_BUILTIN
)); do \
436 if
[ -f
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$${m}.so
]; then \
437 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$${m}.so
$(1)/usr
/lib
/iptables
/ ;\
443 define Package
/ip6tables
/install
444 $(INSTALL_DIR
) $(1)/usr
/sbin
445 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables
$(1)/usr
/sbin
/
446 $(LN
) ip6tables
$(1)/usr
/sbin
/ip6tables-save
447 $(LN
) ip6tables
$(1)/usr
/sbin
/ip6tables-restore
448 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
449 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
450 $(CP
) libip6t_
*.so
$(1)/usr
/lib
/iptables
/ \
454 define Package
/libiptc
/install
455 $(INSTALL_DIR
) $(1)/usr
/lib
456 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libiptc.so
* $(1)/usr
/lib
/
459 define Package
/libip4tc
/install
460 $(INSTALL_DIR
) $(1)/usr
/lib
461 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libip4tc.so
* $(1)/usr
/lib
/
464 define Package
/libip6tc
/install
465 $(INSTALL_DIR
) $(1)/usr
/lib
466 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libip6tc.so
* $(1)/usr
/lib
/
469 define Package
/libxtables
/install
470 $(INSTALL_DIR
) $(1)/usr
/lib
471 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libxtables.so
* $(1)/usr
/lib
/
474 define Package
/libipq
/install
475 $(INSTALL_DIR
) $(1)/usr
/lib
476 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libipq.so
* $(1)/usr
/lib
/
480 define Package
/$(1)/install
481 $(INSTALL_DIR
) $$(1)/usr
/lib
/iptables
482 for m in
$(patsubst xt_
%,ipt_
%,$(2)) $(patsubst ipt_
%,xt_
%,$(2)); do \
483 if
[ -f
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
]; then \
484 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
$$(1)/usr
/lib
/iptables
/ ; \
490 $$(eval
$$(call BuildPackage
,$(1)))
494 $(INSTALL_DIR
) $$(1)/etc
/l7-protocols
; \
495 $(CP
) files
/l7
/*.pat
$$(1)/etc
/l7-protocols
/
498 $(eval
$(call BuildPackage
,iptables
))
499 $(eval
$(call BuildPlugin
,iptables-mod-conntrack
,$(IPT_CONNTRACK-m
)))
500 $(eval
$(call BuildPlugin
,iptables-mod-conntrack-extra
,$(IPT_CONNTRACK_EXTRA-m
)))
501 $(eval
$(call BuildPlugin
,iptables-mod-extra
,$(IPT_EXTRA-m
)))
502 $(eval
$(call BuildPlugin
,iptables-mod-filter
,$(IPT_FILTER-m
),$(L7_INSTALL
)))
503 $(eval
$(call BuildPlugin
,iptables-mod-ipopt
,$(IPT_IPOPT-m
)))
504 $(eval
$(call BuildPlugin
,iptables-mod-ipsec
,$(IPT_IPSEC-m
)))
505 $(eval
$(call BuildPlugin
,iptables-mod-ipset
,ipt_set ipt_SET
))
506 $(eval
$(call BuildPlugin
,iptables-mod-nat
,$(IPT_NAT-m
)))
507 $(eval
$(call BuildPlugin
,iptables-mod-nat-extra
,$(IPT_NAT_EXTRA-m
)))
508 $(eval
$(call BuildPlugin
,iptables-mod-iprange
,$(IPT_IPRANGE-m
)))
509 $(eval
$(call BuildPlugin
,iptables-mod-ulog
,$(IPT_ULOG-m
)))
510 $(eval
$(call BuildPlugin
,iptables-mod-hashlimit
,$(IPT_HASHLIMIT-m
)))
511 $(eval
$(call BuildPlugin
,iptables-mod-led
,$(IPT_LED-m
)))
512 $(eval
$(call BuildPlugin
,iptables-mod-tproxy
,$(IPT_TPROXY-m
)))
513 $(eval
$(call BuildPlugin
,iptables-mod-tee
,$(IPT_TEE-m
)))
514 $(eval
$(call BuildPlugin
,iptables-mod-u32
,$(IPT_U32-m
)))
515 $(eval
$(call BuildPackage
,ip6tables
))
516 $(eval
$(call BuildPackage
,libiptc
))
517 $(eval
$(call BuildPackage
,libip4tc
))
518 $(eval
$(call BuildPackage
,libip6tc
))
519 $(eval
$(call BuildPackage
,libxtables
))
520 $(eval
$(call BuildPackage
,libipq
))