2 # Copyright (C) 2006-2013 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_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
16 PKG_SOURCE_URL
:=http
://www.netfilter.org
/projects
/iptables
/files \
17 ftp
://ftp.be.netfilter.org
/pub
/netfilter
/iptables
/ \
18 ftp
://ftp.de.netfilter.org
/pub
/netfilter
/iptables
/ \
19 ftp
://ftp.no.netfilter.org
/pub
/netfilter
/iptables
/
20 PKG_MD5SUM
:=387b92d3efcf4f07fe31c3bf0f1d18f5
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
:=IP firewall administration tool
54 DEPENDS
+= +kmod-ipt-core
+libip4tc
+IPV6
:libip6tc
+libxtables
57 define Package
/iptables
/description
58 IP firewall administration tool.
96 define Package
/iptables-mod-conntrack-extra
97 $(call Package
/iptables
/Module
, +kmod-ipt-conntrack-extra
)
98 TITLE
:=Extra connection tracking extensions
101 define Package
/iptables-mod-conntrack-extra
/description
102 Extra iptables extensions for connection tracking.
115 define Package
/iptables-mod-filter
116 $(call Package
/iptables
/Module
, +kmod-ipt-filter
)
117 TITLE
:=Content inspection extensions
120 define Package
/iptables-mod-filter
/description
121 iptables extensions for packet content inspection.
122 Includes support for
:
130 define Package
/iptables-mod-ipopt
131 $(call Package
/iptables
/Module
, +kmod-ipt-ipopt
)
132 TITLE
:=IP
/Packet option extensions
135 define Package
/iptables-mod-ipopt
/description
136 iptables extensions for matching
/changing IP packet options.
155 define Package
/iptables-mod-ipsec
156 $(call Package
/iptables
/Module
, +kmod-ipt-ipsec
)
157 TITLE
:=IPsec extensions
160 define Package
/iptables-mod-ipsec
/description
161 iptables extensions for matching ipsec traffic.
170 define Package
/iptables-mod-nat-extra
171 $(call Package
/iptables
/Module
, +kmod-ipt-nat-extra
)
172 TITLE
:=Extra NAT extensions
175 define Package
/iptables-mod-nat-extra
/description
176 iptables extensions for extra NAT targets.
183 define Package
/iptables-mod-ulog
184 $(call Package
/iptables
/Module
, +kmod-ipt-ulog
)
185 TITLE
:=user-space packet logging
188 define Package
/iptables-mod-ulog
/description
189 iptables extensions for user-space packet logging.
196 define Package
/iptables-mod-hashlimit
197 $(call Package
/iptables
/Module
, +kmod-ipt-hashlimit
)
198 TITLE
:=hashlimit matching
201 define Package
/iptables-mod-hashlimit
/description
202 iptables extensions for hashlimit matching
209 define Package
/iptables-mod-iprange
210 $(call Package
/iptables
/Module
, +kmod-ipt-iprange
)
211 TITLE
:=IP range extension
214 define Package
/iptables-mod-iprange
/description
215 iptables extensions for matching ip ranges.
222 define Package
/iptables-mod-extra
223 $(call Package
/iptables
/Module
, +kmod-ipt-extra
)
224 TITLE
:=Other extra iptables extensions
227 define Package
/iptables-mod-extra
/description
228 Other extra iptables extensions.
234 - physdev
(if ebtables is enabled
)
240 define Package
/iptables-mod-led
241 $(call Package
/iptables
/Module
, +kmod-ipt-led
)
242 TITLE
:=LED trigger iptables extension
245 define Package
/iptables-mod-led
/description
246 iptables extension for triggering a LED.
253 define Package
/iptables-mod-tproxy
254 $(call Package
/iptables
/Module
, +kmod-ipt-tproxy
)
255 TITLE
:=Transparent proxy iptables extensions
258 define Package
/iptables-mod-tproxy
/description
259 Transparent proxy iptables extensions.
269 define Package
/iptables-mod-tee
270 $(call Package
/iptables
/Module
, +kmod-ipt-tee
)
271 TITLE
:=TEE iptables extensions
274 define Package
/iptables-mod-tee
/description
275 TEE iptables extensions.
282 define Package
/iptables-mod-u32
283 $(call Package
/iptables
/Module
, +kmod-ipt-u32
)
284 TITLE
:=U32 iptables extensions
287 define Package
/iptables-mod-u32
/description
288 U32 iptables extensions.
295 define Package
/ip6tables
296 $(call Package
/iptables
/Default
)
297 DEPENDS
:=@IPV6
+kmod-ip6tables
+iptables
299 TITLE
:=IPv6 firewall administration tool
303 define Package
/libiptc
304 $(call Package
/iptables
/Default
)
307 DEPENDS
:=+libip4tc
+libip6tc
308 TITLE
:=IPv4
/IPv6 firewall
- shared libiptc library
(compatibility stub
)
311 define Package
/libip4tc
312 $(call Package
/iptables
/Default
)
315 TITLE
:=IPv4 firewall
- shared libiptc library
318 define Package
/libip6tc
319 $(call Package
/iptables
/Default
)
322 TITLE
:=IPv6 firewall
- shared libiptc library
325 define Package
/libxtables
326 $(call Package
/iptables
/Default
)
329 TITLE
:=IPv4
/IPv6 firewall
- shared xtables library
333 -I
$(PKG_BUILD_DIR
)/include \
334 -I
$(LINUX_DIR
)/user_headers
/include \
338 -I
$(PKG_BUILD_DIR
)/include \
339 -I
$(LINUX_DIR
)/user_headers
/include \
340 -ffunction-sections
-fdata-sections
348 --with-kernel
="$(LINUX_DIR)/user_headers" \
349 --with-xtlibdir
=/usr
/lib
/iptables \
353 $(TARGET_CONFIGURE_OPTS
) \
354 COPT_FLAGS
="$(TARGET_CFLAGS)" \
355 KERNEL_DIR
="$(LINUX_DIR)/user_headers/" PREFIX
=/usr \
356 KBUILD_OUTPUT
="$(LINUX_DIR)" \
357 BUILTIN_MODULES
="$(patsubst ip6t_%,%,$(patsubst ipt_%,%,$(patsubst xt_%,%,$(IPT_BUILTIN) $(IPT_CONNTRACK-m) $(IPT_NAT-m))))"
359 define Build
/InstallDev
360 $(INSTALL_DIR
) $(1)/usr
/include
361 $(INSTALL_DIR
) $(1)/usr
/include/iptables
362 $(INSTALL_DIR
) $(1)/usr
/include/net
/netfilter
364 # XXX: iptables header fixup, some headers are not installed by iptables anymore
365 $(CP
) $(PKG_BUILD_DIR
)/include/iptables
/*.h
$(1)/usr
/include/iptables
/
366 $(CP
) $(PKG_BUILD_DIR
)/include/iptables.h
$(1)/usr
/include/
367 $(CP
) $(PKG_BUILD_DIR
)/include/ip6tables.h
$(1)/usr
/include/
368 $(CP
) $(PKG_BUILD_DIR
)/include/libipulog
$(1)/usr
/include/
369 $(CP
) $(PKG_BUILD_DIR
)/include/libiptc
$(1)/usr
/include/
371 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/* $(1)/usr
/include/
372 $(INSTALL_DIR
) $(1)/usr
/lib
373 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libxtables.so
* $(1)/usr
/lib
/
374 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libip
*tc.so
* $(1)/usr
/lib
/
375 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
376 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/xtables.
pc $(1)/usr
/lib
/pkgconfig
/
377 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libip
*tc.
pc $(1)/usr
/lib
/pkgconfig
/
379 # XXX: needed by firewall3
380 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
381 $(CP
) $(PKG_BUILD_DIR
)/extensions
/libext
*.a
$(1)/usr
/lib
/iptables
/
384 define Package
/iptables
/install
385 $(INSTALL_DIR
) $(1)/usr
/sbin
386 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/xtables-multi
$(1)/usr
/sbin
/
387 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/iptables
{,-restore
,-save
} $(1)/usr
/sbin
/
388 $(INSTALL_DIR
) $(1)/usr
/lib
/iptables
391 define Package
/ip6tables
/install
392 $(INSTALL_DIR
) $(1)/usr
/sbin
393 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ip6tables
{,-restore
,-save
} $(1)/usr
/sbin
/
396 define Package
/libiptc
/install
397 $(INSTALL_DIR
) $(1)/usr
/lib
398 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libiptc.so
* $(1)/usr
/lib
/
401 define Package
/libip4tc
/install
402 $(INSTALL_DIR
) $(1)/usr
/lib
403 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libip4tc.so
* $(1)/usr
/lib
/
406 define Package
/libip6tc
/install
407 $(INSTALL_DIR
) $(1)/usr
/lib
408 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libip6tc.so
* $(1)/usr
/lib
/
411 define Package
/libxtables
/install
412 $(INSTALL_DIR
) $(1)/usr
/lib
413 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libxtables.so
* $(1)/usr
/lib
/
417 define Package
/$(1)/install
418 $(INSTALL_DIR
) $$(1)/usr
/lib
/iptables
419 for m in
$(patsubst xt_
%,ipt_
%,$(2)) $(patsubst ipt_
%,xt_
%,$(2)) $(patsubst xt_
%,ip6t_
%,$(2)) $(patsubst ip6t_
%,xt_
%,$(2)); do \
420 if
[ -f
$(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
]; then \
421 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so
$$(1)/usr
/lib
/iptables
/ ; \
427 $$(eval
$$(call BuildPackage
,$(1)))
431 $(INSTALL_DIR
) $$(1)/etc
/l7-protocols
; \
432 $(CP
) files
/l7
/*.pat
$$(1)/etc
/l7-protocols
/
435 $(eval
$(call BuildPackage
,iptables
))
436 $(eval
$(call BuildPlugin
,iptables-mod-conntrack-extra
,$(IPT_CONNTRACK_EXTRA-m
)))
437 $(eval
$(call BuildPlugin
,iptables-mod-extra
,$(IPT_EXTRA-m
)))
438 $(eval
$(call BuildPlugin
,iptables-mod-filter
,$(IPT_FILTER-m
),$(L7_INSTALL
)))
439 $(eval
$(call BuildPlugin
,iptables-mod-ipopt
,$(IPT_IPOPT-m
)))
440 $(eval
$(call BuildPlugin
,iptables-mod-ipsec
,$(IPT_IPSEC-m
)))
441 $(eval
$(call BuildPlugin
,iptables-mod-nat-extra
,$(IPT_NAT_EXTRA-m
)))
442 $(eval
$(call BuildPlugin
,iptables-mod-iprange
,$(IPT_IPRANGE-m
)))
443 $(eval
$(call BuildPlugin
,iptables-mod-ulog
,$(IPT_ULOG-m
)))
444 $(eval
$(call BuildPlugin
,iptables-mod-hashlimit
,$(IPT_HASHLIMIT-m
)))
445 $(eval
$(call BuildPlugin
,iptables-mod-led
,$(IPT_LED-m
)))
446 $(eval
$(call BuildPlugin
,iptables-mod-tproxy
,$(IPT_TPROXY-m
)))
447 $(eval
$(call BuildPlugin
,iptables-mod-tee
,$(IPT_TEE-m
)))
448 $(eval
$(call BuildPlugin
,iptables-mod-u32
,$(IPT_U32-m
)))
449 $(eval
$(call BuildPackage
,ip6tables
))
450 $(eval
$(call BuildPackage
,libiptc
))
451 $(eval
$(call BuildPackage
,libip4tc
))
452 $(eval
$(call BuildPackage
,libip6tc
))
453 $(eval
$(call BuildPackage
,libxtables
))