summaryrefslogtreecommitdiff
path: root/net-firewall/ipt_netflow
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-02-11 16:09:52 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-02-11 16:09:52 +0000
commitf78108598211053d41752a83e0345441bb9014ae (patch)
treedd2fc7ae0a1aea7bda4942ab0c453d1e55284b37 /net-firewall/ipt_netflow
parentdc45b83b28fb83e9659492066e347b8dc60bc9e3 (diff)
gentoo resync : 11.02.2018
Diffstat (limited to 'net-firewall/ipt_netflow')
-rw-r--r--net-firewall/ipt_netflow/Manifest2
-rw-r--r--net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.15.patch26
-rw-r--r--net-firewall/ipt_netflow/ipt_netflow-2.2-r3.ebuild102
3 files changed, 130 insertions, 0 deletions
diff --git a/net-firewall/ipt_netflow/Manifest b/net-firewall/ipt_netflow/Manifest
index bd1f5540cb72..1beb14904cb2 100644
--- a/net-firewall/ipt_netflow/Manifest
+++ b/net-firewall/ipt_netflow/Manifest
@@ -1,7 +1,9 @@
AUX ipt_netflow-2.0-configure.patch 276 BLAKE2B a7c4d51d9c0f5d6d60200cebc74dc022cbc117fb2916792661166d04e456e6f23e8f285c0ab6b713ccfd764ccac0a3a8b41ad2d159c9270ea0480d5f2b1b2482 SHA512 cb7b1a690a69eb68ce57d1b216324de3114c01a6bc2ca7e29fece702be62a0f903e6946426c49a8fcd08295466524eb464127655a8742507f999a318319cd3d0
AUX ipt_netflow-2.2-linux-4.10.patch 4343 BLAKE2B 2145307709b008800fff28e15e60e6c404d66ed9651ce8c96bb85b05e1215cc6b52cb0d159a9775a08e209ec2fc45579334fcc52b6a5b4ce47e2c1807ddb2945 SHA512 077787f9bc8981064c4a9489487a0079877000f58d4ce789b7aaf7819cabacd1b12e4a527174662bd17c1303631282254e2215f06f02f08e41327a7dbbc13f13
AUX ipt_netflow-2.2-linux-4.13.patch 2403 BLAKE2B 4ec60fed8450e7e785fbe002c337c4b096ed8e70bff4fb2b28c4b49fb3100a3d1721a356c73a6dd5defdd8c3072785c8a2b7f977d422bb997107c503dada1e97 SHA512 38b2657a42607cd86f36089cb1c26b609d29f1c6aca75ed38000baa69a58b75568ee7194e5d1692004c59ad8087fc4cb183ee61ed34ab52e557a3f0a330d2b6a
+AUX ipt_netflow-2.2-linux-4.15.patch 753 BLAKE2B e8cd5b34e14f4d29d4d5cba41166b58867204c8f32720fa74bdeb517e4d74c32c8d22d56d13eadaf01aad76fdebf8764d336b4c98a27dc47e02b07b0cad46d57 SHA512 28b037e7026e46d908d6e608bcc16894741e34d861128f919fa6cd797f93a7a249b560ac8b2c55a70c81a73716c9775f05cbea2b25ca857f3603d7284de30a48
AUX ipt_netflow-2.2-linux-4.6.patch 2098 BLAKE2B c35035e789ca4c03ff2d7479d9d0243aceb405bcc37f46960416505ea8e7d791b384178476aed9c561a39071cd9b83062fca1a1a5562abce05e3a36774ed7037 SHA512 319b1a013e8d32854ecfbc207aa7197e2ef39bc2688ece952814d3092e9110aa3cf134c56f3b9f671c7856465814905a4d1f888f8dab3b40f0be09202c6f1a64
DIST ipt-netflow-2.2.tgz 96697 BLAKE2B 996ad539b6a6a5198a1e4a4a1a51f0610d97fb45740ad9c92e19854f2928eb697ca8fe14625054a05b106eebc345dfe6c235cdf375d1360ef44ff6cf0b03f34a SHA512 a406ab9bd18616414d8c99f427382a075bdb8000d8c40959f5b6d6e577d7eb4dfc7f8b773664a516ec2228d15590f21c3fbd6aa3d4302f6cdf03810e1702af74
EBUILD ipt_netflow-2.2-r2.ebuild 2509 BLAKE2B 5d37d7c10860f00924bbba2170cbf8032baa62b0f37e9ffadf9f6659fd1289ee00c580fc1f8e5ba1f870ae762ea07cdb363758d9ab296e26c32fd0abd5300466 SHA512 aeb6ac81634dd1eb1fd2d32f9800531364356207316253e42d6102548623665816faabbf6007c59f1f143119d83764dff489e27111e4065d6dba2d0e5cb45837
+EBUILD ipt_netflow-2.2-r3.ebuild 2571 BLAKE2B 2dc3b03d3c04761f350abe999a8e273c21e086ac9d0836f1c7fe3a25e3bb12e56aabb158d37dc51843a36001a7a131dc0907b94db8aae916c324702fae7878a1 SHA512 91854ca0d6bcee83df110f9c6237484fa31d8a6e794bd23667afd7902033ca48a375091f9b5c76279a5881b25421737a60d76a8e58eab59a3d382c7c1b61ffd0
MISC metadata.xml 561 BLAKE2B 8b2d48273d5c27a1996089236e3981c7eff8546e73671136baa8a9ed0c18fb26a56be261b3162e4563878bf54487a0b26e389861a9dbc80af35783491564c7d3 SHA512 6cd4feab99315acfcf34f34fccd9ecb6b00b23efecef622cc638902a4ec62240f3d9f87d1f349a84ec7c4985a90f8632ffcfa9f403b42c26ce9d923ca9e01bc5
diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.15.patch b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.15.patch
new file mode 100644
index 000000000000..aa5feef3279f
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.15.patch
@@ -0,0 +1,26 @@
+--- a/ipt_NETFLOW.c
++++ b/ipt_NETFLOW.c
+@@ -4357,7 +4357,11 @@
+ #define CALC_RATE(ewma, cur, minutes) ewma += _A(cur - ewma, minutes)
+
+ // calculate EWMA throughput rate for whole module
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++static void rate_timer_calc(struct timer_list *t)
++#else
+ static void rate_timer_calc(unsigned long dummy)
++#endif
+ {
+ static u64 old_pkt_total = 0;
+ static u64 old_traf_total = 0;
+@@ -5525,7 +5525,11 @@
+
+ netflow_switch_version(protocol);
+ _schedule_scan_worker(0);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++ timer_setup(&rate_timer, rate_timer_calc, 0);
++#else
+ setup_timer(&rate_timer, rate_timer_calc, 0);
++#endif
+ mod_timer(&rate_timer, jiffies + (HZ * SAMPLERATE));
+
+ peakflows_at = jiffies;
diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.2-r3.ebuild b/net-firewall/ipt_netflow/ipt_netflow-2.2-r3.ebuild
new file mode 100644
index 000000000000..b2bda0e58894
--- /dev/null
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.2-r3.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MY_PN="${PN/_/-}"
+MY_P="${MY_PN}-${PV}"
+inherit linux-info linux-mod toolchain-funcs
+
+DESCRIPTION="Netflow iptables module"
+HOMEPAGE="https://sourceforge.net/projects/ipt-netflow"
+SRC_URI="mirror://sourceforge/${MY_PN}/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="debug natevents snmp"
+
+RDEPEND="
+ net-firewall/iptables
+ snmp? ( net-analyzer/net-snmp )
+"
+DEPEND="${RDEPEND}
+ virtual/linux-sources
+ virtual/pkgconfig
+"
+
+# set S before MODULE_NAMES
+S="${WORKDIR}/${MY_P}"
+PATCHES=(
+ # bug #455984
+ "${FILESDIR}/${PN}-2.0-configure.patch"
+ # Compatibility with kernel 4.6
+ "${FILESDIR}/${P}-linux-4.6.patch"
+ # Compatibility with kernel 4.10, bug #617484
+ "${FILESDIR}/${P}-linux-4.10.patch"
+ # Compatibility with kernel 4.13, bug #630446
+ "${FILESDIR}/${P}-linux-4.13.patch"
+ # Compatibility with kernel 4.15, bug #646798
+ "${FILESDIR}/${P}-linux-4.15.patch"
+)
+
+pkg_setup() {
+ BUILD_TARGETS="all"
+ MODULE_NAMES="ipt_NETFLOW(ipt_netflow:${S})"
+ IPT_LIB="/usr/$(get_libdir)/xtables"
+ local CONFIG_CHECK="~IP_NF_IPTABLES"
+ use debug && CONFIG_CHECK+=" ~DEBUG_FS"
+ use natevents && CONFIG_CHECK+=" NF_CONNTRACK_EVENTS NF_NAT_NEEDED"
+ linux-mod_pkg_setup
+}
+
+src_prepare() {
+ sed -i \
+ -e 's:make -C:$(MAKE) -C:g' \
+ -e 's:gcc -O2:$(CC) $(CFLAGS) $(LDFLAGS):' \
+ -e 's:gcc:$(CC) $(CFLAGS) $(LDFLAGS):' \
+ Makefile.in || die
+
+ # Checking for directory is enough
+ sed -i -e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' configure || die
+
+ default
+}
+
+do_conf() {
+ echo ./configure $*
+ ./configure $* ${EXTRA_ECONF} || die 'configure failed'
+}
+
+src_configure() {
+ local IPT_VERSION="$($(tc-getPKG_CONFIG) --modversion xtables)"
+ # this configure script is not based on autotools
+ # ipt-src need to be defined, see bug #455984
+ do_conf \
+ --disable-dkms \
+ --enable-aggregation \
+ --enable-direction \
+ --enable-macaddress \
+ --enable-vlan \
+ --ipt-lib="${IPT_LIB}" \
+ --ipt-src="/usr/" \
+ --ipt-ver="${IPT_VERSION}" \
+ --kdir="${KV_DIR}" \
+ --kver="${KV_FULL}" \
+ $(use debug && echo '--enable-debugfs') \
+ $(use natevents && echo '--enable-natevents') \
+ $(use snmp && echo '--enable-snmp-rules' || echo '--disable-snmp-agent')
+}
+
+src_compile() {
+ emake ARCH="$(tc-arch-kernel)" CC="$(tc-getCC)" all
+}
+
+src_install() {
+ linux-mod_src_install
+ exeinto "${IPT_LIB}"
+ doexe libipt_NETFLOW.so
+ use snmp && emake DESTDIR="${D}" SNMPTGSO="/usr/$(get_libdir)/snmp/dlmod/snmp_NETFLOW.so" sinstall
+ doheader ipt_NETFLOW.h
+ dodoc README*
+}