summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/ndsad')
-rw-r--r--net-analyzer/ndsad/Manifest1
-rw-r--r--net-analyzer/ndsad/files/ndsad-1.33-conf_path.patch11
-rw-r--r--net-analyzer/ndsad/files/ndsad-1.33-gentoo.patch23
-rw-r--r--net-analyzer/ndsad/files/ndsad-1.33-getpid.patch10
-rw-r--r--net-analyzer/ndsad/files/ndsad-1.33-log-path.patch11
-rw-r--r--net-analyzer/ndsad/files/ndsad-1.33-strncpy-overflow.patch12
-rw-r--r--net-analyzer/ndsad/files/ndsad.conf.d9
-rw-r--r--net-analyzer/ndsad/files/ndsad.init33
-rw-r--r--net-analyzer/ndsad/metadata.xml22
-rw-r--r--net-analyzer/ndsad/ndsad-1.33-r1.ebuild46
10 files changed, 178 insertions, 0 deletions
diff --git a/net-analyzer/ndsad/Manifest b/net-analyzer/ndsad/Manifest
new file mode 100644
index 000000000000..23e397dfa101
--- /dev/null
+++ b/net-analyzer/ndsad/Manifest
@@ -0,0 +1 @@
+DIST ndsad-1.33.tgz 214614 SHA256 a46403ff15c03b45b479832f5e6d861ec4d6474ef953f7965ae0239c90b9026b SHA512 38ebca91f28d763ce334d92361779f100ee6b98d6d17485bf096f913f777e8525add63bd73aeea43321cee622e10cb88020aca7af492fbafdd50cf740510bd51 WHIRLPOOL e5e202eab7fc16120f1a56d7691fbdb36c4a9af65cc4ec5fd9d39f0d515937ef29fccd6c08d948ddfaf30552dc0b7af63a395f731704c3fa79d7bbf935b81ba8
diff --git a/net-analyzer/ndsad/files/ndsad-1.33-conf_path.patch b/net-analyzer/ndsad/files/ndsad-1.33-conf_path.patch
new file mode 100644
index 000000000000..cf3c827cdde7
--- /dev/null
+++ b/net-analyzer/ndsad/files/ndsad-1.33-conf_path.patch
@@ -0,0 +1,11 @@
+--- a/ndsad.cc
++++ b/ndsad.cc
+@@ -12,7 +12,7 @@
+ */
+
+
+-#define conf_path "/netup/utm5/ndsad.cfg"
++#define conf_path "/etc/ndsad.conf"
+
+ #include "pcap.local.h"
+
diff --git a/net-analyzer/ndsad/files/ndsad-1.33-gentoo.patch b/net-analyzer/ndsad/files/ndsad-1.33-gentoo.patch
new file mode 100644
index 000000000000..3ccbe3432932
--- /dev/null
+++ b/net-analyzer/ndsad/files/ndsad-1.33-gentoo.patch
@@ -0,0 +1,23 @@
+--- a/configure.in
++++ b/configure.in
+@@ -24,9 +24,6 @@
+ AC_DEFINE(OS_BSD, 2,[BSD OS code])
+ AC_DEFINE(OS_SOLARIS, 3,[SOLARIS on SPARC code])
+
+-CFLAGS=-g
+-CXXFLAGS=-g
+-
+ AC_CHECK_LIB(pcap, pcap_loop, [LIBS="$LIBS -lpcap"; __ac_have_libpcap=1;], [ break ])
+
+ case "$host_os" in
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,6 +1,6 @@
+-bin_PROGRAMS = ndsad
++sbin_PROGRAMS = ndsad
+
+ ndsad_SOURCES = linux_ulog.cc linux_ulog.h debug.h eth-hndl.h handlers.h iflist.h iptonf.h ldefs.h logger.h mempool.h nethdr.h nfc.h nf.h ppp-hndl.h thr.h config.cc debug.cc eth-hndl.cc handlers.cc iflist.cc iptonf.cc logger.cc mempool.cc ndsad.cc nf.cc nfc.cc ppp-hndl.cc thr.cc bsd_divert.cc bsd_divert.h
+
+-ndsad_CXXFLAGS = $(AM_CXXFLAGS) -O0 -fno-inline -g -ftemplate-depth-32
++ndsad_CXXFLAGS = $(AM_CXXFLAGS) -fno-inline -ftemplate-depth-32
+ ndsad_LDFLAGS = $(AM_LDFLAGS)
diff --git a/net-analyzer/ndsad/files/ndsad-1.33-getpid.patch b/net-analyzer/ndsad/files/ndsad-1.33-getpid.patch
new file mode 100644
index 000000000000..c0e6d94a301c
--- /dev/null
+++ b/net-analyzer/ndsad/files/ndsad-1.33-getpid.patch
@@ -0,0 +1,10 @@
+--- a/linux_ulog.h
++++ b/linux_ulog.h
+@@ -8,6 +8,7 @@
+ #include <pthread.h>
+ #include <iostream>
+ #include <sys/types.h>
++#include <unistd.h> /* getpid() */
+ #include <sys/socket.h>
+
+ /// linux specific headers!
diff --git a/net-analyzer/ndsad/files/ndsad-1.33-log-path.patch b/net-analyzer/ndsad/files/ndsad-1.33-log-path.patch
new file mode 100644
index 000000000000..fbeab07fb7a0
--- /dev/null
+++ b/net-analyzer/ndsad/files/ndsad-1.33-log-path.patch
@@ -0,0 +1,11 @@
+--- a/ndsad.conf
++++ b/ndsad.conf
+@@ -75,7 +75,7 @@
+ # Default:
+ #log (null)
+ # Example:
+-log /tmp/ndsad.log
++log /var/log/ndsad.log
+
+ # Jump to another configuration file
+ # Current file is closed after this line! Beware of loops!
diff --git a/net-analyzer/ndsad/files/ndsad-1.33-strncpy-overflow.patch b/net-analyzer/ndsad/files/ndsad-1.33-strncpy-overflow.patch
new file mode 100644
index 000000000000..5078f1555ec6
--- /dev/null
+++ b/net-analyzer/ndsad/files/ndsad-1.33-strncpy-overflow.patch
@@ -0,0 +1,12 @@
+--- a/handlers.h
++++ b/handlers.h
+@@ -30,7 +30,8 @@
+ #ifdef WIN32
+ #define IFN_SIZE 512 // on windows iface names are VEERY long
+ #else
+-#define IFN_SIZE 32 // iface name size. As in linux/sockios.h
++#include <net/if.h>
++#define IFN_SIZE IFNAMSIZ // iface name size. As in linux/sockios.h
+ #endif
+
+ #define MPH_IFLIST 0x2 // iface type - for mempool
diff --git a/net-analyzer/ndsad/files/ndsad.conf.d b/net-analyzer/ndsad/files/ndsad.conf.d
new file mode 100644
index 000000000000..2f843f84ed3d
--- /dev/null
+++ b/net-analyzer/ndsad/files/ndsad.conf.d
@@ -0,0 +1,9 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See config file /etc/ndsad.conf for configuration options.
+
+# If you want to add any extra command line options to be used by ndsad on
+# start-up put them here.
+NDSAD_OPTS=""
diff --git a/net-analyzer/ndsad/files/ndsad.init b/net-analyzer/ndsad/files/ndsad.init
new file mode 100644
index 000000000000..8221abdda9a7
--- /dev/null
+++ b/net-analyzer/ndsad/files/ndsad.init
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -f /etc/ndsad.conf ] ; then
+ eerror "/etc/ndsad.conf does not file exists!"
+ return 1
+ fi
+
+ return 0
+}
+
+start() {
+ # Comment out the following line to get faster startups
+ checkconfig || return 1
+
+ ebegin "Starting ndsad"
+ # On success ndsad returns 1.
+ start-stop-daemon --start --quiet --exec /usr/sbin/ndsad -- -d ${NDSAD_OPTS} >/dev/null 2>&1
+ eend $(( $? - 1 ))
+}
+
+stop () {
+ ebegin "Stopping ndsad"
+ start-stop-daemon --stop --quiet --pidfile=/run/ndsad.pid --retry 20 >/dev/null
+ eend $?
+}
diff --git a/net-analyzer/ndsad/metadata.xml b/net-analyzer/ndsad/metadata.xml
new file mode 100644
index 000000000000..251ca58e234d
--- /dev/null
+++ b/net-analyzer/ndsad/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>netmon</herd>
+ <longdescription lang="en">
+ The NetUP ndsad (NetUp Data Stream Accounting Daemon) utility captures
+ IP-traffic from network interfaces and export NetFlow v.5. Data is
+ gathered from libpcap library on Unix and from winpcap on Windows. Also
+ you are able to use tee/divert sockets on FreeBSD and ULOG on Linux for
+ data source.
+ </longdescription>
+ <longdescription lang="ru">
+ Демон ndsad (NetUp Data Stream Accounting Daemon) компании Нетап
+ захватывает сетевой трафик с сетевых интерфейсов и экспортирует его в
+ NetFlow v.5. Трафик собирается при помощи библиотеки libpcap в Unix или
+ winpcap в Windows. В качестве источника данных вы также можете
+ использовать tee/divert сокеты в FreeBSD и ULOG в Linux.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">ndsad</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-analyzer/ndsad/ndsad-1.33-r1.ebuild b/net-analyzer/ndsad/ndsad-1.33-r1.ebuild
new file mode 100644
index 000000000000..3b8e21aeb43c
--- /dev/null
+++ b/net-analyzer/ndsad/ndsad-1.33-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils
+
+DESCRIPTION="Cisco netflow probe from libpcap, ULOG, tee/divert sources"
+HOMEPAGE="http://sourceforge.net/projects/ndsad"
+SRC_URI="mirror://sourceforge/ndsad/ndsad-${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86"
+
+DEPEND=">=net-libs/libpcap-0.8"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-conf_path.patch \
+ "${FILESDIR}"/${P}-gentoo.patch \
+ "${FILESDIR}"/${P}-getpid.patch \
+ "${FILESDIR}"/${P}-log-path.patch \
+ "${FILESDIR}"/${P}-strncpy-overflow.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-ulog=yes
+}
+
+DOCS=( ChangeLog AUTHORS README )
+
+src_install() {
+ default
+
+ doman ndsad.conf.5
+
+ insinto /etc
+ newins ndsad.conf ndsad.conf
+
+ newinitd "${FILESDIR}"/ndsad.init ndsad
+ newconfd "${FILESDIR}"/ndsad.conf.d ndsad
+}