2 # Copyright (C) 2006-2011 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 include $(INCLUDE_DIR
)/package.mk
28 -include $(LINUX_DIR
)/.config
29 include $(INCLUDE_DIR
)/netfilter.mk
30 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell $(SH_FUNC
) grep
'NETFILTER' $(LINUX_DIR
)/.config | md5s
)
34 define Package
/iptables
/Default
38 URL
:=http
://netfilter.org
/
41 define Package
/iptables
/Module
42 $(call Package
/iptables
/Default
)
43 DEPENDS
:=iptables
$(1)
46 define Package
/iptables
47 $(call Package
/iptables
/Default
)
48 TITLE
:=IPv4 firewall administration tool
50 DEPENDS
+= +kmod-ipt-core
+libip4tc
+libxtables
53 define Package
/iptables
/description
54 IPv4 firewall administration tool.
78 define Package
/iptables-mod-conntrack
79 $(call Package
/iptables
/Module
, +kmod-ipt-conntrack
)
80 TITLE
:=Basic connection tracking extensions
83 define Package
/iptables-mod-conntrack
/description
84 Basic iptables extensions for connection tracking.
98 define Package
/iptables-mod-conntrack-extra
99 $(call Package
/iptables
/Module
, +kmod-ipt-conntrack-extra
)
100 TITLE
:=Extra connection tracking extensions
103 define Package
/iptables-mod-conntrack-extra
/description
104 Extra iptables extensions for connection tracking.
117 define Package
/iptables-mod-filter
118 $(call Package
/iptables
/Module
, +kmod-ipt-filter
)
119 TITLE
:=Content inspection extensions
122 define Package
/iptables-mod-filter
/description
123 iptables extensions for packet content inspection.
124 Includes support for
:
132 define Package
/iptables-mod-ipopt
133 $(call Package
/iptables
/Module
, +kmod-ipt-ipopt
)
134 TITLE
:=IP
/Packet option extensions
137 define Package
/iptables-mod-ipopt
/description
138 iptables extensions for matching
/changing IP packet options.
161 define Package
/iptables-mod-ipsec
162 $(call Package
/iptables
/Module
, +kmod-ipt-ipsec
)
163 TITLE
:=IPsec extensions
166 define Package
/iptables-mod-ipsec
/description
167 iptables extensions for matching ipsec traffic.
176 define Package
/iptables-mod-ipset
177 $(call Package
/iptables
/Module
,)
178 TITLE
:=IPset iptables extensions
181 define Package
/iptables-mod-ipset
/description
182 IPset iptables extensions.
192 define Package
/iptables-mod-nat
193 $(call Package
/iptables
/Module
, +kmod-ipt-nat
)
194 TITLE
:=Basic NAT extensions
197 define Package
/iptables-mod-nat
/description
198 iptables extensions for basic NAT targets.
210 define Package
/iptables-mod-nat-extra
211 $(call Package
/iptables
/Module
, +kmod-ipt-nat-extra
)
212 TITLE
:=Extra NAT extensions
215 define Package
/iptables-mod-nat-extra
/description
216 iptables extensions for extra NAT targets.
224 define Package
/iptables-mod-ulog
225 $(call Package
/iptables
/Module
, +kmod-ipt-ulog
)
226 TITLE
:=user-space packet logging
229 define Package
/iptables-mod-ulog
/description
230 iptables extensions for user-space packet logging.
237 define Package
/iptables-mod-hashlimit
238 $(call Package
/iptables
/Module
, +kmod-ipt-hashlimit
)
239 TITLE
:=hashlimit matching
242 define Package
/iptables-mod-hashlimit
/description
243 iptables extensions for hashlimit matching
250 define Package
/iptables-mod-iprange
251 $(call Package
/iptables
/Module
, +kmod-ipt-iprange
)
252 TITLE
:=IP range extension
255 define Package
/iptables-mod-iprange
/description
256 iptables extensions for matching ip ranges.
263 define Package
/iptables-mod-extra
264 $(call Package
/iptables
/Module
, +kmod-ipt-extra
)
265 TITLE
:=Other extra iptables extensions
268 define Package
/iptables-mod-extra
/description
269 Other extra iptables extensions.
274 - physdev
(if ebtables is enabled
)
280 define Package
/iptables-mod-led
281 $(call Package
/iptables
/Module
, +kmod-ipt-led
)
282 TITLE
:=LED trigger iptables extension
285 define Package
/iptables-mod-led
/description
286 iptables extension for triggering a LED.
293 define Package
/iptables-mod-tproxy
294 $(call Package
/iptables
/Module
, +kmod-ipt-tproxy
)
295 TITLE
:=Transparent proxy iptables extensions
298 define Package
/iptables-mod-tproxy
/description
299 Transparent proxy iptables extensions.
309 define Package
/iptables-mod-tee
310 $(call Package
/iptables
/Module
, +kmod-ipt-tee
)
311 TITLE
:=TEE iptables extensions
314 define Package
/iptables-mod-tee
/description
315 TEE iptables extensions.
322 define Package
/iptables-mod-u32
323 $(call Package
/iptables
/Module
, +kmod-ipt-u32
)
324 TITLE
:=U32 iptables extensions
327 define Package
/iptables-mod-u32
/description
328 U32 iptables extensions.
335 define Package
/iptables-utils
336 $(call Package
/iptables
/Module
, )
337 TITLE
:=iptables save and restore utilities
340 define Package
/ip6tables
341 $(call Package
/iptables
/Default
)
342 DEPENDS
:=+kmod-ip6tables
+libip6tc
+libxtables
344 TITLE
:=IPv6 firewall administration tool
348 define Package
/ip6tables-utils
349 $(call Package
/iptables
/Default
)
352 TITLE
:=ip6tables save and restore utilities
355 define Package
/libiptc
356 $(call Package
/iptables
/Default
)
359 DEPENDS
:=+libip4tc
+libip6tc
360 TITLE
:=IPv4
/IPv6 firewall
- shared libiptc library
(compatibility stub
)
363 define Package
/libip4tc
364 $(call Package
/iptables
/Default
)
367 TITLE
:=IPv4 firewall
- shared libiptc library
370 define Package
/libip6tc
371 $(call Package
/iptables
/Default
)
374 TITLE
:=IPv6 firewall
- shared libiptc library
377 define Package
/libxtables
378 $(call Package
/iptables
/Default
)
381 TITLE
:=IPv4
/IPv6 firewall
- shared xtables library
384 define Package
/libipq
385 $(call Package
/iptables
/Default
)
388 TITLE
:=IPv4
/IPv6 firewall
- shared libipq library
392 -I
$(PKG_BUILD_DIR
)/include \
393 -I
$(LINUX_DIR
)/arch
/$(LINUX_KARCH
)/include \
397 -I
$(PKG_BUILD_DIR
)/include \
398 -I
$(LINUX_DIR
)/arch
/$(LINUX_KARCH
)/include
405 --with-kernel
="$(LINUX_DIR)" \
406 --with-xtlibdir
=/usr
/lib
/iptables
409 $(TARGET_CONFIGURE_OPTS
) \
410 COPT_FLAGS
="$(TARGET_CFLAGS)" \
411 LDFLAGS
="-rdynamic" \
412 KERNEL_DIR
="$(LINUX_DIR)" PREFIX
=/usr \
413 KBUILD_OUTPUT
="$(LINUX_DIR)" \
415 define Build
/InstallDev
416 $(INSTALL_DIR
) $(1)/usr
/include
417 $(INSTALL_DIR
) $(1)/usr
/include/iptables
418 $(INSTALL_DIR
) $(1)/usr
/include/net
/netfilter
420 # XXX: iptables header fixup, some headers are not installed by iptables anymore
421 $(CP
) $(PKG_BUILD_DIR
)/include/net
/netfilter
/*.h
$(1)/usr
/include/net
/netfilter
/
422 $(CP
) $(PKG_BUILD_DIR
)/include/iptables
/*.h
$(1)/usr
/include/iptables
/
423 $(CP
) $(PKG_BUILD_DIR
)/include/iptables.h
$(1)/usr
/include/
424 $(CP
) $(PKG_BUILD_DIR
)/include/libipq
/libipq.h
$(1)/usr
/include/
425 $(CP
) $(PKG_BUILD_DIR
)/include/libipulog
$(1)/usr
/include/
426 $(CP
) $(PKG_BUILD_DIR
)/include/libiptc
$(1)/usr
/include/
428 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/* $(1)/usr
/include/
429 $(INSTALL_DIR
) $(1)/usr
/lib
430 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libxtables.so
* $(1)/usr
/lib
/
431 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libip
*tc.so
* $(1)/usr
/lib
/
432 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libipq.so
* $(1)/usr
/lib
/
433 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
434 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/xtables.
pc $(1)/usr
/lib
/pkgconfig
/
435 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libiptc.
pc $(1)/usr
/lib
/pkgconfig
/
438 define Package
/iptables
/install
439 $(INSTALL_DIR
) $(1)/usr
/sbin
440 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables
$(1)/usr
/sbin
/
441 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
442 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
443 for m in
$(patsubst xt_
%,ipt_
%,$(IPT_BUILTIN
)) $(patsubst ipt_
%,xt_
%,$(IPT_BUILTIN
)); do \
444 if
[ -f
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$${m}.so
]; then \
445 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$${m}.so
$(1)/usr
/lib
/iptables
/ ;\
451 define Package
/iptables-utils
/install
452 $(INSTALL_DIR
) $(1)/usr
/sbin
453 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables-multi
$(1)/usr
/sbin
/
454 $(LN
) iptables-multi
$(1)/usr
/sbin
/iptables-save
455 $(LN
) iptables-multi
$(1)/usr
/sbin
/iptables-restore
458 define Package
/ip6tables
/install
459 $(INSTALL_DIR
) $(1)/usr
/sbin
460 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables
$(1)/usr
/sbin
/
461 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
462 (cd
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
; \
463 $(CP
) libip6t_
*.so
$(1)/usr
/lib
/iptables
/ \
467 define Package
/ip6tables-utils
/install
468 $(INSTALL_DIR
) $(1)/usr
/sbin
469 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables-multi
$(1)/usr
/sbin
/
470 $(LN
) ip6tables-multi
$(1)/usr
/sbin
/ip6tables-save
471 $(LN
) ip6tables-multi
$(1)/usr
/sbin
/ip6tables-restore
474 define Package
/libiptc
/install
475 $(INSTALL_DIR
) $(1)/usr
/lib
476 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libiptc.so
* $(1)/usr
/lib
/
479 define Package
/libip4tc
/install
480 $(INSTALL_DIR
) $(1)/usr
/lib
481 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libip4tc.so
* $(1)/usr
/lib
/
484 define Package
/libip6tc
/install
485 $(INSTALL_DIR
) $(1)/usr
/lib
486 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libip6tc.so
* $(1)/usr
/lib
/
489 define Package
/libxtables
/install
490 $(INSTALL_DIR
) $(1)/usr
/lib
491 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libxtables.so
* $(1)/usr
/lib
/
494 define Package
/libipq
/install
495 $(INSTALL_DIR
) $(1)/usr
/lib
496 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libipq.so
* $(1)/usr
/lib
/
500 define Package
/$(1)/install
501 $(INSTALL_DIR
) $$(1)/usr
/lib
/iptables
502 for m in
$(patsubst xt_
%,ipt_
%,$(2)) $(patsubst ipt_
%,xt_
%,$(2)); do \
503 if
[ -f
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
]; then \
504 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
$$(1)/usr
/lib
/iptables
/ ; \
510 $$(eval
$$(call BuildPackage
,$(1)))
514 $(INSTALL_DIR
) $$(1)/etc
/l7-protocols
; \
515 $(CP
) files
/l7
/*.pat
$$(1)/etc
/l7-protocols
/
518 $(eval
$(call BuildPackage
,iptables
))
519 $(eval
$(call BuildPackage
,iptables-utils
))
520 $(eval
$(call BuildPlugin
,iptables-mod-conntrack
,$(IPT_CONNTRACK-m
)))
521 $(eval
$(call BuildPlugin
,iptables-mod-conntrack-extra
,$(IPT_CONNTRACK_EXTRA-m
)))
522 $(eval
$(call BuildPlugin
,iptables-mod-extra
,$(IPT_EXTRA-m
)))
523 $(eval
$(call BuildPlugin
,iptables-mod-filter
,$(IPT_FILTER-m
),$(L7_INSTALL
)))
524 $(eval
$(call BuildPlugin
,iptables-mod-ipopt
,$(IPT_IPOPT-m
)))
525 $(eval
$(call BuildPlugin
,iptables-mod-ipsec
,$(IPT_IPSEC-m
)))
526 $(eval
$(call BuildPlugin
,iptables-mod-ipset
,ipt_set ipt_SET
))
527 $(eval
$(call BuildPlugin
,iptables-mod-nat
,$(IPT_NAT-m
)))
528 $(eval
$(call BuildPlugin
,iptables-mod-nat-extra
,$(IPT_NAT_EXTRA-m
)))
529 $(eval
$(call BuildPlugin
,iptables-mod-iprange
,$(IPT_IPRANGE-m
)))
530 $(eval
$(call BuildPlugin
,iptables-mod-ulog
,$(IPT_ULOG-m
)))
531 $(eval
$(call BuildPlugin
,iptables-mod-hashlimit
,$(IPT_HASHLIMIT-m
)))
532 $(eval
$(call BuildPlugin
,iptables-mod-led
,$(IPT_LED-m
)))
533 $(eval
$(call BuildPlugin
,iptables-mod-tproxy
,$(IPT_TPROXY-m
)))
534 $(eval
$(call BuildPlugin
,iptables-mod-tee
,$(IPT_TEE-m
)))
535 $(eval
$(call BuildPlugin
,iptables-mod-u32
,$(IPT_U32-m
)))
536 $(eval
$(call BuildPackage
,ip6tables
))
537 $(eval
$(call BuildPackage
,ip6tables-utils
))
538 $(eval
$(call BuildPackage
,libiptc
))
539 $(eval
$(call BuildPackage
,libip4tc
))
540 $(eval
$(call BuildPackage
,libip6tc
))
541 $(eval
$(call BuildPackage
,libxtables
))
542 $(eval
$(call BuildPackage
,libipq
))