--- ipfm-0.11.5.orig/source/pcap.c +++ ipfm-0.11.5/source/pcap.c @@ -128,29 +128,86 @@ } /* - these offsets were taken from queso, written by - Jordi Murgo - see http://apostols.org/projectz/queso/ + these offsets were taken from libpcap source. + See file gencode.c for more information. */ switch(datalink) { + case DLT_ARCNET: + offset = 6; + break; case DLT_EN10MB: - offset = 14; break; - case DLT_NULL: - case DLT_PPP: - offset = 4; break; + offset = 14; + break; case DLT_SLIP: - offset = 16; break; -#ifndef __OS_OPENBSD__ - case DLT_RAW: - offset = 0; break; + offset = 16; + break; case DLT_SLIP_BSDOS: + offset = 24; + break; + case DLT_NULL: + case DLT_LOOP: + offset = 4; + break; + case DLT_PPP: + case DLT_C_HDLC: /* BSD/OS Cisco HDLC */ + case DLT_PPP_SERIAL: /* NetBSD sync/async serial PPP */ + offset = 4; + break; +#ifdef DLT_PPP_ETHER + case DLT_PPP_ETHER: + offset = 8; + break; +#endif case DLT_PPP_BSDOS: - offset = 24; break; -#endif /* __OS_OPENBSD__ */ - case DLT_ATM_RFC1483: - offset = 8; break; + offset = 24; + break; + /* +[RC, 2002/10/20] Commented out FDDI since there is a strange pad complication +on NetBSD, DEC OSF/1 aka Digital Unix aka Tru64 Unix and Ultrix. +If someone yells because she needs FDDI, we'll have a closer look... + + case DLT_FDDI: + * + * FDDI doesn't really have a link-level type field. + * We set "off_linktype" to the offset of the LLC header. + * + * To check for Ethernet types, we assume that SSAP = SNAP + * is being used and pick out the encapsulated Ethernet type. + * XXX - should we generate code to check for SNAP? + * + offset = 21; +#ifdef PCAP_FDDIPAD + offset += pcap_fddipad; +#endif + break; + */ case DLT_IEEE802: - offset = 22; break; + break; + case DLT_IEEE802_11: + offset = 30; + break; +#ifdef DLT_PRISM_HEADER + case DLT_PRISM_HEADER: + offset = 144+30; + break; +#endif + case DLT_ATM_RFC1483: + offset = 8; + break; + case DLT_RAW: + offset = 0; + break; + case DLT_ATM_CLIP: /* Linux ATM defines this */ + offset = 8; + break; + case DLT_LINUX_SLL: /* fake header for Linux cooked socket */ + offset = 16; + break; +#ifdef DLT_LTALK + case DLT_LTALK: + offset = 0; + break; +#endif default: fprintf(stderr, "[pcap] Unknown datalink type : %d.", datalink); return 0; --- ipfm-0.11.5.orig/doc/ipfm.conf.man +++ ipfm-0.11.5/doc/ipfm.conf.man @@ -37,7 +37,7 @@ uses local and global variables, so it can manage multiple logs (different time delay, different hosts, different log filename ...) at the same time. -Global variables will be used for all logs and local variables will only be used in the log beeing defined. +Global variables will be used for all logs and local variables will only be used in the log being defined. .SH GLOBAL VARIABLES .SS @@ -53,7 +53,7 @@ .B Syntax : [UTC|local] -This decides if IPFM will use UTC or local time in its outputs (log filename andthe timesamp inside the file). Default is local. +This decides if IPFM will use UTC or local time in its outputs (log filename and the timestamp inside the file). Default is local. Note that IPFM works internally with UTC, and that the dates entered in the config file are UTC (see AFTER Syntax). --- ipfm-0.11.5.orig/debian/rules +++ ipfm-0.11.5/debian/rules @@ -13,8 +13,9 @@ build-stamp: dh_testdir - ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc - # Add here commands to compile the package. + ./configure --prefix=/usr --mandir=/usr/share/man \ + --sysconfdir=/etc --localstatedir=/var + $(MAKE) touch build-stamp @@ -26,6 +27,7 @@ # Add here commands to clean up after the build process. -$(MAKE) distclean + rm -f debian/examples debian/conffiles dh_clean @@ -36,8 +38,16 @@ dh_clean dh_installdirs - # Add here commands to install the package into debian/tmp. - $(MAKE) ROOT=`pwd`/debian/tmp install + # Add here commands to install the package into debian/ipfm. + $(MAKE) ROOT=`pwd`/debian/ipfm install + + # Add a warning line to the configuration file + echo "# Remove this line when finished tuning the configuration" \ + > debian/ipfm/foo + echo "DISABLED" >> debian/ipfm/foo + echo "" >> debian/ipfm/foo + cat debian/ipfm/etc/ipfm.conf >> debian/ipfm/foo + mv -f debian/ipfm/foo debian/ipfm/etc/ipfm.conf touch install-stamp @@ -51,20 +61,18 @@ dh_testdir dh_testroot dh_installdocs - dh_installexamples + dh_installexamples ipfm.conf.sample # dh_installmenu # dh_installemacsen dh_installinit # dh_installcron - dh_installmanpages + dh_installman # dh_undocumented dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms -# You may want to make some executables suid here -# dh_suidregister # dh_makeshlibs dh_installdeb # dh_perl --- ipfm-0.11.5.orig/debian/control +++ ipfm-0.11.5/debian/control @@ -1,13 +1,13 @@ Source: ipfm Section: net Priority: optional -Maintainer: Robert CHERAMY -Build-depends: libpcap-dev, flex, bison -Standards-Version: 3.1.1 +Maintainer: Sam Hocevar (Debian packages) +Build-Depends: libpcap-dev, bison, flex-old, debhelper (>= 4.0) +Standards-Version: 3.6.1.1 Package: ipfm Architecture: any Depends: ${shlibs:Depends} -Description: A bandwidth analysis tool +Description: a bandwidth analysis tool IPFM counts how much data was sent and received by specified hosts through an Internet link. --- ipfm-0.11.5.orig/debian/compat +++ ipfm-0.11.5/debian/compat @@ -0,0 +1 @@ +4 --- ipfm-0.11.5.orig/debian/init +++ ipfm-0.11.5/debian/init @@ -1,4 +1,11 @@ #! /bin/sh +### BEGIN INIT INFO +# Provides: ipfm +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/ipfm @@ -12,6 +19,11 @@ case "$1" in start) echo -n "Starting $DESC: " + if grep -q '^ *DISABLED' /etc/ipfm.conf + then + echo "disabled, please tune /etc/ipfm.conf." + exit 0 + fi if start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON then @@ -40,6 +52,11 @@ start-stop-daemon --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON sleep 1 + if grep -q '^ *DISABLED' /etc/ipfm.conf + then + echo "disabled, please tune /etc/ipfm.conf." + exit 0 + fi start-stop-daemon --start --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON echo "$NAME." --- ipfm-0.11.5.orig/debian/copyright +++ ipfm-0.11.5/debian/copyright @@ -3,10 +3,10 @@ It was downloaded from http://www.via.ecp.fr/~tibob/ipfm/ -Upstream Author(s): Robert CHERAMY and - Andres KRAPF +Upstream Authors: Robert CHERAMY + Andres KRAPF Copyright: GNU General Public License. -On Debian/GNU Linux systems, a copy of the GNU GPL can be found in +On Debian GNU/Linux systems, a copy of the GNU GPL can be found in /usr/share/common-licenses/GPL. --- ipfm-0.11.5.orig/debian/changelog +++ ipfm-0.11.5/debian/changelog @@ -1,15 +1,82 @@ +ipfm (0.11.5-4.1) unstable; urgency=low + + * Non-maintainer upload to solve release goal. + * Add LSB dependency header to init.d scripts (Closes: #466653). + * Fix typos in manual page (Closes: #362090). Based on patch + from A Costa. + + -- Petter Reinholdtsen Wed, 2 Apr 2008 08:20:22 +0200 + +ipfm (0.11.5-4) unstable; urgency=low + + * Fixed major package breakage caused by a wrong DH_COMPAT value. + + -- Sam Hocevar (Debian packages) Sun, 25 Jul 2004 22:22:10 +0200 + +ipfm (0.11.5-3) unstable; urgency=low + + * debian/control: + + Set policy to 3.6.1.1. + * debian/rules: + + Use dh_installman instead of dh_installmanpages. + + -- Sam Hocevar (Debian packages) Fri, 23 Jul 2004 13:38:25 +0200 + +ipfm (0.11.5-2) unstable; urgency=low + + * Set policy to 3.5.10. + * We build-depend on flex-old instead of flex. + + -- Sam Hocevar (Debian packages) Sat, 31 May 2003 00:43:41 +0200 + +ipfm (0.11.5-1) unstable; urgency=low + + * Version number is now in sync with upstream. + * Fixed a spelling error in the copyright file. + * Added support for Linux cooked capture datalink (Closes: #167040). + * If the default configuration file is present, we do not start ipfm until + it was properly tuned (Closes: #183479). + * Updated Standards-Version. + + -- Samuel Hocevar Sat, 15 Mar 2003 17:29:56 +0100 + +ipfm (0.11.4-3) unstable; urgency=low + + * Fixed minor grammar errors in the sample configuration (Closes: #146409). + * Rebuilt against libpcap0.7 to remove dependency on libpcap0 which got + removed from unstable (Closes: #156204). + + -- Samuel Hocevar Sun, 18 Aug 2002 12:16:58 +0200 + +ipfm (0.11.4-2.1) unstable; urgency=low + + * Non maintainer upload + * Rebuilt with new libpcap to remove dependency on libpcap0, which I + got removed from unstable by accident. Sorry about this... + + -- Torsten Landschoff Sat, 10 Aug 2002 11:37:02 +0200 + +ipfm (0.11.4-2) unstable; urgency=low + + * Fixed build dependencies (Closes: #123754). + + -- Samuel Hocevar Fri, 14 Dec 2001 02:38:26 +0100 + ipfm (0.11.4-1) unstable; urgency=low + * New upstream release. - * Fixed wrong buffer clearing date + * Fixed wrong buffer clearing date. + * Fixed build dependencies (Closes: #100807). - -- Robert CHERAMY Sun, 7 Jan 2001 19:28:56 +0100 + -- Samuel Hocevar Sun, 7 Jan 2001 19:28:56 +0100 ipfm (0.11.3-1) unstable; urgency=low + * New upstream release. * fixed default DUMPINTERVAL * fixed Clean() function (last release introduced a possible segfault) - -- Robert CHERAMY Wed, 13 Dec 2000 00:43:09 +0100 + -- Samuel Hocevar Wed, 13 Dec 2000 00:43:09 +0100 ipfm (0.11.2-1) unstable; urgency=low --- ipfm-0.11.5.orig/debian/prerm.debhelper +++ ipfm-0.11.5/debian/prerm.debhelper @@ -0,0 +1,9 @@ +# Automatically added by dh_installinit +if [ -x "/etc/init.d/ipfm" ]; then + if [ -x /usr/sbin/invoke-rc.d ] ; then + invoke-rc.d ipfm stop || exit 0 + else + /etc/init.d/ipfm stop || exit 0 + fi +fi +# End automatically added section --- ipfm-0.11.5.orig/debian/postrm.debhelper +++ ipfm-0.11.5/debian/postrm.debhelper @@ -0,0 +1,5 @@ +# Automatically added by dh_installinit +if [ "$1" = "purge" ] ; then + update-rc.d ipfm remove >/dev/null || exit 0 +fi +# End automatically added section --- ipfm-0.11.5.orig/debian/postinst.debhelper +++ ipfm-0.11.5/debian/postinst.debhelper @@ -0,0 +1,10 @@ +# Automatically added by dh_installinit +if [ -x "/etc/init.d/ipfm" ]; then + update-rc.d ipfm defaults >/dev/null + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d ipfm start || exit 0 + else + /etc/init.d/ipfm start || exit 0 + fi +fi +# End automatically added section --- ipfm-0.11.5.orig/debian/docs +++ ipfm-0.11.5/debian/docs @@ -1,3 +1,2 @@ TODO HISTORY -INSTALL --- ipfm-0.11.5.orig/debian/substvars +++ ipfm-0.11.5/debian/substvars @@ -0,0 +1 @@ +shlibs:Depends=libc6 (>= 2.3.2.ds1-4), libpcap0.7