diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-03-20 14:27:17 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-03-20 14:27:17 +0000 |
commit | 5bb9ff1ee56d2b5e75e01a7f066d8b0cec84ec02 (patch) | |
tree | 66e860a5099bcad013f1cf667255dc372a7c11b3 /net-analyzer/nfdump/files | |
parent | 7218e1b46bceac05841e90472501742d905fb3fc (diff) |
gentoo resync : 20.03.2021
Diffstat (limited to 'net-analyzer/nfdump/files')
-rw-r--r-- | net-analyzer/nfdump/files/nfcapd.confd | 11 | ||||
-rw-r--r-- | net-analyzer/nfdump/files/nfcapd.initd | 60 | ||||
-rw-r--r-- | net-analyzer/nfdump/files/nfdump-1.6.21-remove-strict-rfc-7011-handling.patch | 49 |
3 files changed, 120 insertions, 0 deletions
diff --git a/net-analyzer/nfdump/files/nfcapd.confd b/net-analyzer/nfdump/files/nfcapd.confd new file mode 100644 index 000000000000..28ea35fd0741 --- /dev/null +++ b/net-analyzer/nfdump/files/nfcapd.confd @@ -0,0 +1,11 @@ +#shellcheck shell=sh +#shellcheck disable=SC2034 + +#port number to listen on +#PORT="2055" + +#maximum size of collected files +#MAX_SIZE="1G" + +#enable sending of all received packets to specified address +#REPEAT_TO="192.168.1.1/60062" diff --git a/net-analyzer/nfdump/files/nfcapd.initd b/net-analyzer/nfdump/files/nfcapd.initd new file mode 100644 index 000000000000..98d388cb710f --- /dev/null +++ b/net-analyzer/nfdump/files/nfcapd.initd @@ -0,0 +1,60 @@ +#!/sbin/openrc-run +#shellcheck shell=sh + +IDENT="${RC_SVCNAME#*.}" +PIDFILE="/run/nfcapd/${IDENT}.pid" +USER="nfcapd" +GROUP="nfcapd" + +ssd_start(){ + if [ -n "${MAX_SIZE}" ]; then + set -- "$@" -e + fi + if [ -n "${PORT}" ]; then + set -- "$@" -p "${PORT}" + fi + if [ -n "${REPEAT_TO}" ]; then + set -- "$@" -R "${REPEAT_TO}" + fi + start-stop-daemon "$@" +} + +checkconfig() { + if [ "${IDENT}" = "${RC_SVCNAME}" ]; then + eerror "You have to create an init script for each ident:" + eerror " cd /etc/init.d/; ln -s nfcapd nfcapd.ident" + return 1 + fi +} + +depend() { + need net +} + +start() { + checkconfig || return 1 + + checkpath -d -m 0750 -o nfcapd:nfcapd /run/nfcapd + checkpath -d -m 0750 -o nfcapd:nfcapd /var/tmp/nfcapd/"${IDENT}" + + if [ -n "${MAX_SIZE}" ]; then + nfexpire -u /var/tmp/nfcapd/"${IDENT}" -s "${MAX_SIZE}" \ + > /dev/null 2>&1 + chown -R ${USER}:${GROUP} /var/tmp/nfcapd/"${IDENT}" + fi + + ebegin "Starting ${RC_SVCNAME}" + ssd_start --start --quiet --exec /usr/bin/nfcapd \ + --pidfile "${PIDFILE}" -- -D -P "${PIDFILE}" -u ${USER} \ + -g ${GROUP} -I "${IDENT}" -l /var/tmp/nfcapd/"${IDENT}" + eend $? +} + +stop() { + checkconfig || return 1 + + ebegin "Stopping ${RC_SVCNAME}" + start-stop-daemon --stop --exec /usr/bin/nfcapd \ + --pidfile "${PIDFILE}" + eend $? +} diff --git a/net-analyzer/nfdump/files/nfdump-1.6.21-remove-strict-rfc-7011-handling.patch b/net-analyzer/nfdump/files/nfdump-1.6.21-remove-strict-rfc-7011-handling.patch new file mode 100644 index 000000000000..a36af2242d42 --- /dev/null +++ b/net-analyzer/nfdump/files/nfdump-1.6.21-remove-strict-rfc-7011-handling.patch @@ -0,0 +1,49 @@ +From f5ae2b821c22ebe0c96f3516d4e90f4255633828 Mon Sep 17 00:00:00 2001 +From: Peter Haag <peter@people.ops-trust.net> +Date: Sat, 8 Aug 2020 16:46:04 +0200 +Subject: [PATCH] Re-address issue #231 - remove strict rule rfc 7011 + +--- + ChangeLog | 3 +++ + bin/ipfix.c | 3 --- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index a0b2b67..8b92e58 100755 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,6 @@ ++2020-08-02 ++- Re-address issue #231 - remove strict rule rfc 7011 ++ + 2020-08-02 + - Release 1.6.21 + - Address issue #159. Implement rfc 7011 and include sender UDP port into unique template identification +diff --git a/bin/ipfix.c b/bin/ipfix.c +index a730a8b..19c9d63 100644 +--- a/bin/ipfix.c ++++ b/bin/ipfix.c +@@ -158,7 +158,6 @@ typedef struct exporterDomain_s { + + // exporter information + exporter_info_record_t info; +- in_port_t port; // follow rfc 7011 - matching src port + + uint64_t packets; // number of packets sent by this exporter + uint64_t flows; // number of flow records sent by this exporter +@@ -383,7 +382,6 @@ uint32_t ObservationDomain = ntohl(ipfix_header->ObservationDomain); + + while ( *e ) { + if ( (*e)->info.id == ObservationDomain && (*e)->info.version == 10 && +- (*e)->port == fs->port && + (*e)->info.ip.V6[0] == fs->ip.V6[0] && (*e)->info.ip.V6[1] == fs->ip.V6[1]) + return *e; + e = &((*e)->next); +@@ -412,7 +410,6 @@ uint32_t ObservationDomain = ntohl(ipfix_header->ObservationDomain); + (*e)->info.header.size = sizeof(exporter_info_record_t); + (*e)->info.id = ObservationDomain; + (*e)->info.ip = fs->ip; +- (*e)->port = fs->port; + (*e)->info.sa_family = fs->sa_family; + (*e)->info.version = 10; + (*e)->info.sysid = 0; |