summaryrefslogtreecommitdiffstats
path: root/net-analyzer/netams
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/netams')
-rw-r--r--net-analyzer/netams/Manifest9
-rw-r--r--net-analyzer/netams/files/netams-3.4.5-ds-compile.patch24
-rw-r--r--net-analyzer/netams/files/netams-ds-compile.patch24
-rw-r--r--net-analyzer/netams/files/netams-ds-portrange.patch96
-rw-r--r--net-analyzer/netams/files/netams.init32
-rw-r--r--net-analyzer/netams/files/netams33.init25
-rw-r--r--net-analyzer/netams/netams-3.3.5.ebuild38
-rw-r--r--net-analyzer/netams/netams-3.4.5.ebuild41
8 files changed, 289 insertions, 0 deletions
diff --git a/net-analyzer/netams/Manifest b/net-analyzer/netams/Manifest
new file mode 100644
index 0000000..14f06d1
--- /dev/null
+++ b/net-analyzer/netams/Manifest
@@ -0,0 +1,9 @@
+AUX netams-3.4.5-ds-compile.patch 951 SHA256 63af9b2264ef0ee8e23519ec13bd11bf98e07993275c733198bd55fd6eb7c4e2 SHA512 3418b6f333733a27a9507f9d6c3d6060d3054b90dd65dc5f93c0da37e528f88f3509aaf454c3530e6981c6bd0909b76439338353fc0c5c0e949c67f7f7333199 WHIRLPOOL ec75943c7d28ef39eb47ab27f456b93f537622828837176d5f13360369e6474e135e5eb44bd8da6d2b3f002c7c8dfcbc18fc4e06fe97235f79f7c37bb823d5d0
+AUX netams-ds-compile.patch 937 SHA256 516a8245f6c1e8371acae52a3dfcd5e6132d70547e5bc9423df367afe22a1903 SHA512 2b532d7be5eee4ea20e2aa70e7a24f8f20add3e7f62c94e0c413ecfcabc073d983928ac719a7bdcc7de3349618fb0ea4f53fd72b692ea400174063e3434e159f WHIRLPOOL 762b0b82d2c6331e8ca052eae09d80f0e36d40479cf89c73ca0a802856283194f17e705dede9250ee1b15db0c574ee03d2fb7acd40ffddcfb2663a4a2dc6cee9
+AUX netams-ds-portrange.patch 2940 SHA256 ac08e4722c5e910941692b0cacfbf5cdaf1dea818649eeeed0b4d4c63f88f016 SHA512 c4ec7d70e9baf0ec38c87384493367e95c82aa9059cfcffd403d4fd080b0ebbe850bfeec13e03e6d6633c85a2a5f9f86c9886c22316c02352b9faa93e76a9748 WHIRLPOOL a828bc0a4d1669dd4e33b800429d413670d26582ac718d0c61220c4f28b7a5abf50a0436b2b73f6f1c29a3327bf83f5853d7892101b5f3fac5604bc5d49009ed
+AUX netams.init 600 SHA256 50cc8a2d619d39a09b23d6ae271238a8a1d9dd6a9ab752bc9ac8938ede83d1a4 SHA512 81962717fdf97ef0a9b3cf75253ced71925571ba488895ff1e522e538620b1a72561e09347ffd98afb7ed3cbe387a007ba4044fb47a5b7db38e01839d5b09cce WHIRLPOOL 9fefe2ed704626ccbba80e0ec8ab88b06b1a6ce162961ebdee523f74447f36ee7378e0b1c7304025fa2a9d11f5c12d0e56d5f3d40ac43383a4d6a5e699a0e430
+AUX netams33.init 596 SHA256 a68ec05accc1ffce44272eac220f83e76cbefc4cbdaa78262484f8cf5567ddd7 SHA512 d138eef9fdcdcfc8e367bea8b111044a20e051e776f4c430b5af21be1a716a6a582ff7204e3372cef337d7915a5190e36361ed2f681fb28cf6368f425baf5e9e WHIRLPOOL 2b77bbcb17af3f0a24ee9e7a85b75b0f3cfc97d168aa40cae2c4ce3cff2150ede7fbc2863ea0874e807d29265892cea29007d15dd32082b9b6af94950c44ce4b
+DIST netams-3.3.5.tar.gz 338686 SHA256 fedb4fd3463a87c5a70e2126b9c7d3fc5fe02bccb16977b241f0a38c4055b702 SHA512 a8f47b8251f039312a295028bd7b0c4a0325a1a7a7c9112f8a41b1f848b96587eac617fe8dee78af6d58493f02a4a1f2456cd48463c2ef3672f803df1688d389 WHIRLPOOL 0d27e34138251f829ae9da092d82e8353cceeb6741faa5a83e5ddf8302dd6ceeecaf94a8d277fd5a8c4e250934b03830f8f40534bae64ceecab21bfdb09f84fe
+DIST netams-3.4.5.tar.gz 408868 SHA256 dc6522cc6cf14bfb29f38f09e5513bfe4dce275c0fce9f55ec8706cd300908b1 SHA512 e139f0bafd708c3cf150add6ea456d4a4a43af14eae3cfe3045c5c3dd7dbb5238b73399735f9c7c7f2726a7b7911696c860a0a8833e70868f3a0c685ee1be936 WHIRLPOOL 52e9a51a3f6a3773ae709853a2c92eae881b1ba045186e5cb9544ddcdc4878e56a9b2deb3a92d9ef6e897297eea898eda5d329253c5de348fa6c2f681eccf18d
+EBUILD netams-3.3.5.ebuild 1058 SHA256 b1379163bb8bf7f9af7039b627cf1754d56e8fa7fe51f3d0c5f89ba1b8b26c83 SHA512 9bbde7c190ffe327c8ba6714906b92ba2f627ba5a248a3a7b1484a5b1b4acb6a95856f71c5f9fb13ad85bb62f2add321572fce4e0cb024c9aabc10b7db37591f WHIRLPOOL 260c808f554c1dec21af9fe64d4563cf1e7644af74535d3b7f2090fbd331d8b9da5a32d277c1001d437f600e42cfc780a33b72617c1d0b2a40956a59d6ade2a4
+EBUILD netams-3.4.5.ebuild 1381 SHA256 d08a21ec741feaccf75707e4daa4254b027f7ed776f71c569e14a7720aff5f23 SHA512 d1c6fbd340d28311664938849009040d468d2d7d99d9c797d557fec43f158107bf830ad22dc612ef0d501f731bb032e2628d68be3f629a5bde635151ac7ab5ee WHIRLPOOL 565c586d805afacace1ce1efd50372a21f53c5f2d0d4ede416c978d8b63e2d52fce259b259f7ac95513a980bb29d6bb3c247d9773bd76ab86fd02809e169870d
diff --git a/net-analyzer/netams/files/netams-3.4.5-ds-compile.patch b/net-analyzer/netams/files/netams-3.4.5-ds-compile.patch
new file mode 100644
index 0000000..46c4de7
--- /dev/null
+++ b/net-analyzer/netams/files/netams-3.4.5-ds-compile.patch
@@ -0,0 +1,24 @@
+diff -dPNur netams-3.4.5-orig/configure.sh netams-3.4.5/configure.sh
+--- netams-3.4.5-orig/configure.sh 2009-09-06 16:44:54.000000000 +0000
++++ netams-3.4.5/configure.sh 2014-10-14 01:11:43.000000000 +0000
+@@ -259,7 +259,7 @@
+ echo "GLib 2.0 found disabling OpenSSL"
+ echo " [ $v1 $v2 $v3 ]"
+ echo "DEFINE += -DWIPE_OPENSSL -I$v2 -I$v3" >> $makefile
+- echo "LIB += -lglib-2.0 -L$v1" >> $makefile
++ echo "LIB += -lcrypt -lglib-2.0 -L$v1" >> $makefile
+ else
+ echo "LibC - enabling OpenSSL"
+ echo "LIB += -lcrypt" >> $makefile
+diff -dPNur netams-3.4.5-orig/src/config.h netams-3.4.5/src/config.h
+--- netams-3.4.5-orig/src/config.h 2009-08-01 09:23:55.000000000 +0000
++++ netams-3.4.5/src/config.h 2014-10-14 01:10:09.000000000 +0000
+@@ -49,7 +49,7 @@
+ #ifndef WIPE_OPENSSL
+ #include <openssl/lhash.h>
+ #else
+-#include <glib/ghash.h>
++#include <glib.h>
+ #endif
+
+ #define __FAVOR_BSD 1 //this is dirty hack -D_BSD_SOURCE should work but do not
diff --git a/net-analyzer/netams/files/netams-ds-compile.patch b/net-analyzer/netams/files/netams-ds-compile.patch
new file mode 100644
index 0000000..550bf81
--- /dev/null
+++ b/net-analyzer/netams/files/netams-ds-compile.patch
@@ -0,0 +1,24 @@
+diff -dPNur netams-3.3.3a/src/connections.c netams-3.3.3a-new/src/connections.c
+--- netams-3.3.3a/src/connections.c 2005-11-20 02:31:02.000000000 +0400
++++ netams-3.3.3a-new/src/connections.c 2006-04-10 03:37:34.000000000 +0500
+@@ -92,7 +92,7 @@
+ }
+
+ #ifdef LINUX
+-ssize_t conn_write(void *conn, const char *buf, unsigned i) {
++ssize_t conn_write(void *conn, const char *buf, size_t i) {
+ #else
+ int conn_write(void *conn, const char *buf, int i) {
+ #endif
+diff -dPNur netams-3.3.3a/src/connections.h netams-3.3.3a-new/src/connections.h
+--- netams-3.3.3a/src/connections.h 2005-03-02 14:39:30.000000000 +0400
++++ netams-3.3.3a-new/src/connections.h 2006-04-10 03:38:25.000000000 +0500
+@@ -13,7 +13,7 @@
+ #define CONN_FD_VIRT -1
+
+ #ifdef LINUX
+-ssize_t conn_write(void *conn, const char *buf, unsigned i);
++ssize_t conn_write(void *conn, const char *buf, size_t i);
+ #else
+ int conn_write(void *conn, const char *buf, int i);
+ #endif
diff --git a/net-analyzer/netams/files/netams-ds-portrange.patch b/net-analyzer/netams/files/netams-ds-portrange.patch
new file mode 100644
index 0000000..6154960
--- /dev/null
+++ b/net-analyzer/netams/files/netams-ds-portrange.patch
@@ -0,0 +1,96 @@
+diff -dPNur netams-3.2.3/src/policy.c netams-3.2.3-ranges/src/policy.c
+--- netams-3.2.3/src/policy.c 2005-02-24 11:58:13.000000000 +0100
++++ netams-3.2.3-ranges/src/policy.c 2005-07-25 23:52:32.000000000 +0200
+@@ -32,6 +32,8 @@
+ target.num_ports=0;
+ for (u_char i=0; i<PC_MAX_PORTS; i++)
+ target.src_ports[i]=target.dst_ports[i]=0;
++ for (u_char i=0; i<PC_MAX_PORTS; i++)
++ target.max_ports[i]=0;
+
+ target.num_addrs=0;
+ for (u_char i=0; i<PC_MAX_ADDRS; i++)
+@@ -171,6 +173,8 @@
+ target.check_type|=PC_IP_PORTS;
+ u_char j=0;
+ u_short ports;
++ u_short max_port;
++ char *maxptr;
+ char *ptr;
+
+ while (tgt[j+*i+1]!=empty && j<PC_MAX_PORTS) {
+@@ -179,9 +183,19 @@
+ else
+ ptr=tgt[j+*i+1];
+
++
++ maxptr = strchr(ptr,':');
++ if (!maxptr) maxptr = strchr(ptr,'-');
++
+ ports=strtol(ptr, NULL, 10);
+
+ if (!ports) break;
++
++ if (maxptr) {
++ max_port = strtol(maxptr+1, NULL, 10);
++ if (ports>max_port) max_port = 0;
++ } else max_port = 0;
++ target.max_ports[j] = htons(max_port);
+
+ switch (tgt[j+*i+1][0]) {
+ case 's':
+@@ -358,11 +372,26 @@
+ if(target.num_ports) sprintf(buf+strlen(buf), "ports ");
+ for (u_char i=0; i<target.num_ports; i++) {
+ if (target.src_ports[i]==target.dst_ports[i])
++ {
++ if (target.max_ports[i])
++ sprintf(buf+strlen(buf), "%u:%u ", ntohs(target.src_ports[i]), ntohs(target.max_ports[i]));
++ else
+ sprintf(buf+strlen(buf), "%u ", ntohs(target.src_ports[i]));
++ }
+ else if (target.src_ports[i])
++ {
++ if (target.max_ports[i])
++ sprintf(buf+strlen(buf), "s%u:%u ", ntohs(target.src_ports[i]), ntohs(target.max_ports[i]));
++ else
+ sprintf(buf+strlen(buf), "s%u ", ntohs(target.src_ports[i]));
++ }
+ else if (target.dst_ports[i])
++ {
++ if (target.max_ports[i])
++ sprintf(buf+strlen(buf), "d%u:%u ", ntohs(target.dst_ports[i]),ntohs(target.max_ports[i]));
++ else
+ sprintf(buf+strlen(buf), "d%u ", ntohs(target.dst_ports[i]));
++ }
+ }
+ }
+ if (target.check_type&PC_UNIT) {
+@@ -436,6 +465,15 @@
+ res=1;
+ break;
+ }
++
++ if (target.max_ports[i]) {
++ if (((target.src_ports[i])&&(ntohs(flow->srcport)>ntohs(target.src_ports[i]))&&(ntohs(flow->srcport)<=ntohs(target.max_ports[i])))||
++ ((target.dst_ports[i])&&(ntohs(flow->dstport)>ntohs(target.dst_ports[i]))&&(ntohs(flow->dstport)<=ntohs(target.max_ports[i])))) {
++ res=1;
++ break;
++ }
++ }
++
+ }
+ if(!res) return 0;
+ }
+diff -dPNur netams-3.2.3/src/policy.h netams-3.2.3-ranges/src/policy.h
+--- netams-3.2.3/src/policy.h 2005-01-17 15:13:21.000000000 +0100
++++ netams-3.2.3-ranges/src/policy.h 2005-07-25 23:30:40.000000000 +0200
+@@ -86,6 +86,8 @@
+ u_char num_ports;
+ u_short src_ports[PC_MAX_PORTS];
+ u_short dst_ports[PC_MAX_PORTS];
++
++ u_short max_ports[PC_MAX_PORTS];
+
+ //PC_IP_TOS
+ u_char ip_tos;
diff --git a/net-analyzer/netams/files/netams.init b/net-analyzer/netams/files/netams.init
new file mode 100644
index 0000000..c5aca06
--- /dev/null
+++ b/net-analyzer/netams/files/netams.init
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+depend() {
+ need net mysql
+}
+
+
+daemondir=/usr/local/sbin
+path_to_etc=/etc/
+
+
+start() {
+ ebegin "Starting netams"
+ /bin/mkdir -p /var/run/netams
+ if [ -x $daemondir/netams ]; then
+ if [ -f $path_to_etc/netams.cfg ]; then
+ $daemondir/netams -lf $path_to_etc/netams.cfg >/dev/null
+ eend $?
+ else
+ eend 1
+ fi
+ else
+ eend 1
+ fi
+}
+
+stop() {
+ killall ${KILL_OPTS} netams
+}
diff --git a/net-analyzer/netams/files/netams33.init b/net-analyzer/netams/files/netams33.init
new file mode 100644
index 0000000..a4b56ad
--- /dev/null
+++ b/net-analyzer/netams/files/netams33.init
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# $Id: netams-gentoo.sh,v 1.1 2005/06/07 20:20:37 anton Exp $
+# this is Linux Gentoo version
+
+start() {
+ ebegin "Starting NeTAMS"
+ if [ -f /etc/netams.cfg ]; then
+ start-stop-daemon --start --quiet --background \
+ --pid /var/run/netams.pid \
+ --exec /usr/sbin/netams -- -f /etc/netams.cfg -l
+ fi
+ eend $? "Failed to start NeTAMS"
+}
+
+stop() {
+ ebegin "Stopping netams"
+ start-stop-daemon --stop --quiet --pid /var/run/netams.pid --exec /usr/sbin/netams
+ eend $? "Failed to stop NeTAMS"
+}
+
+restart() {
+ svc_stop
+ sleep 3
+ svc_start
+}
diff --git a/net-analyzer/netams/netams-3.3.5.ebuild b/net-analyzer/netams/netams-3.3.5.ebuild
new file mode 100644
index 0000000..7460661
--- /dev/null
+++ b/net-analyzer/netams/netams-3.3.5.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+inherit eutils
+
+DESCRIPTION="NetAMS Traffic Accounting"
+SRC_URI="http://www.netams.com/files/netams-${PV}.tar.gz"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="x86 amd64"
+RDEPEND="dev-db/mysql net-libs/libpcap"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+# epatch ${FILESDIR}/netams-ds-compile.patch || die
+}
+
+src_compile() {
+ ./configure.sh || die
+ FLAGS=-DHAVE_BW make || die
+}
+
+src_install() {
+ into /usr
+ mkdir -p ${D}/usr/sbin
+ mkdir -p ${D}/etc/init.d
+ mkdir -p ${D}/usr/share/man/man8/
+
+ install -m 0755 ${FILESDIR}/netams33.init ${D}/etc/init.d/netams
+# install -m 0755 addon/netams-gentoo.sh ${D}/etc/init.d/netams
+ install -m 0755 src/flowprobe ${D}/usr/sbin/
+ install -m 0755 src/ipfw2netflow ${D}/usr/sbin/
+ install -m 0755 src/ulog2netflow ${D}/usr/sbin/
+ install -m 0755 src/netams ${D}/usr/sbin/
+ install -m 0755 src/netamsctl ${D}/usr/sbin/
+ install -m 0644 doc/*.8 ${D}/usr/share/man/man8/
+}
diff --git a/net-analyzer/netams/netams-3.4.5.ebuild b/net-analyzer/netams/netams-3.4.5.ebuild
new file mode 100644
index 0000000..8a195c5
--- /dev/null
+++ b/net-analyzer/netams/netams-3.4.5.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+inherit eutils
+
+DESCRIPTION="NetAMS Traffic Accounting"
+SRC_URI="http://www.netams.com/files/netams-${PV}.tar.gz"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="x86 amd64"
+RDEPEND="dev-db/mysql net-libs/libpcap net-libs/libnetfilter_queue"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ epatch ${FILESDIR}/netams-3.4.5-ds-compile.patch || die
+}
+
+src_compile() {
+ ./configure.sh || die
+ FLAGS=-DHAVE_BW make || die
+}
+
+src_install() {
+ into /usr
+ mkdir -p ${D}/usr/sbin
+ mkdir -p ${D}/etc/init.d
+ mkdir -p ${D}/usr/share/man/man8/
+ mkdir -p ${D}/var/www/localhost/htdocs/netams/images
+
+ install -m 0755 ${FILESDIR}/netams33.init ${D}/etc/init.d/netams || die
+# install -m 0755 addon/netams-gentoo.sh ${D}/etc/init.d/netams || die
+ install -m 0755 src/flowprobe ${D}/usr/sbin/ || die
+# install -m 0755 src/ipfw2netflow ${D}/usr/sbin/ || die
+# install -m 0755 src/ulog2netflow ${D}/usr/sbin/ || die
+ install -m 0755 src/netams ${D}/usr/sbin/ || die
+ install -m 0755 src/netamsctl ${D}/usr/sbin/ || die
+ install -m 0644 doc/*.8 ${D}/usr/share/man/man8/ || die
+ install -m 0644 addon/netams.js ${D}/var/www/localhost/htdocs/netams/ || die
+ install -m 0644 cgi-bin/images/* ${D}/var/www/localhost/htdocs/netams/images/ || die
+}