2008-04-15 09:11:23 +03:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006-2008 OpenWrt.org
|
2006-06-27 03:35:46 +03:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2005-03-21 10:12:49 +02:00
|
|
|
# $Id$
|
|
|
|
|
2005-03-06 05:34:52 +02:00
|
|
|
include $(TOPDIR)/rules.mk
|
2006-06-21 05:32:39 +03:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2005-05-18 13:40:10 +03:00
|
|
|
PKG_NAME:=iptables
|
2008-04-15 09:11:23 +03:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_LINUX_2_4),y)
|
|
|
|
PKG_VERSION:=1.3.8
|
|
|
|
PKG_RELEASE:=3
|
|
|
|
PKG_MD5SUM:=0a9209f928002e5eee9cdff8fef4d4b3
|
2008-06-02 14:54:05 +03:00
|
|
|
MAKE_TARGETS:=experimental install-experimental
|
2008-04-15 09:11:23 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_LINUX_2_6),y)
|
|
|
|
PKG_VERSION:=1.4.0
|
|
|
|
PKG_RELEASE:=1
|
|
|
|
PKG_MD5SUM:=90cfa8a554a29b0b859a625e701af2a7
|
|
|
|
endif
|
|
|
|
|
|
|
|
PKG_VERSION?=<IPTABLES_VERSION>
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2006-05-29 04:41:59 +03:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
2005-12-15 11:05:57 +02:00
|
|
|
PKG_SOURCE_URL:=http://www.netfilter.org/projects/iptables/files \
|
2005-06-06 18:47:13 +03:00
|
|
|
ftp://ftp.be.netfilter.org/pub/netfilter/iptables/ \
|
|
|
|
ftp://ftp.de.netfilter.org/pub/netfilter/iptables/ \
|
|
|
|
ftp://ftp.no.netfilter.org/pub/netfilter/iptables/
|
2008-04-15 09:11:23 +03:00
|
|
|
|
|
|
|
PATCH_DIR:=./patches/$(PKG_VERSION)
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2006-06-21 05:32:39 +03:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2006-06-22 02:45:47 +03:00
|
|
|
ifeq ($(DUMP),)
|
2006-09-24 23:49:31 +03:00
|
|
|
-include $(LINUX_DIR)/.config
|
|
|
|
include $(INCLUDE_DIR)/netfilter.mk
|
2007-03-23 21:19:23 +02:00
|
|
|
STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep 'NETFILTER' $(LINUX_DIR)/.config | md5s)
|
2006-06-22 02:45:47 +03:00
|
|
|
endif
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2006-09-24 23:49:31 +03:00
|
|
|
define Package/iptables/Default
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Base system
|
|
|
|
URL:=http://netfilter.org/
|
|
|
|
endef
|
|
|
|
|
2008-04-15 09:11:23 +03:00
|
|
|
define Package/iptables/Module
|
|
|
|
$(call Package/iptables/Default)
|
|
|
|
DEPENDS:=iptables $(1)
|
|
|
|
endef
|
|
|
|
|
2006-04-14 07:27:05 +03:00
|
|
|
define Package/iptables
|
2007-09-07 11:34:51 +03:00
|
|
|
$(call Package/iptables/Default)
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=IPv4 firewall administration tool
|
|
|
|
MENU:=1
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-conntrack
|
2008-04-15 09:11:23 +03:00
|
|
|
$(call Package/iptables/Module, +kmod-ipt-conntrack)
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=connection tracking modules
|
2007-09-07 11:34:51 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-conntrack/description
|
|
|
|
iptables extensions for connection tracking.
|
|
|
|
Includes:
|
|
|
|
- libipt_conntrack
|
|
|
|
- libipt_helper
|
|
|
|
- libipt_connmark/CONNMARK
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-filter
|
2008-04-15 09:11:23 +03:00
|
|
|
$(call Package/iptables/Module, +kmod-ipt-filter)
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=filter modules
|
2007-09-07 11:34:51 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-filter/description
|
|
|
|
iptables extensions for packet content inspection.
|
2008-04-15 09:11:23 +03:00
|
|
|
Includes:
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_ipp2p
|
2008-04-15 09:11:23 +03:00
|
|
|
- libipt_layer7
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-imq
|
2008-06-02 22:46:47 +03:00
|
|
|
$(call Package/iptables/Module, +kmod-ipt-imq)
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=IMQ support
|
2007-09-07 11:34:51 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-imq/description
|
|
|
|
iptables extension for IMQ support.
|
2008-04-15 09:11:23 +03:00
|
|
|
Includes:
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_IMQ
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-ipopt
|
2008-04-15 09:11:23 +03:00
|
|
|
$(call Package/iptables/Module, +kmod-ipt-ipopt)
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=IP/Packet option modules
|
2007-09-07 11:34:51 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-ipopt/description
|
|
|
|
iptables extensions for matching/changing IP packet options.\\\
|
2008-04-15 09:11:23 +03:00
|
|
|
Includes:
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_CLASSIFY
|
|
|
|
- libipt_dscp/DSCP
|
|
|
|
- libipt_ecn/ECN
|
|
|
|
- libipt_length
|
|
|
|
- libipt_mac
|
2007-10-31 22:21:58 +02:00
|
|
|
- libipt_mark/MARK
|
|
|
|
- libipt_statistic
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_tcpmms
|
2007-10-31 22:21:58 +02:00
|
|
|
- libipt_tos/TOS
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_ttl/TTL
|
2008-04-15 09:11:23 +03:00
|
|
|
- libipt_unclean
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-ipsec
|
2008-04-15 09:11:23 +03:00
|
|
|
$(call Package/iptables/Module, +kmod-ipt-ipsec)
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=IPSec extensions
|
2007-09-07 11:34:51 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-ipsec/description
|
|
|
|
iptables extensions for matching ipsec traffic.
|
2008-04-15 09:11:23 +03:00
|
|
|
Includes:
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_ah
|
|
|
|
- libipt_esp
|
2007-10-16 17:04:59 +03:00
|
|
|
- libipt_policy
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-nat
|
2008-04-15 09:11:23 +03:00
|
|
|
$(call Package/iptables/Module, +kmod-ipt-nat)
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=extra NAT targets
|
2007-09-07 11:34:51 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-nat/description
|
|
|
|
iptables extensions for different NAT targets.
|
2008-04-15 09:11:23 +03:00
|
|
|
Includes:
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_REDIRECT
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-ulog
|
2008-04-15 09:11:23 +03:00
|
|
|
$(call Package/iptables/Module, +kmod-ipt-ulog)
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=user-space packet logging
|
2007-09-07 11:34:51 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-ulog/description
|
|
|
|
iptables extensions for user-space packet logging.
|
2008-04-15 09:11:23 +03:00
|
|
|
Includes:
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_ULOG
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
2007-06-03 01:57:33 +03:00
|
|
|
define Package/iptables-mod-iprange
|
2008-04-15 09:11:23 +03:00
|
|
|
$(call Package/iptables/Module, +kmod-ipt-iprange)
|
2007-06-03 01:57:33 +03:00
|
|
|
TITLE:=ip range module
|
2007-09-07 11:34:51 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-iprange/description
|
|
|
|
iptables extensions for matching ip ranges.
|
2008-04-15 09:11:23 +03:00
|
|
|
Includes:
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_iprange
|
2007-06-03 01:57:33 +03:00
|
|
|
endef
|
|
|
|
|
2006-04-14 07:27:05 +03:00
|
|
|
define Package/iptables-mod-extra
|
2008-04-15 09:11:23 +03:00
|
|
|
$(call Package/iptables/Module, +kmod-ipt-extra)
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=other extra iptables extensions
|
2007-09-07 11:34:51 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-mod-extra/description
|
|
|
|
other extra iptables extensions.
|
2008-04-15 09:11:23 +03:00
|
|
|
Includes:
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_limit
|
|
|
|
- libipt_owner
|
|
|
|
- libipt_physdev
|
|
|
|
- libipt_pkttype
|
|
|
|
- libipt_recent
|
2007-10-07 20:17:04 +03:00
|
|
|
- iptable_raw
|
2007-09-07 11:34:51 +03:00
|
|
|
- libipt_NOTRACK
|
2007-10-07 20:17:04 +03:00
|
|
|
- libipt_TARPIT
|
|
|
|
- libipt_DELUDE
|
|
|
|
- libipt_CHAOS
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
2007-06-07 18:30:59 +03:00
|
|
|
define Package/iptables-mod-ipset
|
2008-04-15 09:11:23 +03:00
|
|
|
$(call Package/iptables/Module, +kmod-ipt-ipset)
|
2007-06-07 18:30:59 +03:00
|
|
|
TITLE:=ipset iptables extension
|
|
|
|
endef
|
|
|
|
|
2006-04-14 07:27:05 +03:00
|
|
|
define Package/iptables-utils
|
2008-04-15 09:11:23 +03:00
|
|
|
$(call Package/iptables/Module, )
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=iptables save and restore utilities
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/ip6tables
|
2007-09-07 11:34:51 +03:00
|
|
|
$(call Package/iptables/Default)
|
2008-04-15 09:11:23 +03:00
|
|
|
DEPENDS:=+kmod-ip6tables
|
|
|
|
CATEGORY:=IPv6
|
2006-09-24 23:49:31 +03:00
|
|
|
TITLE:=IPv6 firewall administration tool
|
2008-04-15 09:11:23 +03:00
|
|
|
MENU:=1
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
2007-09-06 00:40:11 +03:00
|
|
|
define Package/ip6tables-utils
|
|
|
|
$(call Package/iptables/Default)
|
|
|
|
DEPENDS:=ip6tables
|
2008-04-15 09:11:23 +03:00
|
|
|
CATEGORY:=IPv6
|
2007-09-06 00:40:11 +03:00
|
|
|
TITLE:=ip6tables save and restore utilities
|
|
|
|
endef
|
|
|
|
|
2007-09-16 19:25:53 +03:00
|
|
|
define Build/Prepare
|
|
|
|
$(call Build/Prepare/Default)
|
|
|
|
endef
|
|
|
|
|
2006-04-14 07:27:05 +03:00
|
|
|
define Build/Configure
|
2008-04-15 09:11:23 +03:00
|
|
|
chmod a+x $(PKG_BUILD_DIR)/extensions/.*-test*
|
2007-03-23 21:19:23 +02:00
|
|
|
rm -f $(PKG_BUILD_DIR)/.configured*
|
2007-03-01 13:59:42 +02:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
|
|
|
clean
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
2005-05-18 13:40:10 +03:00
|
|
|
mkdir -p $(PKG_INSTALL_DIR)
|
2006-08-04 14:59:52 +03:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
2005-05-18 13:40:10 +03:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2006-08-04 14:59:52 +03:00
|
|
|
COPT_FLAGS="$(TARGET_CFLAGS)" \
|
2007-04-01 15:28:56 +03:00
|
|
|
LDFLAGS="-rdynamic -static-libgcc" \
|
2006-08-04 06:26:32 +03:00
|
|
|
KERNEL_DIR="$(LINUX_DIR)" PREFIX=/usr \
|
2008-04-15 09:11:23 +03:00
|
|
|
KBUILD_OUTPUT="$(LINUX_DIR)" \
|
2005-05-18 13:40:10 +03:00
|
|
|
DESTDIR="$(PKG_INSTALL_DIR)" \
|
2008-06-02 14:54:05 +03:00
|
|
|
all install $(MAKE_TARGETS)
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
2006-05-31 16:00:11 +03:00
|
|
|
|
|
|
|
define Build/InstallDev
|
2006-08-04 14:59:52 +03:00
|
|
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
2006-05-31 16:00:11 +03:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
2006-08-04 14:59:52 +03:00
|
|
|
COPT_FLAGS="$(TARGET_CFLAGS)" \
|
2006-08-04 06:26:32 +03:00
|
|
|
KERNEL_DIR="$(LINUX_DIR)" PREFIX=/usr \
|
2008-04-15 09:11:23 +03:00
|
|
|
KBUILD_OUTPUT="$(LINUX_DIR)" \
|
2007-09-28 04:45:11 +03:00
|
|
|
DESTDIR="$(1)" \
|
2006-11-27 01:13:49 +02:00
|
|
|
install-devel
|
2007-09-28 04:45:11 +03:00
|
|
|
$(CP) $(PKG_BUILD_DIR)/include $(1)/usr
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/libiptc/libiptc.a $(1)/usr/lib
|
2006-05-31 16:00:11 +03:00
|
|
|
endef
|
|
|
|
|
2006-04-14 07:27:05 +03:00
|
|
|
define Package/iptables/install
|
2006-11-23 02:29:07 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2007-12-09 20:53:06 +02:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/iptables $(1)/usr/sbin/
|
2006-11-23 02:29:07 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/iptables
|
2005-05-18 13:40:10 +03:00
|
|
|
(cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
|
2008-04-15 09:11:23 +03:00
|
|
|
for m in $(patsubst xt_%,ipt_%,$(IPT_BUILTIN)) $(patsubst ipt_%,xt_%,$(IPT_BUILTIN)); do \
|
|
|
|
if [ -f $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$${m}.so ]; then \
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$${m}.so $(1)/usr/lib/iptables/ ;\
|
|
|
|
fi; \
|
|
|
|
done \
|
2005-05-18 13:40:10 +03:00
|
|
|
)
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/iptables-utils/install
|
2006-11-23 02:29:07 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2007-12-09 20:53:06 +02:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/iptables-{save,restore} $(1)/usr/sbin/
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/ip6tables/install
|
2006-11-23 02:29:07 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2007-12-09 20:53:06 +02:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables $(1)/usr/sbin/
|
2006-11-23 02:29:07 +02:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/iptables
|
2005-05-18 13:40:10 +03:00
|
|
|
(cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
|
2006-04-14 07:27:05 +03:00
|
|
|
$(CP) libip6t_*.so $(1)/usr/lib/iptables/ \
|
2005-05-18 13:40:10 +03:00
|
|
|
)
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
2007-09-06 00:40:11 +03:00
|
|
|
define Package/ip6tables-utils/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
2007-12-09 20:53:06 +02:00
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables-{save,restore} $(1)/usr/sbin/
|
2007-09-06 00:40:11 +03:00
|
|
|
endef
|
|
|
|
|
2006-04-14 07:27:05 +03:00
|
|
|
define BuildPlugin
|
2006-09-24 23:49:31 +03:00
|
|
|
define Package/$(1)/install
|
2006-11-23 02:29:07 +02:00
|
|
|
$(INSTALL_DIR) $$(1)/usr/lib/iptables
|
2008-04-15 09:11:23 +03:00
|
|
|
for m in $(patsubst xt_%,ipt_%,$(2)) $(patsubst ipt_%,xt_%,$(2)); do \
|
|
|
|
if [ -f $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so ]; then \
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so $$(1)/usr/lib/iptables/ ; \
|
|
|
|
fi; \
|
2006-04-14 07:27:05 +03:00
|
|
|
done
|
|
|
|
$(3)
|
2006-09-24 23:49:31 +03:00
|
|
|
endef
|
2006-04-14 07:27:05 +03:00
|
|
|
|
2006-09-24 23:49:31 +03:00
|
|
|
$$(eval $$(call BuildPackage,$(1)))
|
2006-04-14 07:27:05 +03:00
|
|
|
endef
|
|
|
|
|
2007-01-08 02:53:24 +02:00
|
|
|
L7_INSTALL:=\
|
|
|
|
$(INSTALL_DIR) $$(1)/etc/l7-protocols; \
|
2006-04-14 07:27:05 +03:00
|
|
|
$(CP) files/l7/*.pat $$(1)/etc/l7-protocols/
|
|
|
|
|
2006-04-21 03:12:18 +03:00
|
|
|
$(eval $(call BuildPackage,iptables))
|
|
|
|
$(eval $(call BuildPackage,iptables-utils))
|
2006-04-14 07:27:05 +03:00
|
|
|
$(eval $(call BuildPlugin,iptables-mod-conntrack,$(IPT_CONNTRACK-m)))
|
|
|
|
$(eval $(call BuildPlugin,iptables-mod-extra,$(IPT_EXTRA-m)))
|
2007-06-07 18:30:59 +03:00
|
|
|
$(eval $(call BuildPlugin,iptables-mod-ipset,$(IPT_IPSET-m)))
|
2006-04-14 07:27:05 +03:00
|
|
|
$(eval $(call BuildPlugin,iptables-mod-filter,$(IPT_FILTER-m),$(L7_INSTALL)))
|
|
|
|
$(eval $(call BuildPlugin,iptables-mod-imq,$(IPT_IMQ-m)))
|
|
|
|
$(eval $(call BuildPlugin,iptables-mod-ipopt,$(IPT_IPOPT-m)))
|
|
|
|
$(eval $(call BuildPlugin,iptables-mod-ipsec,$(IPT_IPSEC-m)))
|
|
|
|
$(eval $(call BuildPlugin,iptables-mod-nat,$(IPT_NAT-m)))
|
2007-06-03 01:57:33 +03:00
|
|
|
$(eval $(call BuildPlugin,iptables-mod-iprange,$(IPT_IPRANGE-m)))
|
2006-04-14 07:27:05 +03:00
|
|
|
$(eval $(call BuildPlugin,iptables-mod-ulog,$(IPT_ULOG-m)))
|
2006-04-21 03:12:18 +03:00
|
|
|
$(eval $(call BuildPackage,ip6tables))
|
2007-09-06 00:40:11 +03:00
|
|
|
$(eval $(call BuildPackage,ip6tables-utils))
|