ports/146631: net/pppload: Update port - was broken

Martin Kraft a0516 at marimga.de
Sun May 16 11:30:04 UTC 2010


>Number:         146631
>Category:       ports
>Synopsis:       net/pppload: Update port - was broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 16 11:30:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Martin Kraft
>Release:        8.0
>Organization:
>Environment:
FreeBSD myhost.myhome.de 8.0-STABLE FreeBSD 8.0-STABLE #1: Tue Jan 12 23:14:04 CET 2010     a0516 at marimga.de:/usr/obj/usr/src/sys/MYHOST  i386

>Description:
Port was marked broken for OSVERSION >= 800064.

I made 2 changes in file PPPStats.C:

Replaced patched net/if_ppp.h by net/ppp_defs.h.
(Is linux/ppp_defs.h in the distribution.)

Replaced patched struct ifpppstatsreq by the original
struct ifreq.

Port is compiling, installing and running on my 8.0 machine now.

>How-To-Repeat:
cd /usr/ports/net/pppload
make
>Fix:


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	/usr/ports/net/pppload
#	/usr/ports/net/pppload/files
#	/usr/ports/net/pppload/files/patch-aa
#	/usr/ports/net/pppload/files/patch-ab
#	/usr/ports/net/pppload/files/patch-ac
#	/usr/ports/net/pppload/files/patch-ad
#	/usr/ports/net/pppload/files/patch-ae
#	/usr/ports/net/pppload/files/patch-af
#	/usr/ports/net/pppload/files/patch-ag
#	/usr/ports/net/pppload/Makefile
#	/usr/ports/net/pppload/README.html
#	/usr/ports/net/pppload/distinfo
#	/usr/ports/net/pppload/pkg-descr
#
echo c - /usr/ports/net/pppload
mkdir -p /usr/ports/net/pppload > /dev/null 2>&1
echo c - /usr/ports/net/pppload/files
mkdir -p /usr/ports/net/pppload/files > /dev/null 2>&1
echo x - /usr/ports/net/pppload/files/patch-aa
sed 's/^X//' >/usr/ports/net/pppload/files/patch-aa << '001278252185878a9aa989f1fec3b90e'
X--- Makefile.orig	Fri Jan 24 17:14:15 2003
X+++ Makefile	Fri Jan 24 17:28:19 2003
X@@ -8,17 +8,14 @@
X 
X ####### Directories
X 
X-QTDIR   =   /usr/lib/qt
X+QTDIR   =  	${QT_PREFIX}
X BASEDIR	=	$(QTDIR)
X INCDIR	=	$(BASEDIR)/include
X LIBDIR	=	$(BASEDIR)/lib
X 
X ####### Compiler
X 
X-CFLAGS	=	-pipe -O2 -m486 -Wall
X-LFLAGS	=	-L$(LIBDIR) -lqt
X-LEXTRA	= 	
X-CC		=	g++
X+LFLAGS	=	-L$(LIBDIR) -lqt-mt ${PTHREAD_LIBS}
X 
X #######	Files
X 
X@@ -51,14 +48,14 @@
X .SUFFIXES: .C $(SUFFIXES)
X 
X .C.o:
X-	$(CC) -c $(CFLAGS) -I$(INCDIR) $<
X+	$(CXX) -c $(CFLAGS) -I$(INCDIR) $<
X 
X #######	Build rules
X 
X all: $(TARGET)
X 
X $(TARGET): $(OBJECTS) $(OBJMETA)
X-	$(CC) $(OBJECTS) $(OBJMETA) -o $(TARGET) $(LFLAGS) $(LEXTRA)
X+	$(CXX) $(OBJECTS) $(OBJMETA) -o $(TARGET) $(LFLAGS) $(LEXTRA)
X 
X depend: $(SRCMETA)
X 	makedepend -I$(INCDIR) $(SOURCES) 2> /dev/null
X@@ -107,70 +104,9 @@
X 
X # DO NOT DELETE THIS LINE -- make depend depends on it.
X 
X-pppload.o: /usr/lib/qt/include/qapp.h /usr/lib/qt/include/qwidget.h
X-pppload.o: /usr/lib/qt/include/qwindefs.h /usr/lib/qt/include/qobjdefs.h
X-pppload.o: /usr/lib/qt/include/qglobal.h /usr/lib/qt/include/qobject.h
X-pppload.o: /usr/lib/qt/include/qstring.h /usr/lib/qt/include/qarray.h
X-pppload.o: /usr/lib/qt/include/qgarray.h /usr/lib/qt/include/qshared.h
X-pppload.o: /usr/lib/qt/include/qgeneric.h /usr/include/string.h
X-pppload.o: /usr/include/features.h /usr/include/sys/cdefs.h
X-pppload.o: /usr/lib/gcc-lib/i486-linux/2.7.2/include/stddef.h
X-pppload.o: /usr/lib/qt/include/qevent.h /usr/lib/qt/include/qrect.h
X-pppload.o: /usr/lib/qt/include/qsize.h /usr/lib/qt/include/qpoint.h
X-pppload.o: /usr/lib/qt/include/qpaintd.h /usr/lib/qt/include/qpalette.h
X-pppload.o: /usr/lib/qt/include/qcolor.h /usr/lib/qt/include/qcursor.h
X-pppload.o: /usr/lib/qt/include/qfont.h /usr/lib/qt/include/qfontmet.h
X-pppload.o: /usr/lib/qt/include/qfontinf.h PPPStats.H MainWindow.H
X-pppload.o: /usr/lib/qt/include/qpixmap.h Options.H
X-PPPStats.o: /usr/include/stdlib.h /usr/include/features.h
X-PPPStats.o: /usr/include/sys/cdefs.h
X-PPPStats.o: /usr/lib/gcc-lib/i486-linux/2.7.2/include/stddef.h
X-PPPStats.o: /usr/include/errno.h /usr/include/linux/errno.h
X-PPPStats.o: /usr/include/asm/errno.h /usr/include/alloca.h
X-PPPStats.o: /usr/include/stdio.h /usr/include/libio.h
X-PPPStats.o: /usr/include/_G_config.h /usr/include/sys/ioctl.h
X-PPPStats.o: /usr/include/linux/ioctl.h /usr/include/asm/ioctl.h
X-PPPStats.o: /usr/include/sys/termios.h /usr/include/sys/socketio.h
X-PPPStats.o: /usr/include/linux/sockios.h /usr/include/asm/sockios.h
X-PPPStats.o: /usr/include/sys/socket.h /usr/include/linux/socket.h
X-PPPStats.o: /usr/include/asm/socket.h /usr/include/linux/uio.h
X-PPPStats.o: /usr/include/sys/types.h /usr/include/linux/types.h
X-PPPStats.o: /usr/include/linux/posix_types.h /usr/include/asm/posix_types.h
X-PPPStats.o: /usr/include/asm/types.h /usr/include/sys/bitypes.h
X-PPPStats.o: /usr/include/net/if.h /usr/include/linux/if.h
X-PPPStats.o: /usr/include/linux/ppp_defs.h PPPStats.H
X-PPPStats.o: /usr/lib/qt/include/qobject.h /usr/lib/qt/include/qobjdefs.h
X-PPPStats.o: /usr/lib/qt/include/qglobal.h /usr/lib/qt/include/qstring.h
X-PPPStats.o: /usr/lib/qt/include/qarray.h /usr/lib/qt/include/qgarray.h
X-PPPStats.o: /usr/lib/qt/include/qshared.h /usr/lib/qt/include/qgeneric.h
X-PPPStats.o: /usr/include/string.h /usr/lib/qt/include/qevent.h
X-PPPStats.o: /usr/lib/qt/include/qwindefs.h /usr/lib/qt/include/qrect.h
X-PPPStats.o: /usr/lib/qt/include/qsize.h /usr/lib/qt/include/qpoint.h
X-PPPStats.o: Options.H /usr/lib/qt/include/qcolor.h
X-MainWindow.o: /usr/lib/qt/include/qpainter.h /usr/lib/qt/include/qpaintd.h
X-MainWindow.o: /usr/lib/qt/include/qwindefs.h /usr/lib/qt/include/qobjdefs.h
X-MainWindow.o: /usr/lib/qt/include/qglobal.h /usr/lib/qt/include/qrect.h
X-MainWindow.o: /usr/lib/qt/include/qsize.h /usr/lib/qt/include/qpoint.h
X-MainWindow.o: /usr/lib/qt/include/qcolor.h /usr/lib/qt/include/qfontmet.h
X-MainWindow.o: /usr/lib/qt/include/qfont.h /usr/lib/qt/include/qstring.h
X-MainWindow.o: /usr/lib/qt/include/qarray.h /usr/lib/qt/include/qgarray.h
X-MainWindow.o: /usr/lib/qt/include/qshared.h /usr/lib/qt/include/qgeneric.h
X-MainWindow.o: /usr/include/string.h /usr/include/features.h
X-MainWindow.o: /usr/include/sys/cdefs.h
X-MainWindow.o: /usr/lib/gcc-lib/i486-linux/2.7.2/include/stddef.h
X-MainWindow.o: /usr/lib/qt/include/qfontinf.h /usr/lib/qt/include/qregion.h
X-MainWindow.o: /usr/lib/qt/include/qpen.h /usr/lib/qt/include/qbrush.h
X-MainWindow.o: /usr/lib/qt/include/qpntarry.h /usr/lib/qt/include/qwmatrix.h
X-MainWindow.o: MainWindow.H /usr/lib/qt/include/qwidget.h
X-MainWindow.o: /usr/lib/qt/include/qobject.h /usr/lib/qt/include/qevent.h
X-MainWindow.o: /usr/lib/qt/include/qpalette.h /usr/lib/qt/include/qcursor.h
X-MainWindow.o: /usr/lib/qt/include/qpixmap.h Options.H
X-Options.o: /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
X-Options.o: Options.H /usr/lib/qt/include/qcolor.h
X-Options.o: /usr/lib/qt/include/qwindefs.h /usr/lib/qt/include/qobjdefs.h
X-Options.o: /usr/lib/qt/include/qglobal.h /usr/lib/qt/include/qstring.h
X-Options.o: /usr/lib/qt/include/qarray.h /usr/lib/qt/include/qgarray.h
X-Options.o: /usr/lib/qt/include/qshared.h /usr/lib/qt/include/qgeneric.h
X-Options.o: /usr/include/string.h /usr/include/features.h
X-Options.o: /usr/include/sys/cdefs.h
X-Options.o: /usr/lib/gcc-lib/i486-linux/2.7.2/include/stddef.h
X+pppload.o: PPPStats.H MainWindow.H
X+pppload.o: Options.H
X+PPPStats.o: Options.H
X+MainWindow.o: MainWindow.H
X+MainWindow.o: Options.H
X+Options.o: Options.H 
001278252185878a9aa989f1fec3b90e
echo x - /usr/ports/net/pppload/files/patch-ab
sed 's/^X//' >/usr/ports/net/pppload/files/patch-ab << '9d7e9a181e7d670d74c75ea196e96f8e'
X--- Options.C.orig	Wed Sep 11 01:55:27 1996
X+++ Options.C	Fri Feb  7 19:12:41 2003
X@@ -19,6 +19,7 @@
X 
X extern "C" {
X #include <stdio.h>
X+#include <stdlib.h>
X }
X 
X #include "Options.H"
X@@ -26,6 +27,7 @@
X Options::Options( int argc, char* argv[] )
X : _divider( 512 ), _interval( 5 ), _link( 0 ), _period( 60 ), _retry( 60 ), _showTx( true ), _showRx( true ), _txColor( "forestgreen" ), _rxColor( "red" )
X {
X+	strcpy(_device, "tun");
X 	for ( int i = 1; i < argc; i++ ) {
X 		if ( !strcmp( argv[i], "-cmd" ) ) {
X 			_cmd = argv[++i];
X@@ -33,6 +35,8 @@
X 			sscanf( argv[++i], "%d", &_divider );
X 		} else if ( !strcmp( argv[i], "-i" ) ) {
X 			sscanf( argv[++i], "%d", &_interval );
X+		} else if ( !strcmp( argv[i], "-device" ) ) {
X+			 strcpy(_device,argv[++i]);
X 		} else if ( !strcmp( argv[i], "-link" ) ) {
X 			sscanf( argv[++i], "%d", &_link );
X 		} else if ( !strcmp( argv[i], "-p" ) ) {
X@@ -60,6 +64,7 @@
X 			fprintf( stderr, "-d n            Horizontal divider spacing in bytes per second (default: %d).\n", divider() );
X 			fprintf( stderr, "-h              Print this help.\n" );
X 			fprintf( stderr, "-i interval     Set the polling interval to be 'interval' seconds (default: %d).\n", interval() );
X+			fprintf( stderr, "-device name    Name of the device to monitor (default is tun). \n");
X 			fprintf( stderr, "-link link      The PPP link number to monitor (default: %d).\n", link() );
X 			fprintf( stderr, "-p period       Set the load averaging period to be 'period seconds (default: %d).\n", period() );
X 			fprintf( stderr, "-retry interval Time between retries when dialling PPP link (default: %d).\n", retry() );
X@@ -74,7 +79,7 @@
X 			fprintf( stderr, "pppload comes with ABSOLUTELY NO WARRANTY; for details see the LICENSE file.\n" );
X 			fprintf( stderr, "This is free software, and you are welcome to redistribute it\n" );
X 			fprintf( stderr, "under certain conditions; see the LICENSE file for details.\n" );
X-
X+			fprintf( stderr, "Modified for FreeBSD 1998 \n");
X 			exit( 1 );
X 		}
X 	}
9d7e9a181e7d670d74c75ea196e96f8e
echo x - /usr/ports/net/pppload/files/patch-ac
sed 's/^X//' >/usr/ports/net/pppload/files/patch-ac << '76a5e0196e34880b64cfd99b4b99a2fa'
Xdiff -u --new-file pppload-1.0/Options.H ./Options.H
X--- pppload-1.0/Options.H	Tue Sep 10 16:53:36 1996
X+++ ./Options.H	Thu Jan 29 21:12:01 1998
X@@ -31,6 +31,8 @@
X 	int     _divider;
X 	//: Statistics polling interval in seconds.
X 	int     _interval;
X+        //: Network device to monitor
X+        char  _device[4];
X 	//: PPP link number to monitor.
X 	int     _link;
X 	//: Load averaging interval in seconds.
X@@ -49,9 +51,12 @@
X 	//: Extract command line opotions from argc and argv.
X 	Options( int argc, char* argv[] );
X 
X-    //: Return the PPP command.
X-    QString& cmd()      { return _cmd;      }
X+        //: Return the PPP command.
X+        QString& cmd()      { return _cmd;      }
X 	
X+        //: Return the name of the device being monitored
X+        char *  device() { return _device; }
X+
X 	//: Return the spacing between horizontal dividers.
X 	int      divider()  { return _divider;  }
X 
76a5e0196e34880b64cfd99b4b99a2fa
echo x - /usr/ports/net/pppload/files/patch-ad
sed 's/^X//' >/usr/ports/net/pppload/files/patch-ad << '880215203a435fb650fcc61cc1b1c629'
X--- PPPStats.C.orig	1996-09-12 04:50:13.000000000 +0200
X+++ PPPStats.C	2010-05-16 12:45:39.000000000 +0200
X@@ -19,16 +19,24 @@
X 
X extern "C" {
X #include <stdlib.h>
X-#include <errno.h>
X #include <stdio.h>
X+#include <sys/types.h>
X+#include <sys/select.h>
X #include <sys/ioctl.h>
X #include <sys/socket.h>
X-#include <net/if.h>
X-#include <linux/ppp_defs.h>
X+#include <sys/time.h>
X+#include <net/if.h> 
X+// 2010-05-16  Kf  Replaced patched net/if_ppp.h by net/ppp_defs.h.
X+//                 (Is linux/ppp_defs.h in the distribution.);
X+#include <net/ppp_defs.h> 
X }
X 
X #include "PPPStats.H"
X #include "Options.H"
X+#include <iostream>
X+
X+void get_command(char *);
X+char command[200];
X 
X typedef struct
X {
X@@ -53,38 +61,46 @@
X 		system( (const char*)options->cmd() );
X 	}
X 	
X-	DclPPPInfo        PPPInfo[1];
X-	struct ifreq      ifreq;
X+	DclPPPInfo        PPPInfo[1];           
X+// 2010-05-16  Kf  Replaced patched struct ifpppstatsreq by the original
X+//                 struct ifreq.
X+	struct ifreq ifreq;
X 	struct ppp_stats* PPPStat;
X-	struct ppp_stats  LastPPPStat[1];
X-	
X-	memset (& ifreq, 0, sizeof (ifreq));
X-	sprintf (ifreq.ifr_ifrn.ifrn_name, "ppp%d", options->link());
X+	struct ppp_stats  LastPPPStat[1];       
X 	
X-	ifreq.ifr_ifru.ifru_data = (caddr_t) PPPInfo;
X+	memset (&ifreq, 0, sizeof (ifreq));
X+	sprintf (ifreq.ifr_name, "%s%d",(const char*)options->device(),options->link());
X+
X 	PPPStat = & PPPInfo->stats;
X+    PPPStat->p.ppp_ibytes = 0;
X+    PPPStat->p.ppp_obytes = 0;
X 	memset (LastPPPStat, 0, sizeof (LastPPPStat));
X 	
X-	if ( (ioctl (_s, SIOCDEVPRIVATE, (caddr_t) & ifreq) < 0) ||
X-		( _isUp && ( PPPStat->p.ppp_ibytes < _rxTotal ) ) ||
X-		( !_isUp && ( PPPStat->p.ppp_ibytes == 0 ) )
X-		) {
X-		if ( _isUp ) {
X-			_isUp = false;
X-			emit linkDown();
X-			if ( options->cmd().length() ) {
X-				_retryId = startTimer( options->retry() * 1000 );
X-				system( (const char*)options->cmd() );
X-			}
X-		}
X-		PPPStat->p.ppp_ibytes = 0;
X-		PPPStat->p.ppp_obytes = 0;
X+	get_command(ifreq.ifr_name);
X+	FILE * fptr;
X+	fptr=popen(command,"r+");
X+	fscanf(fptr,"%u%u",&PPPStat->p.ppp_ibytes,&PPPStat->p.ppp_obytes);
X+	pclose(fptr);
X+
X+	if ( ( _isUp && ( PPPStat->p.ppp_ibytes < _rxTotal ) ) ||
X+	     ( !_isUp && ( PPPStat->p.ppp_ibytes == 0 ))
X+	     ) {
X+	  if ( _isUp ) {
X+	    _isUp = false;
X+	    emit linkDown();
X+	    if ( options->cmd().length() ) {
X+			  _retryId = startTimer( options->retry() * 1000 );
X+			  system( (const char*)options->cmd() );
X+	    }
X+	  }
X+	  PPPStat->p.ppp_ibytes = 0;
X+      PPPStat->p.ppp_obytes = 0;
X 	} else if ( !_isUp ) {
X-		_isUp = true;
X-		killTimer( _retryId );
X-		_retryId = -1;
X+	  _isUp = true;
X+	  killTimer( _retryId );
X+	  _retryId = -1;
X 	}
X-
X+	
X 	unsigned int rxDelta = PPPStat->p.ppp_ibytes - _rxTotal;
X 	unsigned int txDelta = PPPStat->p.ppp_obytes - _txTotal;
X 	_rxTotal = PPPStat->p.ppp_ibytes;
X@@ -92,4 +108,17 @@
X 	if ( rxDelta == _rxTotal ) rxDelta = 0;
X 	if ( txDelta == _txTotal ) txDelta = 0;
X 	emit changeStats( rxDelta, txDelta, _rxTotal, _txTotal );
X+	
X+}
X+
X+void get_command(char * interface) {
X+  /*"/usr/bin/netstat -b -I tun0 | /usr/bin/grep Link | awk '{print $(NF-4),$(NF-1)}' */
X+  const char * netstat_command ="/usr/bin/netstat -n -b -I ";
X+  const char * grep_command =" | /usr/bin/grep Link | /usr/bin/awk '{print $(NF-4),$(NF-1)}'";
X+  command[0]='\0';
X+  strcat(command,netstat_command);
X+  strcat(command,interface);
X+  strcat(command,grep_command);
X }
X+
X+
880215203a435fb650fcc61cc1b1c629
echo x - /usr/ports/net/pppload/files/patch-ae
sed 's/^X//' >/usr/ports/net/pppload/files/patch-ae << '7ac312ccd197650ba7214b9a87fca327'
Xdiff -u --new-file pppload-1.0/PPPStats.C.ppp ./PPPStats.C.ppp
X--- pppload-1.0/PPPStats.C.ppp	Wed Dec 31 16:00:00 1969
X+++ ./PPPStats.C.ppp	Wed Jan 28 18:27:30 1998
X@@ -0,0 +1,120 @@
X+// pppload - A PPP Load Monitor
X+// Copyright (C) 1996  Sean Vyain
X+// svyain at mail.tds.net
X+// smvyain at softart.com
X+//
X+// This program is free software; you can redistribute it and/or modify
X+// it under the terms of the GNU General Public License as published by
X+// the Free Software Foundation; either version 2 of the License, or
X+// (at your option) any later version.
X+//
X+// This program is distributed in the hope that it will be useful,
X+// but WITHOUT ANY WARRANTY; without even the implied warranty of
X+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X+// GNU General Public License for more details.
X+//
X+// You should have received a copy of the GNU General Public License
X+// along with this program; if not, write to the Free Software
X+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X+
X+extern "C" {
X+#include <stdlib.h>
X+#include <stdio.h>
X+#include <sys/types.h>
X+#include <sys/select.h>
X+#include <sys/ioctl.h>
X+#include <sys/socket.h>
X+#include <sys/time.h>
X+#include <net/if.h> 
X+#include <net/if_ppp.h> 
X+#include <net/if_var.h>
X+#include <net/if_tun.h>
X+}
X+
X+#include "PPPStats.H"
X+#include "Options.H"
X+#include <iostream.h>
X+
X+
X+typedef struct
X+{
X+  struct ppp_stats  stats;
X+} DclPPPInfo;
X+
X+PPPStats::PPPStats()
X+: _rxTotal( 0 ), _txTotal( 0 ), _isUp( true ), _retryId( -1 )
X+{
X+	if ((_s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
X+        perror("couldn't create IP socket");
X+        exit(1);
X+    }
X+
X+	startTimer( options->interval() * 1000 );
X+}
X+
X+void PPPStats::timerEvent( QTimerEvent* e )
X+{
X+	if ( e->timerId() == _retryId )
X+	{
X+		system( (const char*)options->cmd() );
X+	}
X+	
X+	DclPPPInfo        PPPInfo[1];           // what is this var for?
X+	struct ifpppstatsreq ifreq;             // ifreq      ifreq; 
X+	struct ppp_stats* PPPStat;
X+	struct ppp_stats  LastPPPStat[1];       // what is this var for?
X+	
X+	memset (&ifreq, 0, sizeof (ifreq));
X+//	sprintf (ifreq.ifr_ifrn.ifrn_name, "ppp%d", options->link());
X+	sprintf (ifreq.ifr_name, "tun%d", options->link());
X+
X+//	ifreq.ifr_ifru.ifru_data = (caddr_t) PPPInfo;
X+
X+	PPPStat = & PPPInfo->stats;
X+	memset (LastPPPStat, 0, sizeof (LastPPPStat));
X+
X+
X+
X+//	if ( (ioctl (_s, SIOCDEVPRIVATE, (caddr_t) & ifreq) < 0) ||
X+//	     ( _isUp && ( PPPStat->p.ppp_ibytes < _rxTotal ) ) ||
X+//	     ( !_isUp && ( PPPStat->p.ppp_ibytes == 0 ) )
X+	if ( (ioctl (_s, SIOCGPPPSTATS ,  &ifreq) < 0) ||
X+	     ( _isUp && ( ifreq.stats.p.ppp_ibytes < _rxTotal ) ) ||
X+	     ( !_isUp && ( ifreq.stats.p.ppp_ibytes == 0 ))
X+	     ) {
X+	  if ( _isUp ) {
X+			_isUp = false;
X+			emit linkDown();
X+			if ( options->cmd().length() ) {
X+			  _retryId = startTimer( options->retry() * 1000 );
X+			  system( (const char*)options->cmd() );
X+			}
X+	  }
X+	  PPPStat->p.ppp_ibytes = 0;
X+          PPPStat->p.ppp_obytes = 0;
X+	} else if ( !_isUp ) {
X+	  _isUp = true;
X+	  killTimer( _retryId );
X+	  _retryId = -1;
X+	}
X+
X+ PPPStat->p.ppp_ibytes=ifreq.stats.p.ppp_ibytes;	
X+ PPPStat->p.ppp_obytes=ifreq.stats.p.ppp_obytes;
X+	
X+
X+cout<<ifreq.stats.p.ppp_ibytes<<" "<<ifreq.stats.p.ppp_ipackets<<" "
X+    <<ifreq.stats.p.ppp_ierrors<<" "<<ifreq.stats.p.ppp_obytes <<" "
X+    <<ifreq.stats.p.ppp_opackets<<" "<<ifreq.stats.p.ppp_oerrors<<endl
X+    <<PPPStat->p.ppp_ibytes<<" "<<PPPStat->p.ppp_ipackets<<" "
X+    <<PPPStat->p.ppp_ierrors<<" "<<PPPStat->p.ppp_obytes <<" "
X+    <<PPPStat->p.ppp_opackets<<" "<<PPPStat->p.ppp_oerrors<<endl;
X+	unsigned int rxDelta = PPPStat->p.ppp_ibytes - _rxTotal;
X+	unsigned int txDelta = PPPStat->p.ppp_obytes - _txTotal;
X+	_rxTotal = PPPStat->p.ppp_ibytes;
X+	_txTotal = PPPStat->p.ppp_obytes;
X+	if ( rxDelta == _rxTotal ) rxDelta = 0;
X+	if ( txDelta == _txTotal ) txDelta = 0;
X+	emit changeStats( rxDelta, txDelta, _rxTotal, _txTotal );
X+
X+}
X+
7ac312ccd197650ba7214b9a87fca327
echo x - /usr/ports/net/pppload/files/patch-af
sed 's/^X//' >/usr/ports/net/pppload/files/patch-af << '3c0aab8f7767c55e156d7f12bcc70f6d'
Xdiff -u --new-file pppload-1.0/README.freebsd ./README.freebsd
X--- pppload-1.0/README.freebsd	Wed Dec 31 16:00:00 1969
X+++ ./README.freebsd	Fri Jan 30 20:14:36 1998
X@@ -0,0 +1,45 @@
X+PPPLoad is designed to display the current throughput of a particular
X+PPP link in a format that is similar to xload. Written by Sean Vyain. 
X+
X+This is a FreeBSD port of the linux program called pppload, available at
X+http://sunsite.unc.edu/pub/Linux/system/network/serial/ppp/pppload-1.0.tar.gz
X+
X+Original program homepage at:
X+http://www.geocities.com/SiliconValley/Pines/1029/pppload.html
X+
X+I have modified the FreeBSD port to be able to show the throughput of
X+any network device that will work with netstat, e.g. tun, ppp, ed,
X+etc.  I just wanted a program to nicely display throughput
X+statistics for the tun device.
X+
X+ Examples of usage:
X+For tun0 (tun is the default device,0 is the default link number):
X+% pppload &
X+
X+For first ne2000 clone:
X+% pppload -device ed -link 0 &
X+
X+for ppp2:
X+% pppload -device ppp -link 2 &
X+
X+BUGS
X+Command line is awkward with -device and -link.
X+
X+Can't detect whether the network device is up or not, so any command
X+line options like -cmd -percmd -retry probably don't work.  This is
X+different that the original linux version.
X+
X+Keeps track of all packets network device has ever used, even if it
X+has gone down then up again.  This is also different than the linux
X+version. 
X+
X+Requires awk, grep, and netstat to get the data.  Very short polling
X+time are definitely not recommended.
X+
X+Network interface names are limited to a total of 4 characters or less
X+at the moment, e.g. ppp0 ed3 ze1.
X+
X+
X+Documentation of this FreeBSD port is not complete.
X+
X+
3c0aab8f7767c55e156d7f12bcc70f6d
echo x - /usr/ports/net/pppload/files/patch-ag
sed 's/^X//' >/usr/ports/net/pppload/files/patch-ag << '7effe9f1e00204ddc7d15247a61db956'
Xdiff -u --new-file pppload-1.0/pppload.1 ./pppload.1
X--- pppload-1.0/pppload.1	Tue Sep 10 16:56:20 1996
X+++ ./pppload.1	Fri Jan 30 21:35:55 1998
X@@ -3,7 +3,7 @@
X pppload \- display an xload-style graph of PPP activity
X .SH SYNOPSIS
X .B pppload
X-[\-cmd ppp_cmd] [\-i interval] [\-p period] [\-retry interval] [\-rx] [\-norx]
X+[\-cmd ppp_cmd] [\-i interval] [\-device name] [\-p period] [\-retry interval] [\-rx] [\-norx]
X [\-rxcolor color] [\-tx] [\-notx] [\-txcolor color]
X .SH DESCRIPTION
X .BR pppload
X@@ -28,6 +28,9 @@
X .I "\-h"
X Print command line usage.
X .TP
X+.I "\-device name"
X+Network device to monitor (default: tun)
X+.TP
X .I "\-i interval"
X The statistics polling interval in seconds (default: 5).
X .TP
X@@ -60,3 +63,41 @@
X The name of the color to draw transmit rates in (default: red).
X .SH AUTHOR
X Sean Vyain <svyain at mail.tds.net, smvyain at softart.com>
X+www.geocities.com/SiliconValley/Pines/1029/pppload.html
X+
X+.SH FREEBSD PORT
X+Examples of usage for the FreeBSD port:
X+
X+For tun0 (tun is the default device,0 is the default link number):
X+
X+% pppload &
X+
X+For the first ne2000 ethernet card:
X+
X+% pppload -device ed -link 0 &
X+
X+for the third ppp device:
X+
X+% pppload -device ppp -link 2 &
X+
X+.SH BUGS
X+The port to FreeBSD can't determine when the link is up or down, so 
X+some of the command line options like
X+.I "\-cmd" 
X+.I "\-percmd"
X+may not work.
X+
X+Command line is awkward with -device and -link.
X+
X+Keeps track of all packets network device has ever used, even if it
X+has gone down then up again.  This is different than the linux
X+version. 
X+
X+Requires awk, grep, and netstat to get the data.  Very short polling
X+times are definitely not recommended.
X+
X+Network interface names are limited to a total of 4 characters or less
X+at the moment, e.g. ppp0 ed3 ze1.
X+
X+ 
X+Modified January 1998
7effe9f1e00204ddc7d15247a61db956
echo x - /usr/ports/net/pppload/Makefile
sed 's/^X//' >/usr/ports/net/pppload/Makefile << '667b84aa05c8ab5238c2fcbd8c70a824'
X# New ports collection makefile for:   pppload
X# Date created:        30 January 1998
X# Whom:                Sean Cole <scole at aracnet.com>
X#
X# $FreeBSD: ports/net/pppload/Makefile,v 1.29 2010/03/28 06:41:25 dinoex Exp $
X#
X
XPORTNAME=	pppload
XPORTVERSION=	1.0
XPORTREVISION=	7
XCATEGORIES=	net sysutils
XMASTER_SITES=	${MASTER_SITE_SUNSITE}
XMASTER_SITE_SUBDIR=		system/network/serial/ppp
X
XMAINTAINER=	ports at FreeBSD.org
XCOMMENT=	Display the current throughput of a network device in a window
X
XUSE_QT_VER=	3
XUSE_GMAKE=	yes
XMAKE_ENV=	QT_PREFIX="${QT_PREFIX}" PTHREAD_LIBS="${PTHREAD_LIBS}"
X
XMAN1=		pppload.1
XPLIST_FILES=	bin/pppload
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/pppload ${PREFIX}/bin
X	${INSTALL_MAN} ${WRKSRC}/pppload.1 ${MAN1PREFIX}/man/man1
X
X.include <bsd.port.pre.mk>
X
X.include <bsd.port.post.mk>
667b84aa05c8ab5238c2fcbd8c70a824
echo x - /usr/ports/net/pppload/README.html
sed 's/^X//' >/usr/ports/net/pppload/README.html << 'c1e1e4d64077d56ac48ecc9bd91c5827'
X<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
X
X<html>
X  <head>
X    <title>The FreeBSD Ports Collection (net/pppload)</title>
X  </head>
X
X  <body>
X    <h1>The FreeBSD Ports Collection (net/pppload)</h1>
X    <hr>
X
X    <p>You are now in the directory for the port "net/pppload".</p>
X
X    <p>The package name of this port is "pppload-1.0".</p>
X
X    <p>This is the one-line description for this port:</p>
X    <hr>
X
X    <p>
XDisplay the current throughput of a network device in a window
X    </p>
X    <hr>
X
X    <p>Please read the "<a href="pkg-descr">description file</a>" for a
X    longer description.</p>
X
X    <p>If needed, you may contact the <a href=
X    "mailto:ports at FreeBSD.org">maintainer</a> of this port or the port <a href=
X    "mailto:ports at FreeBSD.org">mailing-list</a>.</p>
X
X    <p>This port requires package(s) "XFree86-libraries-4.3.0_6 Xft-2.1.2 cups-base-1.1.19.0 expat-1.95.6_1 fontconfig-2.2.90_3 freetype2-2.1.5_1 gettext-0.12.1 gmake-3.80_1 imake-4.3.0_1 jpeg-6b_1 lcms-1.09,1 libglut-5.0.2 libiconv-1.9.1_3 libmng-1.0.5_1 perl-5.6.1_15 pkgconfig-0.15.0 png-1.2.5_2 qt-3.2.1 tiff-3.6.0" to build.</p>
X
X    <p>This port requires package(s) "XFree86-libraries-4.3.0_6 Xft-2.1.2 cups-base-1.1.19.0 expat-1.95.6_1 fontconfig-2.2.90_3 freetype2-2.1.5_1 imake-4.3.0_1 jpeg-6b_1 lcms-1.09,1 libglut-5.0.2 libmng-1.0.5_1 perl-5.6.1_15 pkgconfig-0.15.0 png-1.2.5_2 qt-3.2.1 tiff-3.6.0" to run.</p>
X
X    <p>Go to the <a href="../../README.html">top of the ports tree</a> for
X    a summary on how to use the ports collection.</p>
X    <hr>
X
X    <p><a href="../README.html">Go up one level</a> | <a href=
X    "../../README.html">Go to top of ports tree</a></p>
X  </body>
X</html>
X
c1e1e4d64077d56ac48ecc9bd91c5827
echo x - /usr/ports/net/pppload/distinfo
sed 's/^X//' >/usr/ports/net/pppload/distinfo << 'f305ee98d6945752159a2a313869fcb0'
XMD5 (pppload-1.0.tar.gz) = 5f6ef60f2a70386e85655e5b117ee93c
XSHA256 (pppload-1.0.tar.gz) = c09d3038be3bece13ef08a30b52fe249cfc4111793b029f45e3d1f7df84411b4
XSIZE (pppload-1.0.tar.gz) = 15000
f305ee98d6945752159a2a313869fcb0
echo x - /usr/ports/net/pppload/pkg-descr
sed 's/^X//' >/usr/ports/net/pppload/pkg-descr << '692eacb6f9e44d5e8385f0568af37d86'
XThis is a port of pppload, in which the current throughput of a network 
Xdevice is displayed in a x-window.  Any network device whose statistics
Xcan be accessed through netstat can be displayed in a nicely colored graph.
692eacb6f9e44d5e8385f0568af37d86
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list