summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-analyzer/fprobe
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-analyzer/fprobe')
-rw-r--r--net-analyzer/fprobe/Manifest1
-rw-r--r--net-analyzer/fprobe/files/conf.d-fprobe71
-rw-r--r--net-analyzer/fprobe/files/fprobe-1.1-pidfile-sanity.patch47
-rw-r--r--net-analyzer/fprobe/files/fprobe-1.1-setgroups.patch18
-rw-r--r--net-analyzer/fprobe/files/init.d-fprobe41
-rw-r--r--net-analyzer/fprobe/fprobe-1.1-r2.ebuild44
-rw-r--r--net-analyzer/fprobe/fprobe-1.1.ebuild32
-rw-r--r--net-analyzer/fprobe/metadata.xml11
8 files changed, 265 insertions, 0 deletions
diff --git a/net-analyzer/fprobe/Manifest b/net-analyzer/fprobe/Manifest
new file mode 100644
index 00000000000..d801e3fdf95
--- /dev/null
+++ b/net-analyzer/fprobe/Manifest
@@ -0,0 +1 @@
+DIST fprobe-1.1.tar.bz2 104358 SHA256 3a1cedf5e7b0d36c648aa90914fa71a158c6743ecf74a38f4850afbac57d22a0 SHA512 35fa4bedf2c615093b6637630322115e12f005bc43186b86c55c6bdc76ae5308dd31e1d05632e26e07a30fba88d76b9acc98632bee4f372edcf9df5da3e32210 WHIRLPOOL 5069edf9a62d2da3d34192ad881d41e2d6c2fb7d10c6f70ebc717bde691cd926f73236319abec66847d9114c068c9ca7e5d00633a1eb05e8ae9f570a09cfda82
diff --git a/net-analyzer/fprobe/files/conf.d-fprobe b/net-analyzer/fprobe/files/conf.d-fprobe
new file mode 100644
index 00000000000..f73ccf4c580
--- /dev/null
+++ b/net-analyzer/fprobe/files/conf.d-fprobe
@@ -0,0 +1,71 @@
+# Config file for /etc/init.d/fprobe
+
+# Do we want the interface in promiscous mode [yes/no]
+#PROMISC=no
+
+# Interface
+IFACE=eth0
+
+# If configured, only capture packets matching this tcpdump expression
+#FILTER=""
+
+# Flow state timers
+#TIMER_EXPIRED=5
+#TIMER_FRAGMENTED=30
+#TIMER_IDLE=60
+#TIMER_ACTIVE=300
+
+# This is the default and should be left unless you know what you are doing
+#FLOW_VER=5
+
+# local ip. if configured fprobe will use this as the source IP for sending ALL flow data
+# If you want to specify a specific source address per collecter, customize it below
+#LOCALIP=
+
+# SNMP iface id
+SNMP_IFACE="${IFACE//eth}"
+
+# Maximum number of concurrent flows to track
+# using a specified amount of memory
+#MEMBULK=10000
+#MEMLIMIT=
+
+# Pending queue
+#PENDING=100
+
+# Kernel capture buffer size (kB)
+#KERNBUF=1024
+
+# Realtime priority [0=disabled, 1..99]
+#RTPRIO=0
+
+# Delay N nanoseconds after each B bytes
+#DELAY="0:0"
+
+# How much of the start of each packet to grab
+#SNAPLEN=256
+
+# chroot() to this location after startup
+CHROOT="/var/empty"
+
+# User to run as. must have perms to the pidfile directory /var/run/fprobe/
+USER=nobody
+
+# logging level for syslog (0=EMERG, ..., 6=INFO, 7=DEBUG)
+#LOGLEVEL=6
+
+# If you want to run multiple instances of fprobe,
+# You MUST set this variable to a unique INTEGER for each one!
+PIDFILE_ID=''
+
+# remote ip. this is where we send flows
+REMOTEIP=127.0.0.1
+# port to listen on
+PORT=2055
+# Collector type, see the manpage for valid types
+TYPE=''
+
+# If you want multiple collectors, just specify each one here
+COLLECTORS="${REMOTEIP}:${PORT}/${LOCALIP}/${TYPE}"
+
+# vim:ft=gentoo-conf-d:
diff --git a/net-analyzer/fprobe/files/fprobe-1.1-pidfile-sanity.patch b/net-analyzer/fprobe/files/fprobe-1.1-pidfile-sanity.patch
new file mode 100644
index 00000000000..c58c2a97c00
--- /dev/null
+++ b/net-analyzer/fprobe/files/fprobe-1.1-pidfile-sanity.patch
@@ -0,0 +1,47 @@
+If we are using the chroot() option or the setuid options, we must create the
+pidfile before doing the chroot OR the setreuid. It's actually best for
+start-stop-daemon if we create the pidfile from the master side of the fork()
+before it exits, since most of the startup checks happen after the chroot()
+unfortunetly.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+--- a/src/fprobe.c
++++ b/src/fprobe.c
+@@ -1379,7 +1379,8 @@
+
+ my_log_open(ident, verbosity, log_dest);
+ if (!(log_dest & 2)) {
+- switch (fork()) {
++ pid_t childpid = fork();
++ switch (childpid) {
+ case -1:
+ fprintf(stderr, "fork(): %s", strerror(errno));
+ exit(1);
+@@ -1392,6 +1393,12 @@
+ break;
+
+ default:
++ if (!(pidfile = fopen(pidfilepath, "w")))
++ my_log(LOG_ERR, "Can't create pid file. fopen(): %s", strerror(errno));
++ else {
++ fprintf(pidfile, "%ld\n", (long) childpid);
++ fclose(pidfile);
++ }
+ exit(0);
+ }
+ } else {
+@@ -1548,13 +1555,6 @@
+ }
+ }
+
+- if (!(pidfile = fopen(pidfilepath, "w")))
+- my_log(LOG_ERR, "Can't create pid file. fopen(): %s", strerror(errno));
+- else {
+- fprintf(pidfile, "%ld\n", (long) pid);
+- fclose(pidfile);
+- }
+-
+ my_log(LOG_INFO, "pid: %d", pid);
+ my_log(LOG_INFO, "interface: %s, datalink: %s (%d)",
+ dev, dlt[link_type_idx].descr, link_type);
diff --git a/net-analyzer/fprobe/files/fprobe-1.1-setgroups.patch b/net-analyzer/fprobe/files/fprobe-1.1-setgroups.patch
new file mode 100644
index 00000000000..803a2a9ce43
--- /dev/null
+++ b/net-analyzer/fprobe/files/fprobe-1.1-setgroups.patch
@@ -0,0 +1,18 @@
+This seems to fail after the chroot(), so just squelch the exit for now.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+--- a/src/fprobe.c
++++ b/src/fprobe.c
+@@ -1541,10 +1541,10 @@
+ }
+
+ if (pw) {
+ if (setgroups(0, NULL) < 0) {
+ my_log(LOG_CRIT, "setgroups: %s", strerror(errno));
+- exit(1);
++ //exit(1);
+ }
+ if (setregid(pw->pw_gid, pw->pw_gid)) {
+ my_log(LOG_CRIT, "setregid(%u): %s", pw->pw_gid, strerror(errno));
+ exit(1);
diff --git a/net-analyzer/fprobe/files/init.d-fprobe b/net-analyzer/fprobe/files/init.d-fprobe
new file mode 100644
index 00000000000..3239b0f33df
--- /dev/null
+++ b/net-analyzer/fprobe/files/init.d-fprobe
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+BIN=/usr/sbin/fprobe
+PIDFILE_EXTRA=""
+[ -n "$PIDFILE_ID" ] && PIDFILE_EXTRA="[$PIDFILE_ID]"
+PIDFILE="/var/run/fprobe$PIDFILE_EXTRA.pid"
+
+start() {
+ ebegin "Starting fprobe"
+ local OPTS=""
+ [ "${PROMISC}" == "yes" ] || OPTS="${OPTS} -p"
+ [ -n "${FILTER}" ] && OPTS="${OPTS} -f '${FILTER}'"
+ for optname in i:IFACE s:TIMER_EXPIRED g:TIME_FRAGMENTED d:TIMER_IDLE \
+ e:TIMER_ACTIVE n:FLOW_VER a:LOCALIP x:SNMP_IFACE b:MEMBULK \
+ m:MEMLIMIT q:PENDING B:KERNBUF r:RTPRIO t:DELAY S:SNAPLEN \
+ c:CHROOT u:USER v:LOGLEVEL ; do
+ opt="${optname/:*}" optvar="${optname/*:}"
+ optvalue="${!optvar}"
+ [ -n "$optvalue" ] && OPTS="${OPTS} -${opt} ${optvalue}"
+ done
+ OPTS="${OPTS} -l 1:${PIDFILE_ID} ${COLLECTORS}"
+ start-stop-daemon --start --exec $BIN \
+ --pidfile ${PIDFILE} \
+ -- ${OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping fprobe"
+ start-stop-daemon --stop --quiet --exec $BIN \
+ --pidfile ${PIDFILE}
+ eend $?
+}
+
+# vim:ft=gentoo-init-d:
diff --git a/net-analyzer/fprobe/fprobe-1.1-r2.ebuild b/net-analyzer/fprobe/fprobe-1.1-r2.ebuild
new file mode 100644
index 00000000000..ba10e41b4a7
--- /dev/null
+++ b/net-analyzer/fprobe/fprobe-1.1-r2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="A libpcap-based tool to collect network traffic data and emit it as NetFlow flows"
+HOMEPAGE="http://fprobe.sourceforge.net"
+LICENSE="GPL-2"
+
+SRC_URI="mirror://sourceforge/fprobe/${P}.tar.bz2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+IUSE="debug messages"
+
+DEPEND="net-libs/libpcap"
+
+src_prepare() {
+ # The pidfile should be created by the parent process, before the
+ # setuid/chroot is executed.
+ epatch "${FILESDIR}"/fprobe-1.1-pidfile-sanity.patch
+ # This seems to fail, uncertain why.
+ epatch "${FILESDIR}"/fprobe-1.1-setgroups.patch
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug) \
+ $(use_enable messages)
+}
+
+DOCS=( AUTHORS NEWS README TODO )
+
+src_install() {
+ default
+
+ docinto contrib
+ dodoc contrib/tg.sh
+
+ newinitd "${FILESDIR}"/init.d-fprobe fprobe
+ newconfd "${FILESDIR}"/conf.d-fprobe fprobe
+}
diff --git a/net-analyzer/fprobe/fprobe-1.1.ebuild b/net-analyzer/fprobe/fprobe-1.1.ebuild
new file mode 100644
index 00000000000..91525958ede
--- /dev/null
+++ b/net-analyzer/fprobe/fprobe-1.1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="A libpcap-based tool to collect network traffic data and emit it as NetFlow flows"
+HOMEPAGE="http://fprobe.sourceforge.net"
+LICENSE="GPL-2"
+
+SRC_URI="mirror://sourceforge/fprobe/${P}.tar.bz2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc x86"
+
+IUSE="debug messages"
+
+DEPEND="net-libs/libpcap"
+
+src_compile() {
+ local myconf
+ myconf="`use_enable debug`
+ `use_enable messages`"
+
+ econf ${myconf} || die "configure failed"
+
+ emake || die "make failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "install failed"
+
+ dodoc AUTHORS NEWS README TODO
+ docinto contrib ; dodoc contrib/tg.sh
+}
diff --git a/net-analyzer/fprobe/metadata.xml b/net-analyzer/fprobe/metadata.xml
new file mode 100644
index 00000000000..8cbeac76773
--- /dev/null
+++ b/net-analyzer/fprobe/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>netmon</herd>
+ <use>
+ <flag name="messages">enable console messages</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">fprobe</remote-id>
+ </upstream>
+</pkgmetadata>