Date: Tue, 9 Dec 2003 23:41:20 +0100 (CET) From: flag@gufi.org To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/60095: [maintainer update] Message-ID: <20031209224120.573C8208F@willow.homeunix.org> Resent-Message-ID: <200312092240.hB9MeF2c013957@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 60095 >Category: ports >Synopsis: [maintainer update] >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Tue Dec 09 14:40:15 PST 2003 >Closed-Date: >Last-Modified: >Originator: Dark Schneider >Release: FreeBSD 5.1-CURRENT i386 >Organization: Gufi >Environment: System: FreeBSD southcross.skynet.org 5.1-CURRENT FreeBSD 5.1-CURRENT #5: Fri Nov 14 12:09:45 CET 2003 toor@southcross.skynet.org:/usr/obj/usr/src/sys/SOUTHCROSS i386 >Description: Mantainer update to make the port works with recent CURRENT >How-To-Repeat: >Fix: delete patch-aa and patch-ab in the cvs diff -ruN wmnet2.bak/Makefile wmnet2/Makefile --- wmnet2.bak/Makefile Sun Oct 26 14:34:10 2003 +++ wmnet2/Makefile Tue Dec 9 23:10:36 2003 @@ -7,16 +7,16 @@ PORTNAME= wmnet2 PORTVERSION= 1.06 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net MASTER_SITES= http://www.digitalkaos.net/linux/wmnet/download/ DISTNAME= wmnet-${PORTVERSION} -MAINTAINER= flag@libero.it -COMMENT= A cool network monitor for WindowMaker +MAINTAINER= flag@gufi.org +COMMENT= A nice network monitor for WindowMaker USE_IMAKE= yes -MAN1= wmnet2.1 +MAN1= wmnet.1 .include <bsd.port.mk> diff -ruN wmnet2.bak/files/patch-aa wmnet2/files/patch-aa --- wmnet2.bak/files/patch-aa Sun Oct 26 14:34:10 2003 +++ wmnet2/files/patch-aa Tue Dec 9 22:56:57 2003 @@ -1,37 +1,198 @@ ---- drivers.c.orig Thu May 4 20:34:29 2000 -+++ drivers.c Mon Feb 18 12:54:45 2002 -@@ -15,6 +15,7 @@ - #include<X11/Xlib.h> - #include<fcntl.h> - #include<sys/types.h> -+#include <sys/time.h> - #include<sys/stat.h> - #include<sys/socket.h> - #include<unistd.h> -@@ -24,6 +25,8 @@ - /* For FreeBSD */ +--- Imakefile Fri May 5 02:34:29 2000 ++++ Imakefile Tue Nov 11 10:54:42 2003 +@@ -10,9 +10,12 @@ + LOCAL_LIBRARIES = $(XLIB) -lm + #endif + +-#if defined (FreeBSDArchitecture) || defined (OpenBSDArchitecture) ++#if defined (OpenBSDArchitecture) + LOCAL_LIBRARIES = $(XLIB) -lm -lkvm + INSTPGMFLAGS = -s -g kmem -m 2755 ++#elif defined (FreeBSDArchitecture) ++LOCAL_LIBRARIES = $(XLIB) -lm ++INSTPGMFLAGS = -s -m 0755 + #endif + + LINTLIBS = $(LINTXLIB) +--- config.h Fri May 5 02:34:29 2000 ++++ config.h Tue Nov 11 10:59:05 2003 +@@ -1,6 +1,6 @@ +-#if defined (__FreeBSD__) || defined (__OpenBSD__) ++#if defined (__OpenBSD__) + +-/* Our only FreeBSD driver, this goes straight into kernel memory ++/* Our only OpenBSD driver(old FreeBSD-4.x driver), this goes straight into kernel memory + * and reads the raw structures from right underneath the kernel using the + * kvm library. This made the code a require a little more thought, but + * the end result is a statistics driver thats faster than the linux ones +@@ -12,7 +12,11 @@ + + #endif + ++#if defined (__FreeBSD__) + ++#define USE_SYSCTL ++ ++#endif + + #ifdef linux + +--- drivers.c Fri May 5 02:34:29 2000 ++++ drivers.c Wed Nov 12 11:42:40 2003 +@@ -21,7 +21,7 @@ + #include"config.h" + + +-/* For FreeBSD */ ++/* For OpenBSD */ #ifdef USE_KVM #include<net/if.h> -+#include <net/if_var.h> -+#include <net/if_types.h> #include<kvm.h> - #include<nlist.h> +@@ -37,6 +37,22 @@ + int kvm_updateStats(void); + #endif /* USE_KVM */ -@@ -455,6 +458,8 @@ - unsigned long ifnet_addr = ifnet_savedaddr; - char devname[16]; - int flag = 0; -+ rx = False; -+ tx = False; - while (ifnet_addr && flag != (ACCOUNT_IN_FOUND|ACCOUNT_OUT_FOUND)) { - kvm_read(kvmfd, ifnet_addr, buffer, sizeof(struct ifnet)); - #ifdef __OpenBSD__ -@@ -490,7 +495,7 @@ - #ifdef __OpenBSD__ - ifnet_addr = (unsigned long)ifnet->if_list.tqe_next; - #else -- ifnet_addr = (unsigned long)ifnet->if_next; -+ ifnet_addr = (unsigned long) TAILQ_NEXT(ifnet,if_link); ++#ifdef USE_SYSCTL ++/* system headers */ ++#include <sys/types.h> ++#include <sys/sysctl.h> ++#include <sys/socket.h> ++#include <net/if.h> ++#include <net/if_mib.h> ++#include <sys/errno.h> ++ ++int id = 0; /* interface id */ ++int len = 0; /* sizeof libmibdata */ ++struct ifmibdata *data = NULL; ++ ++int sysctl_test(void); ++int sysctl_updateStats(void); ++#endif + + #ifdef USE_LINUX_PPP + #include<net/ppp_defs.h> +@@ -104,6 +120,9 @@ + #ifdef USE_KVM + {"kmem",kvm_updateStats, kvm_test}, #endif - } - } ++#ifdef USE_SYSCTL ++ {"sysctl",sysctl_updateStats, sysctl_test}, ++#endif + {NULL, NULL} + }; + +@@ -439,6 +458,114 @@ + + + #endif /* linux */ ++ ++/* new FreeBSD driver */ ++#ifdef USE_SYSCTL ++ ++int sysctl_test(void) { ++ struct ifmibdata tempndata; ++ int numifaces, len2; ++ int mib[5], datamib[6]; ++ int i; ++ ++ if(device == NULL) device = "lo0"; ++ ++ mib[0] = CTL_NET; ++ mib[1] = PF_LINK; ++ mib[2] = NETLINK_GENERIC; ++ mib[3] = IFMIB_SYSTEM; ++ mib[4] = IFMIB_IFCOUNT; ++ ++ datamib[0] = CTL_NET; ++ datamib[1] = PF_LINK; ++ datamib[2] = NETLINK_GENERIC; ++ datamib[3] = IFMIB_IFDATA; ++ datamib[4] = 1; ++ datamib[5] = IFDATA_GENERAL; ++ ++ len = sizeof(struct ifmibdata); ++ len2 = sizeof(numifaces); ++ ++ if(sysctl(mib, 5, &numifaces, &len2, NULL, 0) < 0) ++ { ++ fprintf( stderr, "wmnet: failed to perform sysctl" ); ++ return 0; ++ } ++ ++ for(i = 1; i <= numifaces; i++) ++ { ++ datamib[4] = i; ++ if(sysctl(datamib, 6, &tempndata, &len, NULL, 0) < 0) ++ { ++ fprintf( stderr, "wmnet: failed to get device(%d) data", i ); ++ break; ++ } ++ ++ if( strcmp( device, tempndata.ifmd_name ) == 0 ) ++ { ++ id = i; ++ break; ++ } ++ } ++ ++ if ( id == 0 ) { ++ fprintf( stderr, "%s doesn't seem to exist!\n", device ); ++ exit( -1 ); ++ } ++ ++ /* calculate and allocate mem for ifmibdata containing the if stats */ ++ data = malloc(len); ++ ++ fprintf(stderr, "wmnet: using sysctl driver to monitor %s\n", device); ++ return True; ++} ++ ++int sysctl_updateStats(void) { ++ int datamib[6]; ++ ++ datamib[0] = CTL_NET; ++ datamib[1] = PF_LINK; ++ datamib[2] = NETLINK_GENERIC; ++ datamib[3] = IFMIB_IFDATA; ++ datamib[4] = id; ++ datamib[5] = IFDATA_GENERAL; ++ ++ if(sysctl( datamib, 6, data, &len, NULL, 0) < 0 ) { ++ fprintf( stderr, "wmnet: can't monitor %s device\n", device ); ++ exit( -1 ); ++ } ++ ++ // printf( "if name: %s\n", data->ifmd_name ); ++ ++ /* get the stats from the if */ ++ totalpackets_in = data->ifmd_data.ifi_ipackets; ++ totalpackets_out = data->ifmd_data.ifi_opackets; ++ ++ if (totalpackets_in != lastpackets_in) { ++ totalbytes_in = data->ifmd_data.ifi_ibytes; ++ diffpackets_in += totalpackets_in - lastpackets_in; ++ diffbytes_in += totalbytes_in - lastbytes_in; ++ lastpackets_in = totalpackets_in; ++ lastbytes_in = totalbytes_in; ++ rx = True; ++ } else rx = False; ++ ++ if (totalpackets_out != lastpackets_out) { ++ totalbytes_out = data->ifmd_data.ifi_obytes; ++ diffpackets_out += totalpackets_out - lastpackets_out; ++ diffbytes_out += totalbytes_out - lastbytes_out; ++ lastpackets_out = totalpackets_out; ++ lastbytes_out = totalbytes_out; ++ tx = True; ++ } else tx = False; ++ ++ /* return True if no change to tx/rx ++ * return False if display will need to be updated ++ */ ++ return((rx == current_rx) && (tx == current_tx)); ++} ++ ++#endif + + #ifdef USE_KVM + int kvm_test(void) { diff -ruN wmnet2.bak/files/patch-ab wmnet2/files/patch-ab --- wmnet2.bak/files/patch-ab Sun Oct 26 14:34:10 2003 +++ wmnet2/files/patch-ab Thu Jan 1 01:00:00 1970 @@ -1,11 +0,0 @@ ---- Imakefile 2001/09/08 12:01:26 1.1 -+++ Imakefile 2001/09/08 12:02:34 -@@ -26,4 +26,7 @@ - #endif - - --ComplexProgramTarget(wmnet) -+ComplexProgramTarget(wmnet2) -+ -+wmnet2.man: wmnet.man -+ ln -sf wmnet.man wmnet2.man diff -ruN wmnet2.bak/files/patch-ac wmnet2/files/patch-ac --- wmnet2.bak/files/patch-ac Sun Oct 26 14:34:10 2003 +++ wmnet2/files/patch-ac Thu Jan 1 01:00:00 1970 @@ -1,10 +0,0 @@ ---- wmnet.c.orig Thu May 4 21:01:14 2000 -+++ wmnet.c Wed Dec 19 17:43:40 2001 -@@ -732,6 +732,7 @@ - case ButtonPress: - if(event.xbutton.button == Button1 && click_command != NULL) { - if (fork() == 0) { -+ setgid(getgid()); - execl("/bin/sh", "sh", "-c", click_command, NULL); - perror("wmnet: execl()"); - exit(15); diff -ruN wmnet2.bak/pkg-descr wmnet2/pkg-descr --- wmnet2.bak/pkg-descr Sun Oct 26 14:34:10 2003 +++ wmnet2/pkg-descr Tue Dec 9 22:52:12 2003 @@ -11,4 +11,4 @@ WWW: http://www.digitalkaos.net/linux/wmnet/ - Paolo -flag@libero.it +flag@gufi.org diff -ruN wmnet2.bak/pkg-plist wmnet2/pkg-plist --- wmnet2.bak/pkg-plist Sun Oct 26 14:34:10 2003 +++ wmnet2/pkg-plist Tue Dec 9 23:07:26 2003 @@ -1 +1 @@ -bin/wmnet2 +bin/wmnet >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031209224120.573C8208F>