1 # SPDX-License-Identifier: GPL-2.0-only
3 # Copyright (C) 2009-2013 OpenWrt.org
6 include $(TOPDIR
)/rules.mk
7 include $(INCLUDE_DIR
)/kernel.mk
9 PKG_NAME
:=xtables-addons
11 PKG_RELEASE
:=$(AUTORELEASE
)
12 PKG_HASH
:=2e09ac129a14f5e9c23b115ebcdfff4aa84e2aeba1268dbdf39b2d752bd71e19
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
15 PKG_SOURCE_URL
:=https
://inai.de
/files
/xtables-addons
/
16 PKG_BUILD_DEPENDS
:=iptables
21 PKG_MAINTAINER
:=Jo-Philipp Wich
<jo@mein.io
>
23 PKG_LICENSE_FILES
:=COPYING
28 include $(INCLUDE_DIR
)/package.mk
30 define Package
/xtables-addons
34 TITLE
:=Extensions not distributed in the main Xtables
35 URL
:=https
://inai.de
/projects
/xtables-addons
/
41 --with-kbuild
="$(LINUX_DIR)" \
42 --with-xtlibdir
="/usr/lib/iptables"
44 ifdef CONFIG_EXTERNAL_TOOLCHAIN
46 $(patsubst ARCH
=%,ARCH
=$(LINUX_KARCH
),$(MAKE_FLAGS
)) \
49 MAKE_INSTALL_FLAGS
:= \
50 $(patsubst ARCH
=%,ARCH
=$(LINUX_KARCH
),$(MAKE_FLAGS
)) \
54 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
55 $(KERNEL_MAKE_FLAGS
) \
56 DESTDIR
="$(PKG_INSTALL_DIR)" \
62 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
63 $(KERNEL_MAKE_FLAGS
) \
64 DESTDIR
="$(PKG_INSTALL_DIR)" \
70 # 1: extension/module suffix used in package name
71 # 2: extension/module display name used in package title/description
72 # 3: list of extensions to package
73 # 4: list of modules to package
74 # 5: module load priority
79 define Package
/iptables-mod-
$(1)
80 $$(call Package
/xtables-addons
)
82 TITLE
:=$(2) iptables extension
83 DEPENDS
:=iptables
$(if
$(4),+kmod-ipt-
$(1))
86 define Package
/iptables-mod-
$(1)/install
87 $(INSTALL_DIR
) $$(1)/usr
/lib
/iptables
90 $(PKG_INSTALL_DIR
)/usr
/lib
/iptables
/lib
$$$$$$$${m}.so \
91 $$(1)/usr
/lib
/iptables
/ ; \
95 $$(eval
$$(call BuildPackage
,iptables-mod-
$(1)))
99 define KernelPackage
/ipt-
$(1)
100 SUBMENU
:=Netfilter Extensions
101 TITLE
:=$(2) netfilter module
102 DEPENDS
:=+kmod-ipt-core
$(5)
103 FILES
:=$(foreach mod
,$(4),$(PKG_BUILD_DIR
)/extensions
/$(mod
).
$(LINUX_KMOD_SUFFIX
))
104 AUTOLOAD
:=$(call AutoProbe
,$(notdir $(4)))
107 $$(eval
$$(call KernelPackage
,ipt-
$(1)))
113 define Package
/iptaccount
114 $(call Package
/xtables-addons
)
116 TITLE
:=iptables-mod-account control utility
117 DEPENDS
:=iptables
+iptables-mod-account
120 define Package
/iptaccount
/install
121 $(INSTALL_DIR
) $(1)/usr
/lib
122 $(INSTALL_DIR
) $(1)/usr
/sbin
124 $(PKG_INSTALL_DIR
)/usr
/lib
/libxt_ACCOUNT_cl.so
* \
127 $(PKG_INSTALL_DIR
)/usr
/sbin
/iptaccount \
132 define Package
/iptgeoip
133 $(call Package
/xtables-addons
)
135 TITLE
:=iptables-mod-geoip support scripts for MaxMind GeoIP databases
136 DEPENDS
:=iptables
+iptables-mod-geoip \
137 +perl
+perlbase-getopt
+perlbase-io
+perl-text-csv_xs \
138 +perl-net-cidr-lite \
139 +wget-ssl
+!BUSYBOX_CONFIG_ZCAT
:gzip
142 define Package
/iptgeoip
/config
143 menu
"Select iptgeoip options"
144 config IPTGEOIP_PRESERVE
145 bool
"Preserve across sysupgrades"
148 Backup and restore during sysupgrade
(requires
>7MB
)
152 ifeq ($(CONFIG_IPTGEOIP_PRESERVE
),y
)
153 define Package
/iptgeoip
/conffiles
158 define Package
/iptgeoip
/install
159 $(INSTALL_DIR
) $(1)/usr
/lib
/xtables-addons
161 $(PKG_INSTALL_DIR
)/usr
/lib
/xtables-addons
/xt_geoip_
{build
,dl
} \
162 $(1)/usr
/lib
/xtables-addons
/
163 $(INSTALL_DIR
) $(1)/usr
/bin
165 $(PKG_INSTALL_DIR
)/usr
/bin
/xt_geoip_query \
167 $(INSTALL_DIR
) $(1)/usr
/share
/xt_geoip
168 touch
$(1)/usr
/share
/xt_geoip
/.keep
172 #$(eval $(call BuildTemplate,SUFFIX,DESCRIPTION,EXTENSION,MODULE,PRIORITY,DEPENDS))
174 $(eval
$(call BuildTemplate
,compat-xtables
,API compatibilty layer
,,compat_xtables
,+IPV6
:kmod-ip6tables
))
175 $(eval
$(call BuildTemplate
,nathelper-rtsp
,RTSP Conntrack and NAT
,,rtsp
/nf_conntrack_rtsp rtsp
/nf_nat_rtsp
,+kmod-ipt-conntrack-extra
+kmod-ipt-nat
))
177 $(eval
$(call BuildTemplate
,account
,ACCOUNT
,xt_ACCOUNT
,ACCOUNT
/xt_ACCOUNT
,+kmod-ipt-compat-xtables
))
178 $(eval
$(call BuildTemplate
,chaos
,CHAOS
,xt_CHAOS
,xt_CHAOS
,+kmod-ipt-compat-xtables
+kmod-ipt-delude
+kmod-ipt-tarpit
))
179 $(eval
$(call BuildTemplate
,condition
,Condition
,xt_condition
,xt_condition
,))
180 $(eval
$(call BuildTemplate
,delude
,DELUDE
,xt_DELUDE
,xt_DELUDE
,+kmod-ipt-compat-xtables
))
181 $(eval
$(call BuildTemplate
,dhcpmac
,DHCPMAC
,xt_DHCPMAC
,xt_DHCPMAC
,+kmod-ipt-compat-xtables
))
182 $(eval
$(call BuildTemplate
,dnetmap
,DNETMAP
,xt_DNETMAP
,xt_DNETMAP
,+kmod-ipt-compat-xtables
+kmod-ipt-nat
))
183 $(eval
$(call BuildTemplate
,fuzzy
,fuzzy
,xt_fuzzy
,xt_fuzzy
,))
184 $(eval
$(call BuildTemplate
,geoip
,geoip
,xt_geoip
,xt_geoip
,))
185 $(eval
$(call BuildTemplate
,iface
,iface
,xt_iface
,xt_iface
,))
186 $(eval
$(call BuildTemplate
,ipmark
,IPMARK
,xt_IPMARK
,xt_IPMARK
,+kmod-ipt-compat-xtables
))
187 $(eval
$(call BuildTemplate
,ipp2p
,IPP2P
,xt_ipp2p
,xt_ipp2p
,+kmod-ipt-compat-xtables
))
188 $(eval
$(call BuildTemplate
,ipv4options
,ipv4options
,xt_ipv4options
,xt_ipv4options
,))
189 $(eval
$(call BuildTemplate
,length2
,length2
,xt_length2
,xt_length2
,+kmod-ipt-compat-xtables
))
190 $(eval
$(call BuildTemplate
,logmark
,LOGMARK
,xt_LOGMARK
,xt_LOGMARK
,+kmod-ipt-compat-xtables
))
191 $(eval
$(call BuildTemplate
,lscan
,lscan
,xt_lscan
,xt_lscan
,))
192 $(eval
$(call BuildTemplate
,lua
,Lua PacketScript
,xt_LUA
,LUA
/xt_LUA
,+kmod-ipt-conntrack-extra
))
193 $(eval
$(call BuildTemplate
,proto
,PROTO
,xt_PROTO
,xt_PROTO
,))
194 $(eval
$(call BuildTemplate
,psd
,psd
,xt_psd
,xt_psd
,))
195 $(eval
$(call BuildTemplate
,quota2
,quota2
,xt_quota2
,xt_quota2
,))
196 $(eval
$(call BuildTemplate
,sysrq
,SYSRQ
,xt_SYSRQ
,xt_SYSRQ
,+kmod-ipt-compat-xtables
+kmod-crypto-hash
))
197 $(eval
$(call BuildTemplate
,tarpit
,TARPIT
,xt_TARPIT
,xt_TARPIT
,+kmod-ipt-compat-xtables
))
199 $(eval
$(call BuildPackage
,iptaccount
))
200 $(eval
$(call BuildPackage
,iptgeoip
))