diff options
author | lawrance <lawrance@FreeBSD.org> | 2005-06-22 23:40:51 +0800 |
---|---|---|
committer | lawrance <lawrance@FreeBSD.org> | 2005-06-22 23:40:51 +0800 |
commit | 47bcf4e2cf4e54dca201a7a13c049f7ee87a680f (patch) | |
tree | 76e42d8c2a5ce01b78d7a8cd87ae2bd0f28e6bc0 /net | |
parent | c50297ac271380d3b0f28849ca7086a7f0d1d496 (diff) | |
download | freebsd-ports-gnome-47bcf4e2cf4e54dca201a7a13c049f7ee87a680f.tar.gz freebsd-ports-gnome-47bcf4e2cf4e54dca201a7a13c049f7ee87a680f.tar.zst freebsd-ports-gnome-47bcf4e2cf4e54dca201a7a13c049f7ee87a680f.zip |
Add cnupm 3.8, the BPF Traffic Collector (IPv4/IPv6).
PR: ports/66275
Submitted by: Dennis S. Davidoff <null@1system.ru>
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/cnupm/Makefile | 42 | ||||
-rw-r--r-- | net/cnupm/distinfo | 2 | ||||
-rw-r--r-- | net/cnupm/files/cnupm.sh.in | 37 | ||||
-rw-r--r-- | net/cnupm/pkg-descr | 13 | ||||
-rw-r--r-- | net/cnupm/pkg-message | 11 | ||||
-rw-r--r-- | net/cnupm/pkg-plist | 9 |
7 files changed, 115 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index 220183511524..e48e649e2d7f 100644 --- a/net/Makefile +++ b/net/Makefile @@ -74,6 +74,7 @@ SUBDIR += clusterit SUBDIR += cnd SUBDIR += cnet + SUBDIR += cnupm SUBDIR += coccinella SUBDIR += coda5_client SUBDIR += coda5_doc diff --git a/net/cnupm/Makefile b/net/cnupm/Makefile new file mode 100644 index 000000000000..102af2dbd502 --- /dev/null +++ b/net/cnupm/Makefile @@ -0,0 +1,42 @@ +# New ports collection makefile for: cnupm +# Date created: 29 October 2003 +# Whom: Dennis S.Davidoff <null@1system.ru> +# +# $FreeBSD$ +# + +PORTNAME= cnupm +PORTVERSION= 3.8 +CATEGORIES= net ipv6 +MASTER_SITES= http://pdp-11.org.ru/~form/cnupm/files/ + +MAINTAINER= null@1system.ru +COMMENT= The BPF Traffic Collector (IPv4/IPv6) + +USE_RC_SUBR= cnupm.sh +MAN8= cnupm.8 cnupmstat.8 +MANCOMPRESSED= yes + +CNUPM_OWN?= cnupm +CNUPM_GRP?= cnupm + +PW= /usr/sbin/pw + +PLIST_SUB+= CNUPM_OWN="${CNUPM_OWN}" CNUPM_GRP="${CNUPM_GRP}" + +post-install: + ${PW} groupshow ${CNUPM_GRP} 2>/dev/null || ${PW} groupadd \ + -n ${CNUPM_GRP} + ${PW} usershow ${CNUPM_OWN} 2>/dev/null || ${PW} useradd \ + -n ${CNUPM_OWN} -c 'Cnupm traffic collector' \ + -g ${CNUPM_GRP} -s /sbin/nologin + ${INSTALL} -o ${CNUPM_OWN} -g ${CNUPM_GRP} -m 750 -d ${PREFIX}/var/cnupm + ${PW} usermod -n ${CNUPM_OWN} -d ${PREFIX}/var/cnupm +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} + @${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} +.endif + + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.mk> diff --git a/net/cnupm/distinfo b/net/cnupm/distinfo new file mode 100644 index 000000000000..d411b8ed8141 --- /dev/null +++ b/net/cnupm/distinfo @@ -0,0 +1,2 @@ +MD5 (cnupm-3.8.tar.gz) = f178cc30a8b13b7c9245fda6f445a9dd +SIZE (cnupm-3.8.tar.gz) = 33512 diff --git a/net/cnupm/files/cnupm.sh.in b/net/cnupm/files/cnupm.sh.in new file mode 100644 index 000000000000..13072497faf2 --- /dev/null +++ b/net/cnupm/files/cnupm.sh.in @@ -0,0 +1,37 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# +# Add the following lines to /etc/rc.conf to enable rsyncd: +# +# cnupm_enable="YES" +# cnupm_ifaces="rl0" # Change this with your interface! +# cnupm_flags="" # Set this one to override default flags +# +# See cnupm(8) for flags +# + +. %%RC_SUBR%% + +name=cnupm +rcvar=`set_rcvar` +command=%%PREFIX%%/sbin/cnupm +cnupm_flags="-ep -f inet -u cnupm" + +load_rc_config ${name} + +cnupm_enable=${cnupm_enable:-"NO"} + +case ${cnupm_enable} in +[Yy][Ee][Ss]) + if [ -z ${cnupm_iface} ]; then + err 1 "cnupm_iface is not set - edit /etc/rc.conf" + fi +esac + +cnupm_flags="-i ${cnupm_iface} ${cnupm_flags:-""}" +pidfile=~${name}/${name}-${cnupm_iface}.pid + +run_rc_command "$1" diff --git a/net/cnupm/pkg-descr b/net/cnupm/pkg-descr new file mode 100644 index 000000000000..7f51d1c608a1 --- /dev/null +++ b/net/cnupm/pkg-descr @@ -0,0 +1,13 @@ +The cnupm is an IP/IPv6 traffic collector daemon; it listens on a network +interface for IP/IPv6 packets that match the boolean expression (see +tcpdump(8) for more information) and collects the following statistics: + + o address family (INET/INET6) + o IP/IPv6 protocol number + o source IP/IPv6 address + o source TCP/UDP port + o destination IP/IPv6 address + o destination TCP/UDP port + o total number of bytes trasferred + +WWW: http://pdp-11.org.ru/~form/cnupm diff --git a/net/cnupm/pkg-message b/net/cnupm/pkg-message new file mode 100644 index 000000000000..6dc982823174 --- /dev/null +++ b/net/cnupm/pkg-message @@ -0,0 +1,11 @@ +************************************************************ + +Add the following lines to /etc/rc.conf to enable cnupm: + +cnupm_enable="YES" +cnupm_iface="rl0" # Change this with your interface! +#cnupm_flags="" # Set this one to override default flags + +See cnupm(8) for flags + +************************************************************ diff --git a/net/cnupm/pkg-plist b/net/cnupm/pkg-plist new file mode 100644 index 000000000000..297e7d1236e4 --- /dev/null +++ b/net/cnupm/pkg-plist @@ -0,0 +1,9 @@ +sbin/cnupm +sbin/cnupmstat +%%PORTDOCS%%%%DOCSDIR%%/README +%%PORTDOCS%%@dirrm %%DOCSDIR%% +@exec pw groupshow %%CNUPM_GRP%% 2>/dev/null || pw groupadd -n %%CNUPM_GRP%% +@exec pw usershow %%CNUPM_OWN%% 2>/dev/null || pw useradd -n %%CNUPM_OWN%% -c 'Cnupm traffic collector' -g %%CNUPM_GRP%% -s /sbin/nologin +@exec install -o %%CNUPM_OWN%% -g %%CNUPM_GRP%% -m 750 -d %D/var/cnupm +@exec pw usermod -n %%CNUPM_OWN%% -d %D/var/cnupm +@unexec rmdir %D/var/cnupm 2>/dev/null || true |