diff options
author | skv <skv@FreeBSD.org> | 2003-08-22 22:11:09 +0800 |
---|---|---|
committer | skv <skv@FreeBSD.org> | 2003-08-22 22:11:09 +0800 |
commit | c16e9ada9d86733297496f143987b1c70d6612fa (patch) | |
tree | 1ee0492968ee402bedbc7404f337b445c08b90ca /net | |
parent | 132faefa4bfcd20384a02b7772190e9e69c43833 (diff) | |
download | freebsd-ports-gnome-c16e9ada9d86733297496f143987b1c70d6612fa.tar.gz freebsd-ports-gnome-c16e9ada9d86733297496f143987b1c70d6612fa.tar.zst freebsd-ports-gnome-c16e9ada9d86733297496f143987b1c70d6612fa.zip |
Add ipacctd 1.46, IP accounting using divert socket.
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/ipacctd/Makefile | 35 | ||||
-rw-r--r-- | net/ipacctd/distinfo | 1 | ||||
-rw-r--r-- | net/ipacctd/files/ipacctd.sh.sample | 72 | ||||
-rw-r--r-- | net/ipacctd/pkg-descr | 8 | ||||
-rw-r--r-- | net/ipacctd/pkg-plist | 5 |
6 files changed, 122 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index 46e2e5f82b8f..bbf9610a6bd1 100644 --- a/net/Makefile +++ b/net/Makefile @@ -231,6 +231,7 @@ SUBDIR += imcom SUBDIR += iog SUBDIR += ip6_int + SUBDIR += ipacctd SUBDIR += ipaudit SUBDIR += ipcad SUBDIR += ipcalc diff --git a/net/ipacctd/Makefile b/net/ipacctd/Makefile new file mode 100644 index 000000000000..2e8fc8cf06e7 --- /dev/null +++ b/net/ipacctd/Makefile @@ -0,0 +1,35 @@ +# New ports collection makefile for: ipacctd +# Date created: 22 Aug 2003 +# Whom: Sergey Skvortsov <skv@protey.ru> +# +# $FreeBSD$ +# + +PORTNAME= ipacctd +PORTVERSION= 1.46 +CATEGORIES= net +MASTER_SITES= ftp://ftp.wuppy.net.ru/pub/FreeBSD/local/ipacctd/ + +MAINTAINER= skv@FreeBSD.org +COMMENT= IP accounting using divert socket + +STARTUP_SCRIPT= ipacctd.sh.sample +PLIST_SUB= STARTUP_SCRIPT=${STARTUP_SCRIPT} + +WRKSRC= ${WRKDIR}/${PORTNAME} +MAKE_ENV+= BINDIR="${PREFIX}/sbin" + +MAN8= ipacctd.8 +MANLANG= "" ru.KOI8-R +MANCOMPRESSED= yes + +post-install: +.ifndef(NOPORTDOCS) + @${ECHO_MSG} "===> Installing documentation for ${PKGNAME}" + @${MKDIR} ${DOCSDIR}/ru + @${INSTALL_DATA} ${WRKSRC}/README.ipacctd ${DOCSDIR}/ru +.endif + ${INSTALL_SCRIPT} ${FILESDIR}/${STARTUP_SCRIPT} \ + ${PREFIX}/etc/rc.d/${STARTUP_SCRIPT} + +.include <bsd.port.mk> diff --git a/net/ipacctd/distinfo b/net/ipacctd/distinfo new file mode 100644 index 000000000000..137a298715b5 --- /dev/null +++ b/net/ipacctd/distinfo @@ -0,0 +1 @@ +MD5 (ipacctd-1.46.tar.gz) = 34cce133b21973eaf050a9df943b7eff diff --git a/net/ipacctd/files/ipacctd.sh.sample b/net/ipacctd/files/ipacctd.sh.sample new file mode 100644 index 000000000000..90e85c15b81d --- /dev/null +++ b/net/ipacctd/files/ipacctd.sh.sample @@ -0,0 +1,72 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +# If there is a global system configuration file, suck it in. +if [ -r /etc/defaults/rc.conf ]; then + . /etc/defaults/rc.conf + source_rc_confs +elif [ -r /etc/rc.conf ]; then + . /etc/rc.conf +fi + +ipacctd_enable=${ipacctd_enable:-YES} +ipacctd_program=${ipacctd_program:-${PREFIX}/sbin/ipacctd} +ipacctd_flags=${ipacctd_flags:-"-v"} + +#ipacctd_log_base=${ipacctd_log_base:-/var/log/ipacct} +#ipacctd_log_ext=${ipacctd_log_ext:-%Y-%m-%d-%T} + +ipacctd_rules="xl0 ppp0" + +ipacctd_rule_xl0_flags="" +ipacctd_rule_xl0_pid="/var/run/ipacctd.xl0" + +ipacctd_rule_ppp0_flags="" +ipacctd_rule_ppp0_pid="/var/run/ipacctd.ppp0" + +case "$1" in +start) + case "${ipacctd_enable}" in + [Yy][Ee][Ss]) + if [ -f ${ipacctd_program} ]; then + echo -n ' ipacctd [' + + for rule in ${ipacctd_rules}; do + echo -n " ${rule}" + + eval ipacctd_rule_flags=\$ipacctd_rule_${rule}_flags + if [ -z $ipacctd_rule_flags ]; then + echo " you must define flags for rule ${rule}" + exit 1 + fi + + eval ipacctd_rule_pid=\${ipacctd_rule_${rule}_pid:-"/var/run/ipacctd.${rule}"} + + ${ipacctd_program} \ + ${ipacctd_flags} \ + ${ipacctd_rule_flags} \ + -r ${ipacctd_rule_pid} + + done + echo -n " ]" + fi + ;; + esac + ;; +stop) + for rule in ${ipacctd_rules}; do + eval ipacctd_rule_pid=\${ipacctd_rule_${rule}_pid:-"/var/run/ipacctd.${rule}"} + kill `cat ${ipacctd_rule_pid}` + done + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 + diff --git a/net/ipacctd/pkg-descr b/net/ipacctd/pkg-descr new file mode 100644 index 000000000000..26a342ef10b7 --- /dev/null +++ b/net/ipacctd/pkg-descr @@ -0,0 +1,8 @@ +The ipacctd is intended for IP accounting. divert(4) and corresponding +ipfw(8) rules are used for obtaining IP packets. + +Author: Roman V. Palagin <romanp@unshadow.net> +FTP: ftp://ftp.wuppy.net.ru/pub/FreeBSD/local/ipacctd/ + +-- Sergey Skvortsov +skv@FreeBSD.org diff --git a/net/ipacctd/pkg-plist b/net/ipacctd/pkg-plist new file mode 100644 index 000000000000..5715a08c9d96 --- /dev/null +++ b/net/ipacctd/pkg-plist @@ -0,0 +1,5 @@ +sbin/ipacctd +etc/rc.d/%%STARTUP_SCRIPT%% +%%PORTDOCS%%%%DOCSDIR%%/ru/README.ipacctd +%%PORTDOCS%%@dirrm %%DOCSDIR%%/ru +%%PORTDOCS%%@dirrm %%DOCSDIR%% |