From 565a923745877d2921f19a4a08847a2c687e0a48 Mon Sep 17 00:00:00 2001 From: Kirill Ponomarev Date: Thu, 6 Nov 2003 09:15:28 +0000 Subject: bandwidthd tracks usage of TCP/IP network subnets and builds HTML files with graphs to display network utilization. Charts are built by individual IP. It color codes HTTP, TCP, UDP, ICMP, VPN, and P2P traffic. Unlike MRTG, it tracks each individual IP address, not the status of any particular link. PR: 58830 Submitted by: Clement Laforet --- net-mgmt/bandwidthd/Makefile | 33 ++++++++++++++++++ net-mgmt/bandwidthd/distinfo | 1 + net-mgmt/bandwidthd/files/bandwidthd.sh | 22 ++++++++++++ net-mgmt/bandwidthd/files/patch-Makefile | 40 ++++++++++++++++++++++ net-mgmt/bandwidthd/files/patch-bandwidthd.c | 23 +++++++++++++ net-mgmt/bandwidthd/files/patch-conf.tab.c | 19 +++++++++++ net-mgmt/bandwidthd/files/patch-conf.y | 14 ++++++++ net-mgmt/bandwidthd/files/patch-graph.c | 50 ++++++++++++++++++++++++++++ net-mgmt/bandwidthd/pkg-descr | 6 ++++ net-mgmt/bandwidthd/pkg-plist | 9 +++++ net/Makefile | 1 + net/bandwidthd/Makefile | 33 ++++++++++++++++++ net/bandwidthd/distinfo | 1 + net/bandwidthd/files/bandwidthd.sh | 22 ++++++++++++ net/bandwidthd/files/patch-Makefile | 40 ++++++++++++++++++++++ net/bandwidthd/files/patch-bandwidthd.c | 23 +++++++++++++ net/bandwidthd/files/patch-conf.tab.c | 19 +++++++++++ net/bandwidthd/files/patch-conf.y | 14 ++++++++ net/bandwidthd/files/patch-graph.c | 50 ++++++++++++++++++++++++++++ net/bandwidthd/pkg-descr | 6 ++++ net/bandwidthd/pkg-plist | 9 +++++ 21 files changed, 435 insertions(+) create mode 100644 net-mgmt/bandwidthd/Makefile create mode 100644 net-mgmt/bandwidthd/distinfo create mode 100644 net-mgmt/bandwidthd/files/bandwidthd.sh create mode 100644 net-mgmt/bandwidthd/files/patch-Makefile create mode 100644 net-mgmt/bandwidthd/files/patch-bandwidthd.c create mode 100644 net-mgmt/bandwidthd/files/patch-conf.tab.c create mode 100644 net-mgmt/bandwidthd/files/patch-conf.y create mode 100644 net-mgmt/bandwidthd/files/patch-graph.c create mode 100644 net-mgmt/bandwidthd/pkg-descr create mode 100644 net-mgmt/bandwidthd/pkg-plist create mode 100644 net/bandwidthd/Makefile create mode 100644 net/bandwidthd/distinfo create mode 100644 net/bandwidthd/files/bandwidthd.sh create mode 100644 net/bandwidthd/files/patch-Makefile create mode 100644 net/bandwidthd/files/patch-bandwidthd.c create mode 100644 net/bandwidthd/files/patch-conf.tab.c create mode 100644 net/bandwidthd/files/patch-conf.y create mode 100644 net/bandwidthd/files/patch-graph.c create mode 100644 net/bandwidthd/pkg-descr create mode 100644 net/bandwidthd/pkg-plist diff --git a/net-mgmt/bandwidthd/Makefile b/net-mgmt/bandwidthd/Makefile new file mode 100644 index 000000000000..5108087e7207 --- /dev/null +++ b/net-mgmt/bandwidthd/Makefile @@ -0,0 +1,33 @@ +# New ports collection makefile for: bandwidthd +# Date created: Sun Nov 2 +# Whom: Clement Laforet +# +# $FreeBSD$ +# + +PORTNAME= bandwidthd +PORTVERSION= 1.1.5 +CATEGORIES= net +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} +EXTRACT_SUFX= .tgz + +MAINTAINER= sheepkiller@cultdeadsheep.org +COMMENT= Tracks bandwidth usage by IP address + +LIB_DEPENDS+= gd.4:${PORTSDIR}/graphics/gd + +USE_GMAKE= YES +USE_REINPLACE= YES +CFLAGS+= -DFREEBSD -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib +MAKE_ENV+= LDFLAGS="${LDFLAGS}" + +post-patch: + @${REINPLACE_CMD} -e 's!localtime(!localtime((time_t *)!' ${WRKSRC}/graph.c + +post-install: + @${INSTALL_SCRIPT} ${FILESDIR}/bandwidthd.sh \ + ${PREFIX}/etc/rc.d/bandwidthd.sh.sample + +.include diff --git a/net-mgmt/bandwidthd/distinfo b/net-mgmt/bandwidthd/distinfo new file mode 100644 index 000000000000..62384ea9d752 --- /dev/null +++ b/net-mgmt/bandwidthd/distinfo @@ -0,0 +1 @@ +MD5 (bandwidthd-1.1.5.tgz) = a1376f78f7f3414bb95ce76f1a9deac7 diff --git a/net-mgmt/bandwidthd/files/bandwidthd.sh b/net-mgmt/bandwidthd/files/bandwidthd.sh new file mode 100644 index 000000000000..7dd2836fdd73 --- /dev/null +++ b/net-mgmt/bandwidthd/files/bandwidthd.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in + start) + [ -x ${PREFIX}/bandwidthd ] && \ + [ -r ${PREFIX}/bandwidthd/etc/bandwidthd.conf ] && \ + cd ${PREFIX}/bandwidthd && ./bandwidthd &&\ + echo -n ' bandwidthd' + + ;; + stop) + killall bandwidthd && echo -n ' bandwidthd' + ;; + *) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac diff --git a/net-mgmt/bandwidthd/files/patch-Makefile b/net-mgmt/bandwidthd/files/patch-Makefile new file mode 100644 index 000000000000..a556b5608a69 --- /dev/null +++ b/net-mgmt/bandwidthd/files/patch-Makefile @@ -0,0 +1,40 @@ +--- Makefile.orig Mon Sep 22 20:48:07 2003 ++++ Makefile Sun Nov 2 12:28:29 2003 +@@ -1,7 +1,7 @@ + #Possible optimizations -fomit-frame-pointer -ffast-math + OBS= bandwidthd.o graph.o conf.tab.o conf.l.o +-LIBS= -lgd -lpng -lpcap +-CFLAGS= -O3 -Wall ++LIBS+= -lgd -lpng -lpcap ${LDFLAGS} ++CFLAGS+= + NONWALLCFLAGS= -O3 #-g -DDEBUG + + # Debugging stuff +@@ -20,7 +20,7 @@ + $(CC) $(CFLAGS) $(OBS) -o bandwidthd $(LIBS) + + conf.tab.c: conf.y +- bison -d conf.y ++ yacc -d conf.y + + conf.l.c: conf.l + lex -s -i -t -I conf.l > conf.l.c +@@ -34,12 +34,12 @@ + rm -f *.o bandwidthd *~ conf.tab.c conf.tab.h conf.l.c DEADJOE + + install: all +- mkdir -p /usr/local/bandwidthd/etc +- mkdir -p /usr/local/bandwidthd/htdocs +- cp bandwidthd /usr/local/bandwidthd +- cp etc/bandwidthd.conf /usr/local/bandwidthd/etc/ +- cp htdocs/legend.gif /usr/local/bandwidthd/htdocs/ +- cp htdocs/logo.gif /usr/local/bandwidthd/htdocs/ ++ mkdir -p ${PREFIX}/bandwidthd/etc ++ mkdir -p ${PREFIX}/bandwidthd/htdocs ++ cp bandwidthd ${PREFIX}/bandwidthd ++ cp etc/bandwidthd.conf ${PREFIX}/bandwidthd/etc/bandwidthd.conf-dist ++ cp htdocs/legend.gif ${PREFIX}/bandwidthd/htdocs/ ++ cp htdocs/logo.gif ${PREFIX}/bandwidthd/htdocs/ + + #**** Stuff where -WALL is turned off to reduce the noise in a compile so I can see my own errors ******************* + conf.l.o: conf.l.c diff --git a/net-mgmt/bandwidthd/files/patch-bandwidthd.c b/net-mgmt/bandwidthd/files/patch-bandwidthd.c new file mode 100644 index 000000000000..966db7208556 --- /dev/null +++ b/net-mgmt/bandwidthd/files/patch-bandwidthd.c @@ -0,0 +1,23 @@ +--- bandwidthd.c.orig Fri Oct 10 20:22:39 2003 ++++ bandwidthd.c Sun Nov 2 12:21:17 2003 +@@ -114,7 +114,11 @@ + } + else + { ++#ifndef FREEBSD + printf("My shared memory segment %d is already in use (%ld locks), perhaps bandwidthd is already running in this directory?\n", shmid, shmstatus.shm_nattch); ++#else ++ printf("My shared memory segment %d is already in use (%hd locks), perhaps bandwidthd is already running in this directory?\n", shmid, shmstatus.shm_nattch); ++#endif + exit(1); + } + } +@@ -244,7 +248,7 @@ + tcp = (struct tcphdr *)(ip+1); + tcp = (struct tcphdr *) ( ((char *)tcp) + ((ip->ip_hl-5)*4) ); // Compensate for IP Options + Stats->tcp += size; +-#ifdef SOLARIS ++#if defined(SOLARIS) || defined(FREEBSD) + sport = ntohs(tcp->th_sport); + dport = ntohs(tcp->th_dport); + #else diff --git a/net-mgmt/bandwidthd/files/patch-conf.tab.c b/net-mgmt/bandwidthd/files/patch-conf.tab.c new file mode 100644 index 000000000000..ad318ab770e1 --- /dev/null +++ b/net-mgmt/bandwidthd/files/patch-conf.tab.c @@ -0,0 +1,19 @@ +--- conf.tab.c.orig Sun Sep 14 10:34:01 2003 ++++ conf.tab.c Sun Nov 2 12:21:17 2003 +@@ -23,11 +23,15 @@ + #include + #include + #include ++#ifdef FREEBSD ++#include ++#else + #include ++#endif + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/net-mgmt/bandwidthd/files/patch-conf.y b/net-mgmt/bandwidthd/files/patch-conf.y new file mode 100644 index 000000000000..76a5852adfa8 --- /dev/null +++ b/net-mgmt/bandwidthd/files/patch-conf.y @@ -0,0 +1,14 @@ +--- conf.y.orig Sun Sep 14 10:33:53 2003 ++++ conf.y Sun Nov 2 12:21:18 2003 +@@ -2,7 +2,11 @@ + #include + #include + #include ++#ifdef FREEBSD ++#include ++#else + #include ++#endif + #include + #include + #include diff --git a/net-mgmt/bandwidthd/files/patch-graph.c b/net-mgmt/bandwidthd/files/patch-graph.c new file mode 100644 index 000000000000..3aa368d397d5 --- /dev/null +++ b/net-mgmt/bandwidthd/files/patch-graph.c @@ -0,0 +1,50 @@ +--- graph.c.orig Fri Oct 10 21:01:31 2003 ++++ graph.c Sun Nov 2 12:21:18 2003 +@@ -3,6 +3,11 @@ + #include + #include + #include ++#ifdef FREEBSD ++#include ++#include ++#include ++#endif + #include + #include + #include +@@ -753,7 +758,7 @@ + // **** Write the red day seperator bars + // ******************************************************************** + +- timestruct = localtime(&sample_begin); ++ timestruct = localtime((time_t *)(time_t *)&sample_begin); + timestruct->tm_sec = 0; + timestruct->tm_min = 0; + timestruct->tm_hour = 0; +@@ -772,7 +777,7 @@ + gdImageLine(im, x, 0, x, YHEIGHT-YOFFSET, red); + gdImageLine(im, x+1, 0, x+1, YHEIGHT-YOFFSET, red); + +- timestruct = localtime(&MarkTime); ++ timestruct = localtime((time_t *)(time_t *)&MarkTime); + strftime(buffer, 100, "%a, %b %d", timestruct); + gdImageString(im, gdFontSmall, x-30, YHEIGHT-YOFFSET+10, buffer, black); + +@@ -786,7 +791,7 @@ + // **** Write the tic marks + // ******************************************************************** + +- timestruct = localtime(&sample_begin); ++ timestruct = localtime((time_t *)(time_t *)&sample_begin); + timestruct->tm_sec = 0; + timestruct->tm_min = 0; + timestruct->tm_hour = 0; +@@ -803,7 +808,7 @@ + x = (MarkTime-sample_begin)*((XWIDTH-XOFFSET)/RANGE1) + XOFFSET; + } + +- timestruct = localtime(&sample_begin); ++ timestruct = localtime((time_t *)(time_t *)&sample_begin); + timestruct->tm_sec = 0; + timestruct->tm_min = 0; + timestruct->tm_hour = 0; diff --git a/net-mgmt/bandwidthd/pkg-descr b/net-mgmt/bandwidthd/pkg-descr new file mode 100644 index 000000000000..bcb67c8ccc0b --- /dev/null +++ b/net-mgmt/bandwidthd/pkg-descr @@ -0,0 +1,6 @@ +bandwidthd tracks usage of TCP/IP network subnets and builds HTML files with +graphs to display network utilization. Charts are built by individual IP. It +color codes HTTP, TCP,UDP, ICMP, VPN, and P2P traffic. Unlike MRTG, it tracks +each individual IP address, not the status of any particular link. + +WWW: http://bandwidthd.sourceforge.net/ diff --git a/net-mgmt/bandwidthd/pkg-plist b/net-mgmt/bandwidthd/pkg-plist new file mode 100644 index 000000000000..ecacdc36a557 --- /dev/null +++ b/net-mgmt/bandwidthd/pkg-plist @@ -0,0 +1,9 @@ +@comment $FreeBSD$ +bandwidthd/etc/bandwidthd.conf-dist +bandwidthd/bandwidthd +bandwidthd/htdocs/legend.gif +bandwidthd/htdocs/logo.gif +etc/rc.d/bandwidthd.sh.sample +@unexec rmdir %D/bandwidthd/etc 2> /dev/null || true +@unexec rmdir %D/bandwidthd/htdocs 2> /dev/null || true +@unexec rmdir %D/bandwidthd 2> /dev/null || echo "If you do not plan on reinstalling bandwidthd, you can safely remove %D/bandwidthd" diff --git a/net/Makefile b/net/Makefile index 5025a83a9460..4ab40b2f943d 100644 --- a/net/Makefile +++ b/net/Makefile @@ -37,6 +37,7 @@ SUBDIR += asterisk SUBDIR += b2bua SUBDIR += balance + SUBDIR += bandwidthd SUBDIR += bbsnet SUBDIR += bfilter SUBDIR += bgpq diff --git a/net/bandwidthd/Makefile b/net/bandwidthd/Makefile new file mode 100644 index 000000000000..5108087e7207 --- /dev/null +++ b/net/bandwidthd/Makefile @@ -0,0 +1,33 @@ +# New ports collection makefile for: bandwidthd +# Date created: Sun Nov 2 +# Whom: Clement Laforet +# +# $FreeBSD$ +# + +PORTNAME= bandwidthd +PORTVERSION= 1.1.5 +CATEGORIES= net +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} +EXTRACT_SUFX= .tgz + +MAINTAINER= sheepkiller@cultdeadsheep.org +COMMENT= Tracks bandwidth usage by IP address + +LIB_DEPENDS+= gd.4:${PORTSDIR}/graphics/gd + +USE_GMAKE= YES +USE_REINPLACE= YES +CFLAGS+= -DFREEBSD -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib +MAKE_ENV+= LDFLAGS="${LDFLAGS}" + +post-patch: + @${REINPLACE_CMD} -e 's!localtime(!localtime((time_t *)!' ${WRKSRC}/graph.c + +post-install: + @${INSTALL_SCRIPT} ${FILESDIR}/bandwidthd.sh \ + ${PREFIX}/etc/rc.d/bandwidthd.sh.sample + +.include diff --git a/net/bandwidthd/distinfo b/net/bandwidthd/distinfo new file mode 100644 index 000000000000..62384ea9d752 --- /dev/null +++ b/net/bandwidthd/distinfo @@ -0,0 +1 @@ +MD5 (bandwidthd-1.1.5.tgz) = a1376f78f7f3414bb95ce76f1a9deac7 diff --git a/net/bandwidthd/files/bandwidthd.sh b/net/bandwidthd/files/bandwidthd.sh new file mode 100644 index 000000000000..7dd2836fdd73 --- /dev/null +++ b/net/bandwidthd/files/bandwidthd.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +case "$1" in + start) + [ -x ${PREFIX}/bandwidthd ] && \ + [ -r ${PREFIX}/bandwidthd/etc/bandwidthd.conf ] && \ + cd ${PREFIX}/bandwidthd && ./bandwidthd &&\ + echo -n ' bandwidthd' + + ;; + stop) + killall bandwidthd && echo -n ' bandwidthd' + ;; + *) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac diff --git a/net/bandwidthd/files/patch-Makefile b/net/bandwidthd/files/patch-Makefile new file mode 100644 index 000000000000..a556b5608a69 --- /dev/null +++ b/net/bandwidthd/files/patch-Makefile @@ -0,0 +1,40 @@ +--- Makefile.orig Mon Sep 22 20:48:07 2003 ++++ Makefile Sun Nov 2 12:28:29 2003 +@@ -1,7 +1,7 @@ + #Possible optimizations -fomit-frame-pointer -ffast-math + OBS= bandwidthd.o graph.o conf.tab.o conf.l.o +-LIBS= -lgd -lpng -lpcap +-CFLAGS= -O3 -Wall ++LIBS+= -lgd -lpng -lpcap ${LDFLAGS} ++CFLAGS+= + NONWALLCFLAGS= -O3 #-g -DDEBUG + + # Debugging stuff +@@ -20,7 +20,7 @@ + $(CC) $(CFLAGS) $(OBS) -o bandwidthd $(LIBS) + + conf.tab.c: conf.y +- bison -d conf.y ++ yacc -d conf.y + + conf.l.c: conf.l + lex -s -i -t -I conf.l > conf.l.c +@@ -34,12 +34,12 @@ + rm -f *.o bandwidthd *~ conf.tab.c conf.tab.h conf.l.c DEADJOE + + install: all +- mkdir -p /usr/local/bandwidthd/etc +- mkdir -p /usr/local/bandwidthd/htdocs +- cp bandwidthd /usr/local/bandwidthd +- cp etc/bandwidthd.conf /usr/local/bandwidthd/etc/ +- cp htdocs/legend.gif /usr/local/bandwidthd/htdocs/ +- cp htdocs/logo.gif /usr/local/bandwidthd/htdocs/ ++ mkdir -p ${PREFIX}/bandwidthd/etc ++ mkdir -p ${PREFIX}/bandwidthd/htdocs ++ cp bandwidthd ${PREFIX}/bandwidthd ++ cp etc/bandwidthd.conf ${PREFIX}/bandwidthd/etc/bandwidthd.conf-dist ++ cp htdocs/legend.gif ${PREFIX}/bandwidthd/htdocs/ ++ cp htdocs/logo.gif ${PREFIX}/bandwidthd/htdocs/ + + #**** Stuff where -WALL is turned off to reduce the noise in a compile so I can see my own errors ******************* + conf.l.o: conf.l.c diff --git a/net/bandwidthd/files/patch-bandwidthd.c b/net/bandwidthd/files/patch-bandwidthd.c new file mode 100644 index 000000000000..966db7208556 --- /dev/null +++ b/net/bandwidthd/files/patch-bandwidthd.c @@ -0,0 +1,23 @@ +--- bandwidthd.c.orig Fri Oct 10 20:22:39 2003 ++++ bandwidthd.c Sun Nov 2 12:21:17 2003 +@@ -114,7 +114,11 @@ + } + else + { ++#ifndef FREEBSD + printf("My shared memory segment %d is already in use (%ld locks), perhaps bandwidthd is already running in this directory?\n", shmid, shmstatus.shm_nattch); ++#else ++ printf("My shared memory segment %d is already in use (%hd locks), perhaps bandwidthd is already running in this directory?\n", shmid, shmstatus.shm_nattch); ++#endif + exit(1); + } + } +@@ -244,7 +248,7 @@ + tcp = (struct tcphdr *)(ip+1); + tcp = (struct tcphdr *) ( ((char *)tcp) + ((ip->ip_hl-5)*4) ); // Compensate for IP Options + Stats->tcp += size; +-#ifdef SOLARIS ++#if defined(SOLARIS) || defined(FREEBSD) + sport = ntohs(tcp->th_sport); + dport = ntohs(tcp->th_dport); + #else diff --git a/net/bandwidthd/files/patch-conf.tab.c b/net/bandwidthd/files/patch-conf.tab.c new file mode 100644 index 000000000000..ad318ab770e1 --- /dev/null +++ b/net/bandwidthd/files/patch-conf.tab.c @@ -0,0 +1,19 @@ +--- conf.tab.c.orig Sun Sep 14 10:34:01 2003 ++++ conf.tab.c Sun Nov 2 12:21:17 2003 +@@ -23,11 +23,15 @@ + #include + #include + #include ++#ifdef FREEBSD ++#include ++#else + #include ++#endif + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/net/bandwidthd/files/patch-conf.y b/net/bandwidthd/files/patch-conf.y new file mode 100644 index 000000000000..76a5852adfa8 --- /dev/null +++ b/net/bandwidthd/files/patch-conf.y @@ -0,0 +1,14 @@ +--- conf.y.orig Sun Sep 14 10:33:53 2003 ++++ conf.y Sun Nov 2 12:21:18 2003 +@@ -2,7 +2,11 @@ + #include + #include + #include ++#ifdef FREEBSD ++#include ++#else + #include ++#endif + #include + #include + #include diff --git a/net/bandwidthd/files/patch-graph.c b/net/bandwidthd/files/patch-graph.c new file mode 100644 index 000000000000..3aa368d397d5 --- /dev/null +++ b/net/bandwidthd/files/patch-graph.c @@ -0,0 +1,50 @@ +--- graph.c.orig Fri Oct 10 21:01:31 2003 ++++ graph.c Sun Nov 2 12:21:18 2003 +@@ -3,6 +3,11 @@ + #include + #include + #include ++#ifdef FREEBSD ++#include ++#include ++#include ++#endif + #include + #include + #include +@@ -753,7 +758,7 @@ + // **** Write the red day seperator bars + // ******************************************************************** + +- timestruct = localtime(&sample_begin); ++ timestruct = localtime((time_t *)(time_t *)&sample_begin); + timestruct->tm_sec = 0; + timestruct->tm_min = 0; + timestruct->tm_hour = 0; +@@ -772,7 +777,7 @@ + gdImageLine(im, x, 0, x, YHEIGHT-YOFFSET, red); + gdImageLine(im, x+1, 0, x+1, YHEIGHT-YOFFSET, red); + +- timestruct = localtime(&MarkTime); ++ timestruct = localtime((time_t *)(time_t *)&MarkTime); + strftime(buffer, 100, "%a, %b %d", timestruct); + gdImageString(im, gdFontSmall, x-30, YHEIGHT-YOFFSET+10, buffer, black); + +@@ -786,7 +791,7 @@ + // **** Write the tic marks + // ******************************************************************** + +- timestruct = localtime(&sample_begin); ++ timestruct = localtime((time_t *)(time_t *)&sample_begin); + timestruct->tm_sec = 0; + timestruct->tm_min = 0; + timestruct->tm_hour = 0; +@@ -803,7 +808,7 @@ + x = (MarkTime-sample_begin)*((XWIDTH-XOFFSET)/RANGE1) + XOFFSET; + } + +- timestruct = localtime(&sample_begin); ++ timestruct = localtime((time_t *)(time_t *)&sample_begin); + timestruct->tm_sec = 0; + timestruct->tm_min = 0; + timestruct->tm_hour = 0; diff --git a/net/bandwidthd/pkg-descr b/net/bandwidthd/pkg-descr new file mode 100644 index 000000000000..bcb67c8ccc0b --- /dev/null +++ b/net/bandwidthd/pkg-descr @@ -0,0 +1,6 @@ +bandwidthd tracks usage of TCP/IP network subnets and builds HTML files with +graphs to display network utilization. Charts are built by individual IP. It +color codes HTTP, TCP,UDP, ICMP, VPN, and P2P traffic. Unlike MRTG, it tracks +each individual IP address, not the status of any particular link. + +WWW: http://bandwidthd.sourceforge.net/ diff --git a/net/bandwidthd/pkg-plist b/net/bandwidthd/pkg-plist new file mode 100644 index 000000000000..ecacdc36a557 --- /dev/null +++ b/net/bandwidthd/pkg-plist @@ -0,0 +1,9 @@ +@comment $FreeBSD$ +bandwidthd/etc/bandwidthd.conf-dist +bandwidthd/bandwidthd +bandwidthd/htdocs/legend.gif +bandwidthd/htdocs/logo.gif +etc/rc.d/bandwidthd.sh.sample +@unexec rmdir %D/bandwidthd/etc 2> /dev/null || true +@unexec rmdir %D/bandwidthd/htdocs 2> /dev/null || true +@unexec rmdir %D/bandwidthd 2> /dev/null || echo "If you do not plan on reinstalling bandwidthd, you can safely remove %D/bandwidthd" -- cgit v1.2.3