summaryrefslogtreecommitdiff
path: root/net-analyzer/fprobe
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/fprobe
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/fprobe')
-rw-r--r--net-analyzer/fprobe/Manifest10
-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-r3.ebuild43
-rw-r--r--net-analyzer/fprobe/fprobe-1.1.ebuild31
-rw-r--r--net-analyzer/fprobe/metadata.xml14
8 files changed, 275 insertions, 0 deletions
diff --git a/net-analyzer/fprobe/Manifest b/net-analyzer/fprobe/Manifest
new file mode 100644
index 000000000000..7495c024119d
--- /dev/null
+++ b/net-analyzer/fprobe/Manifest
@@ -0,0 +1,10 @@
+AUX conf.d-fprobe 1620 SHA256 d6c2c010afb8298a19e5817a04c25620d1860e5f93b79880adb1403f0c1197f4 SHA512 82bc02f7538b6fade9deb6fc01d788089bcd3fac30f718f63c8ad6565414f1adc95cf57336d2d8e11dfc4622bcae9c185c322390977204e7f78730c87c7cdf7c WHIRLPOOL c1a4c9ad7b65cb59280fe16b8dc2abb83ed14d403661b056928d16d3bcb7a66019ab76c0606d39be1bdc0c4c056b0b9b781473775440fb2a44236a84e69fdfd5
+AUX fprobe-1.1-pidfile-sanity.patch 1319 SHA256 22ebee8359c2a0d134cb4f8f6e4e28a880a4886b8618f4fff59583962fd271d6 SHA512 c33d4f0f14c5b5523ffddc8ad43cd11d6d21c96a18cfbca72551426ea1fcec4bfbc86af23a63732129ee6b905f44fb0d05f045d692eb2e1406c400a9d4994c49 WHIRLPOOL 161ff246d1d4f7679ffbadbbdaec94f1726f66232584eb374c10e18e40002bcda2445726856a90df1a6a8cc3da678fb12d821bf0334c42576e51d58cc0e44955
+AUX fprobe-1.1-setgroups.patch 454 SHA256 9ae08a29ad08ee6697837a30fcc3866ea4909971cab4061f088e28113d67446b SHA512 a5248f5962f2ccb9e9235ae772d72b74db40504894e2ce40644af740849a98cfdaaa74beb151ca0e852f2df1419ee2366ed5850a15a23a54ebd3aab7569060fc WHIRLPOOL 039f4d42c88fae9dfb2e5c3853e937796267d25d8ab715f0157dfc7432b583b03cf779f6d08c4bf2d42f8fd33461089e993eecbfac90e217416a750dd0747b1d
+AUX init.d-fprobe 1099 SHA256 bf7ac8f9ce9ddd56963a03f220675a3a9f38fff691ffb3088b8347aec694d6ae SHA512 60823b35f809ada8de94f6427e2371681f646545b227974c4d5c94ae5153d48ad3815c848702606dc2ee18622787f1d04c499a241d60475c00303c6b652b9e51 WHIRLPOOL 19d5e074576a9d1f52001047939757c73c4bb12dcbf59ae9c74a935817edc023d1e441b9e3122abf129b270eac034908043659a02f91a19261097cb58b703675
+DIST fprobe-1.1.tar.bz2 104358 SHA256 3a1cedf5e7b0d36c648aa90914fa71a158c6743ecf74a38f4850afbac57d22a0 SHA512 35fa4bedf2c615093b6637630322115e12f005bc43186b86c55c6bdc76ae5308dd31e1d05632e26e07a30fba88d76b9acc98632bee4f372edcf9df5da3e32210 WHIRLPOOL 5069edf9a62d2da3d34192ad881d41e2d6c2fb7d10c6f70ebc717bde691cd926f73236319abec66847d9114c068c9ca7e5d00633a1eb05e8ae9f570a09cfda82
+EBUILD fprobe-1.1-r3.ebuild 805 SHA256 e43c408dbfdf904fe581742501992b08538bbbe468a66040dbd9dcb096a6d6b8 SHA512 0e04cd9b9d0691c1a5c3bf36c6e66cf48ffcf0ee7f798f569f6ad090db2fdf7a56af3dd9d1a5d81007677dc343cc45f04c956160817f0ab39e2f3310fa246ee3 WHIRLPOOL a7c97899ee6fbfd073237dc529ebef753b6a46707fddfcc2b3cea1c0c7f0bf9f6633b92b80420a6af9feed272e81e43a4aa9e0c5e70e94ab0371806bf113e4dc
+EBUILD fprobe-1.1.ebuild 702 SHA256 9adf4942d562228476d6786b05c71f6390a8203cf3336a7f8c734b910f7fc36e SHA512 264c6a71608e2580a9bde579ba524c429902c16405083758d5832cb24546709cbc629302ca358c87171ae166033bbcdc4ceb038c85cbec33cb852d61a8047523 WHIRLPOOL 7e2c4c514717e680de92a0a510cb6c1b25eadcfb64321dd105b7c0ccc65ebbe533087c76ff5f18a564090bda6f742db61581a693d29625897a49141bdf45cc24
+MISC ChangeLog 2729 SHA256 4c15cd2c270b9f727058c70d41cc6b581d3e64b6178b0dfa859edc50f6f6490d SHA512 fa9e217c049c089aaa6daf7f721fc42391838304a3ee153eb63c6589761bde1ca1ebff71ddf6978cb6256876a45a2e19fe4986e4e4de027710d21e658d022454 WHIRLPOOL 05214ce43f133a1673fd36721c764e8f4edb2f8cf5cc7368811a2ff5470c0cceae657924e59437589c108cc9e156bf98f3bd67a39834def3fb34ed628acd5573
+MISC ChangeLog-2015 2621 SHA256 3ec674d3444a6a97d5e6e041d7f450622cba04cc5d2486b6459a6f7a0dcc1292 SHA512 ac084d394e396a5c6e4fc57ce3471d12e4cc5eb89732835a926b858ccd311f3f09539ecb4e596397e97b431563c472689640a39a5cf9f92441b75836aa6a0dd0 WHIRLPOOL 552adc39bf788a1adde43c8aaffee78134e938c6ee2ecbc1bdce507078b7e0792d0633013ff767ae849495b4b47b938b03458281ecca953a684bf21962568b8c
+MISC metadata.xml 426 SHA256 fca6d7350e83150dafa45264de693426a704494113baf12769abe07b1bf25222 SHA512 2b9247d129021a3e25d3d4196a48ec2d204d2e91307231d372cc1bde255553785c9e413ba3dcd6a62ad28e54ba46e732212aeff4bcb03e796f2ba87325dd80bc WHIRLPOOL 6befc7fabc178533678599bcc15af97e810c85df1f1b380162daa46a375df66ad02c57a83cd5845a3550216a07fdfbcfdf8f4ea87f05e0b7350571eecf0814f5
diff --git a/net-analyzer/fprobe/files/conf.d-fprobe b/net-analyzer/fprobe/files/conf.d-fprobe
new file mode 100644
index 000000000000..a93c5c10b207
--- /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 000000000000..c58c2a97c002
--- /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 000000000000..803a2a9ce43a
--- /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 000000000000..c470af432c9c
--- /dev/null
+++ b/net-analyzer/fprobe/files/init.d-fprobe
@@ -0,0 +1,41 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 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#*:}"
+ eval 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-r3.ebuild b/net-analyzer/fprobe/fprobe-1.1-r3.ebuild
new file mode 100644
index 000000000000..c9f12cb15c7d
--- /dev/null
+++ b/net-analyzer/fprobe/fprobe-1.1-r3.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="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
+"
+RDEPEND="
+ ${DEPEND}
+"
+PATCHES=(
+ "${FILESDIR}"/fprobe-1.1-pidfile-sanity.patch
+ "${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 000000000000..97dcfe72a52f
--- /dev/null
+++ b/net-analyzer/fprobe/fprobe-1.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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 000000000000..0fd136315cb2
--- /dev/null
+++ b/net-analyzer/fprobe/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>netmon@gentoo.org</email>
+ <name>Gentoo network monitoring and analysis project</name>
+ </maintainer>
+ <use>
+ <flag name="messages">enable console messages</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">fprobe</remote-id>
+ </upstream>
+</pkgmetadata>