summaryrefslogtreecommitdiffstats
path: root/net-mgmt/ipacctd
diff options
context:
space:
mode:
authorskv <skv@FreeBSD.org>2003-08-22 14:11:09 +0000
committerskv <skv@FreeBSD.org>2003-08-22 14:11:09 +0000
commitc16e9ada9d86733297496f143987b1c70d6612fa (patch)
tree1ee0492968ee402bedbc7404f337b445c08b90ca /net-mgmt/ipacctd
parent132faefa4bfcd20384a02b7772190e9e69c43833 (diff)
downloadFreeBSD-ports-c16e9ada9d86733297496f143987b1c70d6612fa.zip
FreeBSD-ports-c16e9ada9d86733297496f143987b1c70d6612fa.tar.gz
Add ipacctd 1.46, IP accounting using divert socket.
Diffstat (limited to 'net-mgmt/ipacctd')
-rw-r--r--net-mgmt/ipacctd/Makefile35
-rw-r--r--net-mgmt/ipacctd/distinfo1
-rw-r--r--net-mgmt/ipacctd/files/ipacctd.sh.sample72
-rw-r--r--net-mgmt/ipacctd/pkg-descr8
-rw-r--r--net-mgmt/ipacctd/pkg-plist5
5 files changed, 121 insertions, 0 deletions
diff --git a/net-mgmt/ipacctd/Makefile b/net-mgmt/ipacctd/Makefile
new file mode 100644
index 0000000..2e8fc8c
--- /dev/null
+++ b/net-mgmt/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-mgmt/ipacctd/distinfo b/net-mgmt/ipacctd/distinfo
new file mode 100644
index 0000000..137a298
--- /dev/null
+++ b/net-mgmt/ipacctd/distinfo
@@ -0,0 +1 @@
+MD5 (ipacctd-1.46.tar.gz) = 34cce133b21973eaf050a9df943b7eff
diff --git a/net-mgmt/ipacctd/files/ipacctd.sh.sample b/net-mgmt/ipacctd/files/ipacctd.sh.sample
new file mode 100644
index 0000000..90e85c1
--- /dev/null
+++ b/net-mgmt/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-mgmt/ipacctd/pkg-descr b/net-mgmt/ipacctd/pkg-descr
new file mode 100644
index 0000000..26a342e
--- /dev/null
+++ b/net-mgmt/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-mgmt/ipacctd/pkg-plist b/net-mgmt/ipacctd/pkg-plist
new file mode 100644
index 0000000..5715a08
--- /dev/null
+++ b/net-mgmt/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%%
OpenPOWER on IntegriCloud