summaryrefslogtreecommitdiff
path: root/net-misc/samplicator
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-misc/samplicator
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz
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-misc/samplicator')
-rw-r--r--net-misc/samplicator/Manifest2
-rw-r--r--net-misc/samplicator/files/samplicator.886
-rw-r--r--net-misc/samplicator/files/samplicator.conf8
-rw-r--r--net-misc/samplicator/files/samplicator.initd40
-rw-r--r--net-misc/samplicator/metadata.xml21
-rw-r--r--net-misc/samplicator/samplicator-1.3.6.ebuild54
-rw-r--r--net-misc/samplicator/samplicator-1.3.7_beta6.ebuild57
7 files changed, 268 insertions, 0 deletions
diff --git a/net-misc/samplicator/Manifest b/net-misc/samplicator/Manifest
new file mode 100644
index 00000000000..840d7371460
--- /dev/null
+++ b/net-misc/samplicator/Manifest
@@ -0,0 +1,2 @@
+DIST samplicator-1.3.6.tar.gz 87901 SHA256 d5af47be6fc6cdbd9b5d116c65a92c6b9fd546df1c9cd61c831b5b85eb1f2742 SHA512 a4023344ec911d3dc6992ddce139e6f1c86a67bd9948a3f92a995dc26aeda1753becea4b0f5d9ad45a06d628029bffc0a77c28fbd277da9faf42100c01d55f31 WHIRLPOOL c499abfe21ed1d8062ab8fad1b6ae87a45217a797f8997588bf6aa8acd2b743dac4e9d5df965208ffd999dd7fa59e7e413956a2ddb5f86cdbac77de854ff9737
+DIST samplicator-1.3.7-beta6.tar.gz 95603 SHA256 8f1da80f2b32ef0e41a720fe1c98905f6e4cb1acb2949dbdddbb665a09655faf SHA512 fbb22dbe37afe5d1a855866da0ca0b1c8a8165bf366a45ca25648c9e30448adc959143a2571661cc1ae59332557a58d0fa3c87b405fca6c8543bed38cf12e622 WHIRLPOOL 9a0685793774c985bea33a0cbb4fffd40f8a1e38a03a9243008188b8e725574e3a34519a616ff8262cd081afcf59d87635aae8ce192f1fdc7088d0149a90ee86
diff --git a/net-misc/samplicator/files/samplicator.8 b/net-misc/samplicator/files/samplicator.8
new file mode 100644
index 00000000000..1ddef240723
--- /dev/null
+++ b/net-misc/samplicator/files/samplicator.8
@@ -0,0 +1,86 @@
+.TH samplicator 8 "February 25, 2013" "" "samplicator"
+.SH NAME
+.B samplicator
+\- UDP packets forwarder and duplicator
+.SH SYNOPSIS
+.B samplicator
+.RB [ \-p
+.IR port ]
+.RB [ \-s
+.IR address ]
+.RB [ \-d
+.IR level ]
+.RB [ \-b
+.IR size ]
+.RB [ \-n ]
+.RB [ \-S ]
+.RB [ \-x
+.IR delay ]
+.RB [ \-c
+.IR config ]
+.RB [ \-f ]
+.RB [ \-h ]
+.RB A.B.C.D[/\fIport\fP[/\fIfreq\fP][,\fIttl\fP]]
+.SH DESCRIPTION
+.B samplicator
+is simple program listens for UDP datagrams (NetFlow, sFlow, SNMP Trap, Syslog)
+on a network port, and sends copies of these datagrams on to a set of destinations.
+Optionally, it can perform sampling, i.e. rather than forwarding every packet,
+forward only 1 in N. Another option is that it can "spoof" the IP source address,
+so that the copies appear to come from the original source, rather than the relay.
+.SH OPTIONS
+The following command-line options are accepted by the server:
+.IP "\-p \fIport\fP"
+UDP port to accept flows on. Default \- 2000.
+.IP "\-s \fIaddress\fP"
+interface address to accept flows on. Default \- any.
+.IP "\-d \fIlevel\fP"
+debug level
+.IP "\-b \fIsize\fP"
+set socket buffer size. Default \- 65536.
+.IP \-n
+don't compute UDP checksum (leave at 0)
+.IP \-S
+maintain (spoof) source addresses
+.IP "\-x \fIdelay\fP"
+transmit delay in microseconds
+.IP "\-c \fIconfig\fP"
+specify a config file to read
+.IP \-f
+fork program into background
+.IP \-h
+print this usage message and exit
+.IP A.B.C.D
+is the receiver's IP address
+.IP "\fIport\fP"
+is the UDP port to send to. Default \- 2000.
+.IP "\fIfreq\fP"
+is the sampling rate. Default \- 1.
+.IP "\fIttl\fP"
+is the sending packets TTL value. Default \- 64.
+.SH CONFIG
+A.B.C.D[/E.F.G.H]: receiver
+.IP A.B.C.D
+is the senders IP address
+.IP E.F.G.H
+is a mask to apply to the sender. Default \- 255.255.255.255.
+.IP receiver
+is the IP address of receiver
+.SH NOTES
+.B samplicator
+currently only supports IPv4.
+.PP
+Receivers specified on the command line will get all packets, those specified in the
+.IR config
+will get only packets with a matching source.
+
+.SH FILES
+.B
+/usr/sbin/samplicate
+
+.SH AUTHOR
+.B samplicator
+was originally written by Simon Leinen <simon.einen@gmail.com>.
+.PP
+This manual page was written by Vladimir Pavljuchenkov <spiderx@spiderx.dp.ua>
+for Gentoo Linux (and may be used by others) \ No newline at end of file
diff --git a/net-misc/samplicator/files/samplicator.conf b/net-misc/samplicator/files/samplicator.conf
new file mode 100644
index 00000000000..3f38ccc9887
--- /dev/null
+++ b/net-misc/samplicator/files/samplicator.conf
@@ -0,0 +1,8 @@
+# Config file for /etc/init.d/samplicator
+
+# Various options.
+# run `samplicator -h` for valid cmdline options
+OPTS="-f -S -p 2000"
+
+# Receiver config file
+#CONFIG="-c /etc/samplicator/receiver.conf" \ No newline at end of file
diff --git a/net-misc/samplicator/files/samplicator.initd b/net-misc/samplicator/files/samplicator.initd
new file mode 100644
index 00000000000..8e516d68041
--- /dev/null
+++ b/net-misc/samplicator/files/samplicator.initd
@@ -0,0 +1,40 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+NAME=${SVCNAME##*.}
+if [ -n "${NAME}" -a "${SVCNAME}" != "samplicator" ]; then
+ PID="/run/samplicator.${NAME}.pid"
+ PNAME=$(echo ${RC_SVCNAME} | sed 's/\..*//g')
+ CONF_DEFAULT="/etc/conf.d/samplicator.${NAME}"
+else
+ PID="/run/samplicator.pid"
+ PNAME=${RC_SVCNAME}
+ CONF_DEFAULT="/etc/conf.d/samplicator"
+fi
+CONF=${CONF:-${CONF_DEFAULT}}
+EXEC=${EXEC:-/usr/bin/samplicate}
+
+depend() {
+ need net
+ provide samplicator
+}
+
+start() {
+ ebegin "Starting samplicator"
+ start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} --exec ${EXEC} -- ${OPTS} ${CONFIG}
+ eend $?
+}
+
+start_post() {
+ pgrep -n $(echo ${PNAME} | sed 's/or/e/') > ${PID}
+}
+
+stop() {
+ ebegin "Stopping samplicator"
+ start-stop-daemon --stop --quiet --pidfile ${PID}
+ rm -f ${PID}
+ eend $?
+}
+
diff --git a/net-misc/samplicator/metadata.xml b/net-misc/samplicator/metadata.xml
new file mode 100644
index 00000000000..e2cc8bc8bd0
--- /dev/null
+++ b/net-misc/samplicator/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>spiderx@spiderx.dp.ua</email>
+ <name>Vladimir Pavljuchenkov</name>
+ <description>Primary maintainer.</description>
+ </maintainer>
+ <herd>proxy-maintainers</herd>
+ <longdescription>
+ This small program receives UDP datagrams on a given port, and resends
+ those datagrams to a specified set of receivers. In addition, a
+ sampling divisor N may be specified individually for each receiver,
+ which will then only receive one in N of the received packets.
+ </longdescription>
+ <upstream>
+ <changelog>https://code.google.com/p/samplicator/source/browse/trunk/ChangeLog</changelog>
+ <doc>https://code.google.com/p/samplicator/source/browse/trunk/README</doc>
+ <bugs-to>mailto:simon.leinen@gmail.com</bugs-to>
+ </upstream>
+</pkgmetadata>
diff --git a/net-misc/samplicator/samplicator-1.3.6.ebuild b/net-misc/samplicator/samplicator-1.3.6.ebuild
new file mode 100644
index 00000000000..e8ac460e194
--- /dev/null
+++ b/net-misc/samplicator/samplicator-1.3.6.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils user
+
+DESCRIPTION="UDP packets forwarder and duplicator"
+HOMEPAGE="http://${PN}.googlecode.com/"
+SRC_URI="http://${PN}.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="Artistic GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+pkg_setup() {
+ # Add samplicator group and user to system
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /etc/${PN} ${PN}
+}
+
+src_install() {
+ # Install and copy documentation
+ default
+
+ # Install Gentoo init script and its config
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.conf ${PN}
+
+ # Install manual page
+ doman "${FILESDIR}"/${PN}.8
+}
+
+pkg_postinst() {
+ ewarn ""
+ ewarn "Don't specify the receiver on the command line, because it will get all packets."
+ ewarn "Instead of this, specify it in a config file; defined in such way it will only get packets with a matching source."
+ ewarn ""
+
+ einfo "For every receiver type create a file in directory /etc/${PN} (see example below)"
+ einfo "and specify the path to it in variable CONFIG of the corresponding initscript config file in /etc/conf.d/"
+ einfo ""
+ einfo "Receiver config examples: "
+ einfo ""
+ einfo " /etc/${PN}/netflow:"
+ einfo " 10.0.0.0/255.0.0.0:1.1.1.1/9996 2.2.2.2/9996 3.3.3.3/9996"
+ einfo ""
+ einfo " /etc/${PN}/syslog:"
+ einfo " 10.0.0.0/255.255.0.0:2.2.2.2/514 3.3.3.3/514"
+ einfo ""
+ einfo " /etc/${PN}/snmp:"
+ einfo " 10.0.0.0/255.255.255.255:3.3.3.3/162"
+}
diff --git a/net-misc/samplicator/samplicator-1.3.7_beta6.ebuild b/net-misc/samplicator/samplicator-1.3.7_beta6.ebuild
new file mode 100644
index 00000000000..053fb58dd94
--- /dev/null
+++ b/net-misc/samplicator/samplicator-1.3.7_beta6.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils user
+
+DESCRIPTION="UDP packets forwarder and duplicator"
+HOMEPAGE="http://${PN}.googlecode.com/"
+MY_P=${P/_/-}
+SRC_URI="http://${PN}.googlecode.com/files/${MY_P}.tar.gz"
+
+LICENSE="Artistic GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ # Add samplicator group and user to system
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /etc/${PN} ${PN}
+}
+
+src_install() {
+ # Install and copy documentation
+ default
+
+ # Install Gentoo init script and its config
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.conf ${PN}
+
+ # Install manual page
+ doman "${FILESDIR}"/${PN}.8
+}
+
+pkg_postinst() {
+ ewarn ""
+ ewarn "Don't specify the receiver on the command line, because it will get all packets."
+ ewarn "Instead of this, specify it in a config file; defined in such way it will only get packets with a matching source."
+ ewarn ""
+
+ einfo "For every receiver type create a file in directory /etc/${PN} (see example below)"
+ einfo "and specify the path to it in variable CONFIG of the corresponding initscript config file in /etc/conf.d/"
+ einfo ""
+ einfo "Receiver config examples: "
+ einfo ""
+ einfo " /etc/${PN}/netflow:"
+ einfo " 10.0.0.0/255.0.0.0:1.1.1.1/9996 2.2.2.2/9996 3.3.3.3/9996"
+ einfo ""
+ einfo " /etc/${PN}/syslog:"
+ einfo " 10.0.0.0/255.255.0.0:2.2.2.2/514 3.3.3.3/514"
+ einfo ""
+ einfo " /etc/${PN}/snmp:"
+ einfo " 10.0.0.0/255.255.255.255:3.3.3.3/162"
+}