--- ifstat-1.1.orig/Makefile.in +++ ifstat-1.1/Makefile.in @@ -66,7 +66,7 @@ install-$(TARGET): $(TARGET) $(INSTALL) -d -m 755 $(bindir) - $(INSTALL) -s -m 755 $(TARGET) $(bindir)/$(TARGET) + $(INSTALL) -m 755 $(TARGET) $(bindir)/$(TARGET) $(INSTALL) -d -m 755 $(mandir)/man1 $(INSTALL) -m 644 ifstat.1 $(mandir)/man1/ifstat.1 @@ -77,6 +77,8 @@ $(INSTALL) -m 644 ifstat.h $(includedir)/ifstat.h $(INSTALL) -d -m 755 $(libdir) $(INSTALL) -m 644 $(LIBTARGET) $(libdir)/$(LIBTARGET) + $(INSTALL) -d -m 755 $(mandir)/man1 + $(INSTALL) -m 644 libifstat-config.1 $(mandir)/man1/libifstat-config.1 install-: # dependency when not building library --- ifstat-1.1.orig/configure +++ ifstat-1.1/configure @@ -551,7 +551,7 @@ # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" - CFLAGS="$CFLAGS -O2 -Wall -g" + CFLAGS="$CFLAGS -O2 -W -Wall -g" CPPFLAGS="$CPPFLAGS -DDEBUG" LDFLAGS="$LDFLAGS" fi @@ -560,7 +560,7 @@ if test "${enable_optim+set}" = set; then enableval="$enable_optim" if test "x$enable_debug" != "xyes" ; then - CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -g0" + CFLAGS="$CFLAGS -O3 -W -Wall -fomit-frame-pointer -g0" LDFLAGS="$LDFLAGS -s" else echo "configure: warning: enable-optim and enable-debug are incompatible -- disabling optimizations" 1>&2 --- ifstat-1.1.orig/configure.in +++ ifstat-1.1/configure.in @@ -4,12 +4,12 @@ AC_INIT(ifstat.c) AC_ARG_ENABLE(debug, [ --enable-debug setup flags (gcc) for debugging (default=no)], -CFLAGS="$CFLAGS -O2 -Wall -g" +CFLAGS="$CFLAGS -O2 -W -Wall -g" CPPFLAGS="$CPPFLAGS -DDEBUG" LDFLAGS="$LDFLAGS",) AC_ARG_ENABLE(optim, [ --enable-optim setup flags (gcc) for optimizations (default=no)], if test "x$enable_debug" != "xyes" ; then - CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -g0" + CFLAGS="$CFLAGS -O3 -W -Wall -fomit-frame-pointer -g0" LDFLAGS="$LDFLAGS -s" else AC_MSG_WARN([enable-optim and enable-debug are incompatible -- disabling optimizations]) --- ifstat-1.1.orig/data.c +++ ifstat-1.1/data.c @@ -103,8 +103,8 @@ } void ifstat_set_interface_stats(struct ifstat_data *data, - unsigned long bytesin, - unsigned long bytesout) { + unsigned long long bytesin, + unsigned long long bytesout) { if (data->bout > bytesout || data->bin > bytesin) { if (!ifstat_quiet) ifstat_error("warning: rollover for interface %s, reinitialising.", data->name); --- ifstat-1.1.orig/debian/changelog +++ ifstat-1.1/debian/changelog @@ -1,27 +1,97 @@ +ifstat (1.1-8.1) unstable; urgency=medium + + * Non-maintainer upload. + * Bump d/compat to 9 (Closes: #817499) + + -- Tobias Frost Sat, 24 Sep 2016 16:13:19 +0200 + +ifstat (1.1-8) unstable; urgency=low + + * New maintainer address. + + -- Goswin von Brederlow Thu, 14 Feb 2008 14:23:23 +0100 + +ifstat (1.1-7) unstable; urgency=low + + * debian/control: Remove libsnmp9-dev alternative from Build-Depends + * debian/control: Fix spelling of bandwidth (Closes: #363957) + * debian/rules: Move DH_COMPAT setting to debian/compat + * Makefile.in: don't strip ifstat on install (Closes: #437199) + * debian/rules: fix lintian waring debian-rules-ignores-make-clean-error + * ifstat.1: Replace latin1 character with named character edieresis + * libifstat-config.1: Replace latin1 character with named character edieresis + * snmp.c: fix 2 pointer targets differ in signedness warnings + * Upgrade Standards-Version, no changes required + + -- Goswin von Brederlow Mon, 13 Aug 2007 13:59:12 +0000 + +ifstat (1.1-6) unstable; urgency=low + + * Maintainer upload on behalf of the maintainer as requested. + * Rebuild only with no source changes, to rebuild against libsnmp10 on all + architectures and to clear out binNMUs using the old version number + scheme. + + -- Steve Langasek Wed, 18 Jul 2007 22:54:22 -0700 + +ifstat (1.1-5) unstable; urgency=low + + * libifstat-dev: change section from devel to libdevel. + (sync with override file) + + -- Goswin von Brederlow Thu, 13 Oct 2005 13:37:40 +0200 + +ifstat (1.1-4) unstable; urgency=low + + * Update to new libsnmp9 abi (Closes: 323348) + + -- Goswin von Brederlow Thu, 13 Oct 2005 10:34:27 +0000 + +ifstat (1.1-3) unstable; urgency=low + + * Add copyright and homepage to debian/copyright. + * First upload to debian sid (Closes: #148218) + + -- Goswin von Brederlow Sat, 31 Jul 2004 18:18:32 +0200 + +ifstat (1.1-2) unstable; urgency=low + + * Take over maintainership. + * Swap Build-Depends libsnmp5-dev | libsnmp-dev around. + * Adding upport for 64bit /proc/net/dev counters. + * Update standards version to 3.6.1.0. + * make non native package. + * Replace national chars in changelog. + * Build with --enable-debug. + * Add libifstat-config manpage. + * Clean up compiler warnings. + + -- Goswin von Brederlow Sun, 13 Jun 2004 13:08:32 +0200 + ifstat (1.1-1) unstable; urgency=low * Upstream release. - -- Gaël Roualland Thu, 1 Jan 2004 20:14:35 +0100 + -- Gaël Roualland Thu, 1 Jan 2004 20:14:35 +0100 ifstat (1.0-1) unstable; urgency=low * Upstream release. * Support for building with net-snmp 5.0 and > - -- Gaël Roualland Mon, 21 Apr 2003 23:22:17 +0200 + -- Gaël Roualland Mon, 21 Apr 2003 23:22:17 +0200 ifstat (1.0rc3-1) unstable; urgency=low * Upstream release candidate. - -- Gaël Roualland Sat, 19 Apr 2003 02:50:02 +0200 + -- Gaël Roualland Sat, 19 Apr 2003 02:50:02 +0200 ifstat (1.0rc2-1) unstable; urgency=low * Upstream release candidate. - -- Gaël Roualland Sun, 2 Feb 2003 19:15:53 +0100 + -- Gaël Roualland Sun, 2 Feb 2003 19:15:53 +0100 ifstat (1.0rc1-1) unstable; urgency=low @@ -29,7 +99,7 @@ * Link libifstat-config.1 to undocumented. * Add GPL location in copyright file. - -- Gaël Roualland Sun, 2 Feb 2003 04:22:09 +0100 + -- Gaël Roualland Sun, 2 Feb 2003 04:22:09 +0100 ifstat (1.0pre-1) unstable; urgency=low @@ -37,26 +107,26 @@ * Created new libifstat-dev package * Updated build dependency on libsnmp-dev for future libsnmp packages. - -- Gaël Roualland Fri, 20 Sep 2002 00:41:24 +0200 + -- Gaël Roualland Fri, 20 Sep 2002 00:41:24 +0200 ifstat (0.5-2) unstable; urgency=low * Interim release for debian packaging (Closes: #148218) * Sponsored by Igor Genibel - -- Gaël Roualland Mon, 8 Jul 2002 00:30:44 +0200 + -- Gaël Roualland Mon, 8 Jul 2002 00:30:44 +0200 ifstat (0.5-1) unstable; urgency=low * Upstream release - -- Gaël Roualland Thu, 17 Jan 2002 00:07:12 +0100 + -- Gaël Roualland Thu, 17 Jan 2002 00:07:12 +0100 ifstat (0.4-1) unstable; urgency=low * Initial Release. - -- Gaël Roualland Sun, 6 Jan 2002 01:39:24 +0100 + -- Gaël Roualland Sun, 6 Jan 2002 01:39:24 +0100 Local variables: mode: debian-changelog --- ifstat-1.1.orig/debian/compat +++ ifstat-1.1/debian/compat @@ -0,0 +1 @@ +9 --- ifstat-1.1.orig/debian/control +++ ifstat-1.1/debian/control @@ -1,21 +1,22 @@ Source: ifstat +Section: net Priority: optional -Maintainer: Gaël Roualland -Build-Depends: debhelper (>> 3.0.0), libsnmp-dev | libsnmp5-dev, libssl-dev -Standards-Version: 3.5.2 +Maintainer: Goswin von Brederlow +Build-Depends: debhelper (>= 9), libsnmp-dev +Standards-Version: 3.7.2.2 Package: ifstat Section: net Architecture: any -Depends: ${shlibs:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} Description: InterFace STATistics Monitoring - ifstat is a tool to report network interfaces bandwith just like + ifstat is a tool to report network interfaces bandwidth just like vmstat/iostat do for other system counters. It can monitor local interfaces by polling the kernel counters, or remote hosts interfaces using SNMP. Package: libifstat-dev -Section: devel +Section: libdevel Architecture: any Depends: libsnmp-dev Description: Ifstat Development Files --- ifstat-1.1.orig/debian/copyright +++ ifstat-1.1/debian/copyright @@ -1,7 +1,11 @@ -This package was debianized by Gaël Roualland on +This package was debianized by Gaël Roualland on Sun, 6 Jan 2002 01:39:24 +0100. +The package was adopted by Goswin von Brederlow on +Sun, 13 Jun 2004 13:08:32 +0200. -Copyright: GNU General Public License (GPL) +Copyright: 2002 Gaël Roualland +License: GNU General Public License (GPL) +Homepage: http://gael.roualland.free.fr/ifstat/ On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. --- ifstat-1.1.orig/debian/ifstat.files +++ ifstat-1.1/debian/ifstat.files @@ -1,2 +1,2 @@ usr/bin/ifstat -usr/share/man/man1/* +usr/share/man/man1/ifstat.1 --- ifstat-1.1.orig/debian/libifstat-dev.dirs +++ ifstat-1.1/debian/libifstat-dev.dirs @@ -1,3 +1,4 @@ usr/bin usr/lib usr/include +usr/share/man/man1 --- ifstat-1.1.orig/debian/libifstat-dev.files +++ ifstat-1.1/debian/libifstat-dev.files @@ -1,3 +1,4 @@ usr/bin/libifstat* usr/include/ifstat.h usr/lib/libifstat* +usr/share/man/man1/libifstat-config.1 --- ifstat-1.1.orig/debian/rules +++ ifstat-1.1/debian/rules @@ -5,14 +5,18 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -# This is the debhelper compatability version to use. -export DH_COMPAT=4 +# DEB_BUILD_OPTIONS +# This handles nostrip (via dh_strip) but not noopt. The configure.in +# overrides CFLAGS and needs to be edited to disable optimisation. configure: configure-stamp configure-stamp: dh_testdir + # avoid timestamp scews + touch Makefile.in + touch configure # Add here commands to configure the package. - CPPFLAGS="-D_REENTRANT" ./configure --prefix=/usr --mandir="\$${prefix}/share/man" --infodir="\$${prefix}/share/info" --enable-optim --enable-library --with-libcrypto + CPPFLAGS="-D_REENTRANT" ./configure --prefix=/usr --mandir="\$${prefix}/share/man" --infodir="\$${prefix}/share/info" --enable-debug --enable-library --with-libcrypto touch configure-stamp @@ -31,7 +35,7 @@ rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. - -$(MAKE) distclean + [ ! -f Makefile ] || $(MAKE) distclean dh_clean @@ -57,7 +61,6 @@ dh_installdocs -n dh_installman dh_installchangelogs - dh_undocumented dh_link dh_strip dh_compress --- ifstat-1.1.orig/drivers.c +++ ifstat-1.1/drivers.c @@ -140,6 +140,7 @@ static void examine_interface(struct ifstat_list *ifs, char *name, int ifflags, int iftype) { + (void)iftype; #ifdef IFF_LOOPBACK if ((ifflags & IFF_LOOPBACK) && !(ifs->flags & IFSTAT_LOOPBACK)) return; @@ -242,6 +243,7 @@ static int ioctl_scan_interfaces(struct ifstat_driver *driver, struct ifstat_list *ifs) { int sd; + (void)driver; if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { ifstat_perror("socket"); @@ -256,7 +258,7 @@ #endif #ifdef USE_KSTAT -static int get_kstat_long(kstat_t *ksp, char *name, unsigned long *value) { +static int get_kstat_long(kstat_t *ksp, char *name, unsigned long long *value) { kstat_named_t *data; if ((data = kstat_data_lookup(ksp, name)) == NULL) @@ -277,7 +279,7 @@ *value = data->value.ui64; break; #else - case KSTAT_DATA_LONGLONG: + case KSTAT_DATA_LONG LONGLONG: *value = data->value.ll; break; case KSTAT_DATA_ULONGLONG: @@ -311,7 +313,7 @@ static int kstat_get_stats(struct ifstat_driver *driver, struct ifstat_list *ifs) { - unsigned long bytesin, bytesout; + unsigned long long bytesin, bytesout; struct ifstat_data *cur; kstat_ctl_t *kc = driver->data; kstat_t *ksp; @@ -802,7 +804,7 @@ char buf[1024]; FILE *f; char *iface, *stats; - unsigned long bytesin, bytesout; + unsigned long long bytesin, bytesout; struct ifstat_data *cur; struct proc_driver_data *data = driver->data; char *file; @@ -839,7 +841,7 @@ iface++; if (*iface == '\0') continue; - if (sscanf(stats, "%lu %*u %*u %*u %*u %*u %*u %*u %lu %*u", &bytesin, &bytesout) != 2) + if (sscanf(stats, "%llu %*u %*u %*u %*u %*u %*u %*u %llu %*u", &bytesin, &bytesout) != 2) continue; if ((cur = ifstat_get_interface(ifs, iface)) != NULL) @@ -1326,9 +1328,9 @@ for (i = 0; i < iftable->dwNumEntries; i++) { if ((cur = ifstat_get_interface(ifs, iftable->table[i].bDescr)) != NULL) ifstat_set_interface_stats(cur, - (unsigned long) + (unsigned long long) iftable->table[i].dwInOctets, - (unsigned long) + (unsigned long long) iftable->table[i].dwOutOctets); } return 1; @@ -1346,40 +1348,40 @@ static struct ifstat_driver drivers[] = { #ifdef USE_KSTAT { "kstat", &kstat_open_driver, &ioctl_scan_interfaces, &kstat_get_stats, - &kstat_close_driver }, + &kstat_close_driver, NULL }, #endif #ifdef USE_IFMIB - { "ifmib", NULL, &ifmib_scan_interfaces, &ifmib_get_stats, NULL }, + { "ifmib", NULL, &ifmib_scan_interfaces, &ifmib_get_stats, NULL, NULL }, #endif #ifdef USE_IFDATA { "ifdata", &ifdata_open_driver, &ifdata_scan_interfaces, - &ifdata_get_stats, &ifdata_close_driver }, + &ifdata_get_stats, &ifdata_close_driver, NULL }, #endif #ifdef USE_ROUTE { "route", &route_open_driver, &route_scan_interfaces, - &route_get_stats, &route_close_driver }, + &route_get_stats, &route_close_driver, NULL }, #endif #ifdef USE_KVM { "kvm", &kvm_open_driver, &kvm_scan_interfaces, &kvm_get_stats, - &kvm_close_driver }, + &kvm_close_driver, NULL }, #endif #ifdef USE_PROC { "proc", &proc_open_driver, &ioctl_scan_interfaces, &proc_get_stats, - &proc_close_driver }, + &proc_close_driver, NULL }, #endif #ifdef USE_DLPI { "dlpi", &dlpi_open_driver, &dlpi_scan_interfaces, &dlpi_get_stats, - &dlpi_close_driver }, + &dlpi_close_driver, NULL }, #endif #ifdef USE_WIN32 { "win32", &win32_open_driver, &win32_scan_interfaces, - &win32_get_stats, &win32_close_driver }, + &win32_get_stats, &win32_close_driver, NULL }, #endif #ifdef USE_SNMP { "snmp", &snmp_open_driver, &snmp_scan_interfaces, &snmp_get_stats, - &snmp_close_driver }, + &snmp_close_driver, NULL }, #endif - { NULL } }; + { NULL, NULL, NULL, NULL, NULL, NULL } }; int ifstat_get_driver(char *name, struct ifstat_driver *driver) { int num = 0; --- ifstat-1.1.orig/ifstat.1 +++ ifstat-1.1/ifstat.1 @@ -243,4 +243,4 @@ \&\fIvmstat\fR\|(1), \fIiostat\fR\|(1) .SH "AUTHOR" .IX Header "AUTHOR" -Gaël Roualland, +Ga\[:e]l Roualland, --- ifstat-1.1.orig/ifstat.c +++ ifstat-1.1/ifstat.c @@ -215,7 +215,8 @@ int _sigcont = 0; #ifdef SIGCONT static RETSIGTYPE sigcont(int sig) { - _sigcont = 1; + (void)sig; + _sigcont = 1; RESIGNAL(SIGCONT, &sigcont); } #endif @@ -234,7 +235,7 @@ #define NUM "12345.12" #define NA " n/a" -#define WIDTH (sizeof(NUM) - 1) * 2 + (sizeof(SPACE) - 1) +#define WIDTH ((ssize_t)sizeof(NUM) - 1) * 2 + ((ssize_t)sizeof(SPACE) - 1) #define LEN(options, namelen) (((options) & OPT_FIXEDWIDTH || (namelen) < WIDTH) ? WIDTH : (namelen)) #define FMT(n) (((n) < 1e+5) ? "%8.2f" : (((n) < 1e+6) ? "%.1f" : "%.2e")) --- ifstat-1.1.orig/ifstat.h +++ ifstat-1.1/ifstat.h @@ -35,7 +35,7 @@ struct ifstat_data { char *name; int namelen; - unsigned long obout, obin, bout, bin; + unsigned long long obout, obin, bout, bin; int flags, index; struct ifstat_data *next; }; @@ -72,8 +72,8 @@ void ifstat_free_interface(struct ifstat_data *data); void ifstat_set_interface_stats(struct ifstat_data *data, - unsigned long bytesin, - unsigned long bytesout); + unsigned long long bytesin, + unsigned long long bytesout); void ifstat_set_interface_index(struct ifstat_data *data, int index); --- ifstat-1.1.orig/libifstat-config.1 +++ ifstat-1.1/libifstat-config.1 @@ -0,0 +1,60 @@ +.ad l +.nh +.TH libifstat-config 1 "13 Jun 2004" "libifstat" +.SH NAME +libifstat-config \- get information about the installed version of libifstat +.SH SYNOPSIS +.B libifstat-config +.B [--cflags] +.B [--exec-prefix] +.B [--libs] +.B [--prefix] +.B [--version] +.SH DESCRIPTION +.B libifstat-config +prints the compiler and linker flags required to compile and link programs +that use the +.BR libifstat +Application Programmer Interface. +.SH EXAMPLES +To print the version of the installed distribution of +.BR libifstat , +use: + +.nf + libifstat-config --version +.fi + +To compile a program that calls the +.BR libifstat +Application Programmer Interface, use: + +.nf + cc `libifstat-config --cflags --libs` program.c +.fi + +.SH OPTIONS +.TP +.B --cflags +Print the compiler flags that were used to compile +.BR liblibifstat . +.TP +.B --exec-prefix +Print the directory under which target specific binaries and executables +are installed. +.TP +.B --libs +Print the linker flags that are needed to link a program with +.BR liblibifstat . +.TP +.B --version +Print the version of the +.B libifstat +distribution to standard output. +.SH COPYRIGHT +The license can be found in the file /usr/share/common-licenses/GPL. +.SH AUTHORS +This package was debianized by the upstream Author Ga\[:e]l Roualland +. This manual page was adapted from +the animal-config manual page of the animal package which in turn was +adapted from Magick-config manual page of the ImageMagick package. --- ifstat-1.1.orig/snmp.c +++ ifstat-1.1/snmp.c @@ -91,7 +91,7 @@ static int snmp_get_nextif(struct snmp_session *ss, int index) { oid ifindex[] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 0 }; - int len = sizeof(ifindex) / sizeof(oid); + unsigned int len = sizeof(ifindex) / sizeof(oid); struct snmp_pdu *pdu; struct snmp_pdu *response = NULL; struct variable_list *vars; @@ -139,7 +139,7 @@ struct ifsnmp { char name[S_IFNAMEMAX]; - unsigned long bout, bin; + unsigned long long bout, bin; int flags, index; }; @@ -248,7 +248,7 @@ if (memcmp(ifinfo, vars->name, sizeof(ifinfo) - 2 * sizeof(oid)) != 0) continue; for(i = 0; i < nifaces; i++) { - if (ifsnmp[i].index == vars->name[10]) + if ((signed long long)ifsnmp[i].index == (signed long long)vars->name[10]) break; } @@ -258,11 +258,11 @@ switch (vars->name[9]) { case ifDescr: if (vars->type == ASN_OCTET_STR) { - int count = vars->val_len; + unsigned int count = vars->val_len; if (count >= sizeof(ifsnmp[i].name)) count = sizeof(ifsnmp[i].name) - 1; - strncpy(ifsnmp[i].name, vars->val.string, count); + strncpy(ifsnmp[i].name, (char *)vars->val.string, count); ifsnmp[i].name[count] = '\0'; } break; @@ -361,7 +361,7 @@ snmp_sess_init(&session); session.peername = host; session.version = SNMP_VERSION_1; - session.community = community; + session.community = (unsigned char *)community; session.community_len = strlen(community); if ((data->session = snmp_open(&session)) == NULL) {