--- wmppp.app-1.3.0.orig/wmppp/wmppp.c +++ wmppp.app-1.3.0/wmppp/wmppp.c @@ -187,12 +187,12 @@ /* Defines */ /***********/ -#define START_ACTION (NULL) -#define STOP_ACTION (NULL) +#define START_ACTION "/usr/bin/pon" +#define STOP_ACTION "/usr/bin/poff" #define SPEED_ACTION (NULL) -#define IFDOWN_ACTION (NULL) +#define IFDOWN_ACTION "/usr/bin/poff -r" -#define STAMP_FILE "/var/run/ppp0.pid" +#define STAMP_FILE_PRE "/var/run/wmppp." /* Defines voor alle coordinate */ @@ -310,10 +310,15 @@ usage(); exit(1); } + /* following removed to allow experiments with + * new devices, i.e. ippp + */ +#if 0 if (strncmp(argv[i+1], "ppp", 3)) { usage(); exit(1); } +#endif active_interface = argv[i+1]; i++; break; @@ -357,6 +362,7 @@ char *stop_action = NULL; char *speed_action = NULL; char *ifdown_action = NULL; +char *stamp_file = NULL; void wmppp_routine(int argc, char **argv) { @@ -365,6 +371,7 @@ { "stop", &stop_action }, { "speed", &speed_action }, { "ifdown", &ifdown_action }, + { "stampfile", &stamp_file }, { NULL, NULL } }; @@ -406,6 +413,10 @@ if (STOP_ACTION) stop_action = strdup(STOP_ACTION); if (SPEED_ACTION) speed_action = strdup(SPEED_ACTION); if (IFDOWN_ACTION) ifdown_action = strdup(IFDOWN_ACTION); + if (STAMP_FILE_PRE) { + sprintf (temp, "%s%s", STAMP_FILE_PRE, active_interface); + stamp_file = strdup (temp); + } strcpy(temp, "/etc/wmppprc"); parse_rcfile(temp, wmppp_keys); @@ -415,7 +426,7 @@ strcat(temp, "/.wmppprc"); parse_rcfile(temp, wmppp_keys); - strcpy(temp, "/etc/wmppp.fixed"); + strcpy(temp, "/etc/wmppprc.fixed"); parse_rcfile(temp, wmppp_keys); /* Open the display */ @@ -478,7 +489,7 @@ if (!starttime) { starttime = currenttime; - if (stat(STAMP_FILE, &st) == 0) + if (stat(stamp_file, &st) == 0) starttime = st.st_mtime; SetOnLED(LED_PPP_POWER); @@ -759,6 +770,11 @@ void PrintLittle(int i, int *k) { switch (i) { + case -2: + *k -= 5; + /* Print the "k" letter */ + copyXPMArea(11*5-5, 86, 4, 9, *k, 48); + break; case -1: *k -= 5; copyXPMArea(13*5-5, 86, 4, 9, *k, 48); @@ -791,9 +807,12 @@ pclose(fp); +#if 0 if ((p=strstr(temp, "CONNECT"))) { linespeed = atoi(p + 8); } +#endif + linespeed = atoi(temp); k = 30; @@ -824,6 +843,13 @@ k = 30; + /* If speed is greater than 99999, display it in K */ + if (speed > 99999 ) + { + speed /= 1024 ; + PrintLittle(-2, &k) ; + } + do { PrintLittle(speed % 10, &k); speed /= 10; --- wmppp.app-1.3.0.orig/debian/README.debian +++ wmppp.app-1.3.0/debian/README.debian @@ -0,0 +1,15 @@ +wmppp.app for DEBIAN +-------------------- + +This is Debian GNU/Linux's prepackaged version of wmppp.app, a load +monitor tool for your PPP connection. It's designed with the NeXTStep +look in mind. + +wmppp installs /etc/ppp/ip-up.d/00wmppp and /etc/ppp/ip-down.d/00wmppp. +These files are necessary for the proper operation of wmppp. The first +one touches /var/run/wmppp.$PPP_IFACE and the other one removes +it. When wmppp finds the file, it will display the online indicator, +and will use its modification time to calculate the enlapsed time +since the connection came up. + +Marcelo E. Magallon , Wed, 1 May 1998 09:11:00 -0600 --- wmppp.app-1.3.0.orig/debian/changelog +++ wmppp.app-1.3.0/debian/changelog @@ -0,0 +1,111 @@ +wmppp.app (1.3.0-8) unstable; urgency=low + + * Updated build-dependencies for xlibs split (closes: #346983). + * Accepted patch from jguiton to display very high speeds with a "k" + suffix (closes: #328699). + + -- Chris Waters Wed, 18 Jan 2006 16:00:09 -0800 + +wmppp.app (1.3.0-7) unstable; urgency=low + + * Updated for newer standards. + + -- Chris Waters Thu, 22 May 2003 21:15:37 -0700 + +wmppp.app (1.3.0-6) unstable; urgency=low + + * Re-added patches that got dropped on the floor when I switched to + using CVS, including the all-important patch to use pon/poff by + default (closes:#138939). + + -- Chris Waters Mon, 18 Mar 2002 13:26:54 -0800 + +wmppp.app (1.3.0-5) unstable; urgency=low + + * Added some patches by Juan Cespedes which may + allow ISDN devices to be used. Also included Juan's patches for + stampfile handling. (closes:#97509) + + -- Chris Waters Fri, 15 Mar 2002 19:17:41 -0800 + +wmppp.app (1.3.0-4) unstable; urgency=low + + * Added missing dependency on ppp (bad, bad, bad!) + + -- Chris Waters Mon, 16 Apr 2001 23:46:15 -0700 + +wmppp.app (1.3.0-3) unstable; urgency=low + + * Fixed build-dependency on obsolete xpm4g-dev package (closes:#92683) + * Rebuilt against XFree86-4. + * Moved binary and man page out of X11R6 tree, as per new policy. + * Changed debian/rules to use the new dh_installman, and therefore added + versioned build-depends on debhelper. + + -- Chris Waters Sun, 8 Apr 2001 12:49:13 -0700 + +wmppp.app (1.3.0-2) unstable; urgency=low + + * new maintainer (closes: #76961) + * corrected directories mentioned in README.Debian (closes: #72928) + * recompiled (again) against modern xpm4g package (closes: #67955) + * updated file locations for FHS-compatibility. + * updated standards-version in debian/control. + * brought the man page up-to-date, adding new options and correcting + a few minor details here and there. + + -- Chris Waters Tue, 14 Nov 2000 00:24:57 -0800 + +wmppp.app (1.3.0-1.1) unstable; urgency=low + + * NMU by Branden Robinson . + * Recompile against modern xpm4g package to get proper shared library + dependency and permit this package to be installed with forthcoming + XFree86 4.x packages, which include libXpm. + * debian/control: added Build-Depends + + -- Branden Robinson Mon, 23 Oct 2000 14:59:01 -0500 + +wmppp.app (1.3.0-1) unstable; urgency=low + + * New upstream release + * Some patches from 1.2 incorporated upstream + * Patched wmppp/wmppp.c to expect a NUMBER from getmodemspeed, and not + the whole connect line + * Modified debian/rules to cope with new source layout + + -- Marcelo E. Magallon Sun, 20 Sep 1998 12:41:40 -0600 + +wmppp.app (1.2p1-1) unstable; urgency=low + + * New upstream version + * Redid the patch to parse configuration files. + + -- Marcelo E. Magallon Sat, 2 May 1998 17:08:52 -0600 + +wmppp.app (1.2-1) unstable; urgency=low + + * New upstream version + * Some of the patches to 1.1 incorportated upstream + * Modified wmppp a bit to make it work with Debian PPP scripts. + * Wrote real manpages for wmppp and wmifs + * Modified configuration file parsing to make it more flexible and less + dictatorial (sent upstream) + + -- Marcelo E. Magallon Fri, 1 May 1998 20:28:43 -0600 + +wmppp.app (1.1-1) unstable; urgency=low + + * Initial release + * Modified to work with Debian PPP scripts and Debian ip-{up,dow}.d + structure. + * Patches to let it connect to a PPP session not started by WMPPP (sent + upstream) + * Patches to pass it some things on the command line (programs to + excecute) (sent upstream) + * Patches for wmifs to let it work with arbitrary interfaces, not just + eth? and ppp0 (sent upstream) + + -- Marcelo E. Magallon Sat, 11 Apr 1998 16:44:31 -0600 + + --- wmppp.app-1.3.0.orig/debian/control +++ wmppp.app-1.3.0/debian/control @@ -0,0 +1,20 @@ +Source: wmppp.app +Section: net +Priority: optional +Maintainer: Chris Waters +Standards-Version: 3.6.2 +Build-Depends: libx11-dev, libxext-dev, libxpm-dev, debhelper (>= 4.0.0) + +Package: wmppp.app +Architecture: any +Section: net +Priority: optional +Depends: ppp, ${shlibs:Depends} +Suggests: wmaker +Description: PPP dial control and network load monitor with NeXTStep look + wmppp.app provides a PPP activator and network load monitor on a 64x64 mini + window. With wmppp you can monitor the total traffic as well as the outbound + and inbound traffic. It is designed to work with the WindowMaker dock, but + will work great with other window managers as well. + . + Now with experimental ippp device support. --- wmppp.app-1.3.0.orig/debian/compat +++ wmppp.app-1.3.0/debian/compat @@ -0,0 +1 @@ +4 --- wmppp.app-1.3.0.orig/debian/copyright +++ wmppp.app-1.3.0/debian/copyright @@ -0,0 +1,11 @@ +This package was debianized by Marcelo Magallon +on Sat, 11 Apr 1998 16:02:00 -0600 + +It was downloaded from http://www.xs4all.nl/~warp/wmppp.html +(http://www.xs4all.nl/~warp/files/wmppp.app-1.2.tar.gz) + + WMPPP.app is copyright (c) 1997, 1998 by Martijn Pieterse and + Antoine Nulle licensed through the GNU General Public License. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- wmppp.app-1.3.0.orig/debian/dirs +++ wmppp.app-1.3.0/debian/dirs @@ -0,0 +1,3 @@ +etc/ppp/ip-up.d +etc/ppp/ip-down.d +usr/bin --- wmppp.app-1.3.0.orig/debian/docs +++ wmppp.app-1.3.0/debian/docs @@ -0,0 +1,4 @@ +BUGS +README +HINTS +TODO --- wmppp.app-1.3.0.orig/debian/examples +++ wmppp.app-1.3.0/debian/examples @@ -0,0 +1,3 @@ +wmppp/system.wmppprc +wmppp/user.wmppprc +debian/getmodemspeed --- wmppp.app-1.3.0.orig/debian/getmodemspeed +++ wmppp.app-1.3.0/debian/getmodemspeed @@ -0,0 +1,18 @@ +#!/bin/sh + +# this is an example getmodemspeed script +# I add '-r /var/tmp/modem.speed' to the 'connect' line in +# /etc/ppp/peers/provider and a 'REPORT CONNECT' line to +# /etc/chatscripts/provider. From my USR modem I get something like this: +# +# Opening "/var/tmp/modem.speed"... +# chat: Sep 20 07:34:42 CONNECT nnnnn/ARQ/V32/LAPM/V42BIS +# Closing "/var/tmp/modem.speed". +# +# I'm interested in the "nnnnn" part. The following works for me, but YMMV + +grep CONNECT /var/tmp/modem.speed | \ + tail -1 | \ + sed -e 's,^.*CONNECT[[:blank:]]*\([[:digit:]]*\).*$,\1,' + +exit 0 --- wmppp.app-1.3.0.orig/debian/ip-down +++ wmppp.app-1.3.0/debian/ip-down @@ -0,0 +1,5 @@ +#!/bin/sh + +stamp_file=/var/run/wmppp.$PPP_IFACE + +[ -f $stamp_file ] && rm $stamp_file --- wmppp.app-1.3.0.orig/debian/ip-up +++ wmppp.app-1.3.0/debian/ip-up @@ -0,0 +1,3 @@ +#!/bin/sh + +touch /var/run/wmppp.$PPP_IFACE --- wmppp.app-1.3.0.orig/debian/menu +++ wmppp.app-1.3.0/debian/menu @@ -0,0 +1,4 @@ +?package(wmppp.app):needs="x11" \ + section="Apps/Net" \ + title="WMppp" \ + command="/usr/bin/wmppp" --- wmppp.app-1.3.0.orig/debian/rules +++ wmppp.app-1.3.0/debian/rules @@ -0,0 +1,51 @@ +#!/usr/bin/make -f + +DSTDIR = debian/wmppp.app + +build: build-stamp + +build-stamp: + dh_testdir + cd wmppp && $(MAKE) + touch build-stamp + +clean: + dh_testdir + dh_testroot + -cd wmppp && $(MAKE) clean + -rm -f build-stamp debian/conffiles + dh_clean + +# Build architecture-independent files here. +binary-indep: build +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + install -s -m 755 wmppp/wmppp $(DSTDIR)/usr/bin/wmppp + install -m 755 debian/ip-up $(DSTDIR)/etc/ppp/ip-up.d/00wmppp + install -m 755 debian/ip-down $(DSTDIR)/etc/ppp/ip-down.d/00wmppp + dh_installdocs + dh_installexamples + dh_installmenu + dh_installman debian/wmppp.1 + dh_installchangelogs CHANGES + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch +ok: binary +.PHONY: build clean binary-indep binary-arch binary ok --- wmppp.app-1.3.0.orig/debian/wmppp.1 +++ wmppp.app-1.3.0/debian/wmppp.1 @@ -0,0 +1,103 @@ +.\" -*-Nroff-*- +.\" +.TH wmppp.app 1 "September 1998" "Debian Project" "Debian GNU/Linux" +.SH NAME +wmppp \- Graphically monitor the average PPP load +.P +.SH SYNOPSIS +.B wmppp +.RB [\| \-display +.IR \|] +.RB [\| \-t \|] +.RB [\| \-u +.IR \|] +.RB [\| \-i +.IR \|] +.RB [\| \-h \|] +.RB [\| \-v \|] +.SH DESCRIPTION +\fBwmppp.app\fP displays a dynamic representation of the load on the +PPP line on a 64x64 miniwindow. It also starts and stops the +connection and displays the time enlapsed since the it came up. The +traffic on the interface is also monitored. +.SH OPTIONS +.TP +.B \-display +name of display to use +.TP +.B \-t +sets the on-line timer to display MM:SS instead of the default HH:MM. +.TP +.B \-u +sets the frequency, in seconds, for updates to the display. Valid +range is 1-10, default value is 5. +.TP +.B \-i +choose the net device (ppp1, ippp0, etc.) to monitor. (Note that this +feature is EXPERIMENTAL and should be used with caution. Bug reports +are welcomed.) +.TP +.B \-h +displays a command line summary +.TP +.B \-v +displays the version number. +.SH CONFIGURATION +The configuration file (see below) may contain any of the following +key-value pairs. The format is \fIkey: value\fP. +.TP +.I start +The program that starts the connection +.TP +.I stop +The program that stops the connection +.TP +.I speed +This program reports the speed of the connection. This program should +output \fI\fP, that is, a \fInumber\fP is expected and not the +whole \"CONNECT\" line the modem outputs. +.TP +.I ifdown +This program is run if the line goes down, and the \fIstop\fP program +hasn't been run. (Redial program) +.TP +.I stampfile +The modification time of this file is used to calculate the amount of +time the connection has been up. Something like \fItouch \fP +should be run for this to work. +.SH FILES +.TP +/var/run/wmppp.\fIppp0\fP +this is the stamp file use to determine the ammount of time enlapsed +since the connection came up. This file should be managed by the ip-up +and ip-down scripts. On Debian systems, \fI/etc/ppp/ip-up.d/00wmppp\fP +creates the file, and \fI/etc/ppp/ip-down.d/00wmppp\fP removes it. +.TP +/etc/wmppprc +System wide defaults +.TP +$HOME/.wmppprc +User defined settings +.TP +/etc/wmppprc.fixed +System wide fixed options, this overrides the user settings +.SH AUTHORS +\fBwmppp.app\fP was written by \fIMartijn Pieterse +\fP and \fIAntoine Nulle \fP, and +it's based on work by \fIBeat Christen \fP +(asclock) and \fIMichael Callahan \fP, \fIAl +Longyear longyear@netcom.com\fP and \fIPaul Mackerras +\fP (pppstats). +.P +Email regarding wmppp should be sent to +\fIdockapps@windowmaker.kimitsu.com\fP. +.P +This manpage was written by \fIMarcelo Magallon +