diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-misc/samplicator |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-misc/samplicator')
-rw-r--r-- | net-misc/samplicator/Manifest | 10 | ||||
-rw-r--r-- | net-misc/samplicator/files/samplicator.8 | 86 | ||||
-rw-r--r-- | net-misc/samplicator/files/samplicator.confd | 8 | ||||
-rw-r--r-- | net-misc/samplicator/files/samplicator.initd | 39 | ||||
-rw-r--r-- | net-misc/samplicator/metadata.xml | 23 | ||||
-rw-r--r-- | net-misc/samplicator/samplicator-1.3.6.ebuild | 53 | ||||
-rw-r--r-- | net-misc/samplicator/samplicator-1.3.8_rc1.ebuild | 58 |
7 files changed, 277 insertions, 0 deletions
diff --git a/net-misc/samplicator/Manifest b/net-misc/samplicator/Manifest new file mode 100644 index 000000000000..98c99de8c90c --- /dev/null +++ b/net-misc/samplicator/Manifest @@ -0,0 +1,10 @@ +AUX samplicator.8 2278 SHA256 bb36a0df436fc0db4c53bb9d832f88f9c1c4c1331e7babcaef96ee9aacaf9dd4 SHA512 008d797b15fa217d5e6eaed2923ddb1abe580fd8d1092309d3295c75667cde8d15e35b39827827c8cabd5e988f70846cb5e58f673eef5be59f6b874ea400b2c0 WHIRLPOOL b3a46c99fa8fd5024fe6cc11268fc720f8f6dd1248fe1ccc73ee0c78d8381cadb78f80a2bb9e2bee8f9f414c56f45d999643916201c0f88978d86f1908fd9cce +AUX samplicator.confd 199 SHA256 dc777a834e22a3093dc18cbb9e93c132a266a562882b11d703b41e1f1a447f9f SHA512 6c9240d821fabd23f5a7e7dd3762b17622c8a45b137112bb376ec4f1b52b03c34f4bed76801be20e34dc1045923e24722bb515d974bd06bcc8d19dc20925e691 WHIRLPOOL d993c18d5899eb78565042ba0b672c19f173359af69bc07e6a52a386a948829f77b2cf76322c7dd16580615c2ec11afc7572d7052bdde5c97102f05eb122c052 +AUX samplicator.initd 988 SHA256 e351da31a352cad9092ee5687c33368c51e952a6a607375cc0bc70bfc61e7643 SHA512 7bb9ebdb7d4b50d0df4827926b2ee6f9aaba0b63f841f6cb62d1dc2dcdf517e5a8e155813dab33e846270b9cb589c82e47ac293b4ab6482e504955856c68bc99 WHIRLPOOL dee636b908dd4b8a139e47388858a095bcf1de7a1e3aa5956d1a4fd1ad67b421b58c79ddf03b21afc28914b009694d4c5065e821f7e86a35530c24231884d03c +DIST samplicator-1.3.6.tar.gz 87901 SHA256 d5af47be6fc6cdbd9b5d116c65a92c6b9fd546df1c9cd61c831b5b85eb1f2742 SHA512 a4023344ec911d3dc6992ddce139e6f1c86a67bd9948a3f92a995dc26aeda1753becea4b0f5d9ad45a06d628029bffc0a77c28fbd277da9faf42100c01d55f31 WHIRLPOOL c499abfe21ed1d8062ab8fad1b6ae87a45217a797f8997588bf6aa8acd2b743dac4e9d5df965208ffd999dd7fa59e7e413956a2ddb5f86cdbac77de854ff9737 +DIST samplicator-1.3.8rc1.tar.gz 109870 SHA256 5536622b409cf570a2326e2b4a1eac403eb6d9f05295450100d5176da1ec4e47 SHA512 9f688baff07f885a0ad58974374cdf6b66a5aeaeb01fbf38f431ebaaf160b38e37fae7c511f0fe388b10fa91d0bf4505c765556f55a2c6753a57d3df3b8b3306 WHIRLPOOL fd736a7bbe493b7432fe30be83d7058050f0afe9611f43e6e6df34d363a06c6cb377dde8ac84952b86c1a79ff8906bc093d60c9a1e0bf08f06916d2b0aa79aa7 +EBUILD samplicator-1.3.6.ebuild 1536 SHA256 0e8b15aa2ad1904d279408d0ce8364612339aa2e6efb5b1915f9524193a752fb SHA512 56b2e1796150961f6e9b30894de3ad5310a0a40e7e185f98a90c46b1706412b8610fa9b3fd819609e6996a2fd54dd254ff1c4c116432d69d36735741209ef3da WHIRLPOOL 7bf734c237c043142fe2bd96a504a5c7d44eb4c3bff4fb7a3b2c502e19e0ec852ddd83c1d1a8016b55fa7771e7db1cfa5d484043d0c0348222c248ae7395870a +EBUILD samplicator-1.3.8_rc1.ebuild 1601 SHA256 f78249cd4a455ff013bd5c407e014e421be34b6946e6e16ef944e28f56c556e9 SHA512 9985e45f3e47dfdcd7998b2980b3be0d3cc86d0870c8f2581e87c6140cd88ab0b78f91af672abf002cd14ca4a937a1f36d9a6a0f9335e70e354b8a5a599706cc WHIRLPOOL aaf18f94cfbfcb8bbea9869a41e4868ba757248d80adad3d44ca4109365555d12068dd273a3d9d9eecdd30fa4c529e086efd2e6d75693fc8655e910d904d3e85 +MISC ChangeLog 3838 SHA256 39ed5f917bdfe16cb6a9297509ce61030a67fddf7fd8476584d704b56708faf9 SHA512 43c66e1694ef4b5b0a7efb2d5c37895580498e683d99d27f8d5772764506891743f43a41991ca8663f1109da2cc3429e7038a10a202563c84f7e7d3e66e4931e WHIRLPOOL dd07ae9f8ea45afc0c24f1026d2542d5daaeb7f72ff79239ed713c39c649b74ecfd4433b15ec74bdb4756e595b1775a63151cd3d4216c26fe40d458090f76e8e +MISC ChangeLog-2015 1053 SHA256 821de12673ae48b37ec90049cfa2112c6adc7f40ae37b98e507679ca64637301 SHA512 c0bbddc927cc36bee7fe75e42e97af31a2c969baa5fe7edbfbeef90136a36c98f00c5e41a304d0b529ceb9bc4be2f7e8ccc5cde7f744bc0ae6975b83e75c63c8 WHIRLPOOL cc1116a04222d74c5220d96ba091ae4863ca560e4408c57ed736676f5f1502ffa6e07be9895f4944841a6621a12ec3e0efa9acfa12b63d034e21db04faad68e4 +MISC metadata.xml 893 SHA256 3ca15db76d3c44640b2a805f60c63a9643e0671478f2470abdaba2977021c86f SHA512 5bd96527dea29dd156d355e351c3b6b27d359aef72beb8b218907c4b53e04377e3d03ed1f43fad1dfe79292719ef74f4768060cbc534324dd5058950d7cc659d WHIRLPOOL e8eaeefa9f5624e1ce371137e487a6d10e4d95139b13c101c0e8ab8e0dca2dcecf6f933675827a012550c392d81270be5b94ad45cd86c3f2dd5cee85ac40dd37 diff --git a/net-misc/samplicator/files/samplicator.8 b/net-misc/samplicator/files/samplicator.8 new file mode 100644 index 000000000000..1ddef2407238 --- /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.confd b/net-misc/samplicator/files/samplicator.confd new file mode 100644 index 000000000000..3f38ccc9887b --- /dev/null +++ b/net-misc/samplicator/files/samplicator.confd @@ -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 000000000000..0260192c3ee1 --- /dev/null +++ b/net-misc/samplicator/files/samplicator.initd @@ -0,0 +1,39 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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 000000000000..37fecb38f2e4 --- /dev/null +++ b/net-misc/samplicator/metadata.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>spiderx@spiderx.dp.ua</email> + <name>Vladimir Pavljuchenkov</name> + <description>Proxied maintainer; set to assignee in all bugs</description> + </maintainer> + <maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <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> + <remote-id type="github">sleinen/samplicator</remote-id> + <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 000000000000..52905b78ec33 --- /dev/null +++ b/net-misc/samplicator/samplicator-1.3.6.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit user + +DESCRIPTION="UDP packets forwarder and duplicator" +HOMEPAGE="https://github.com/sleinen/${PN}" +SRC_URI="https://github.com/sleinen/${PN}/releases/download/v${PV}/${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}.confd ${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.8_rc1.ebuild b/net-misc/samplicator/samplicator-1.3.8_rc1.ebuild new file mode 100644 index 000000000000..91ac19d6e813 --- /dev/null +++ b/net-misc/samplicator/samplicator-1.3.8_rc1.ebuild @@ -0,0 +1,58 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +MY_PV=${PV/_/} +MY_P=${PN}-${MY_PV} + +inherit user + +DESCRIPTION="UDP packets forwarder and duplicator" +HOMEPAGE="https://github.com/sleinen/${PN}" +SRC_URI="https://github.com/sleinen/${PN}/releases/download/${MY_PV}/${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}.confd ${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" +} |