summaryrefslogtreecommitdiff
path: root/wm/icewm
diff options
context:
space:
mode:
authorxtraeme <xtraeme@pkgsrc.org>2004-06-22 20:45:45 +0000
committerxtraeme <xtraeme@pkgsrc.org>2004-06-22 20:45:45 +0000
commite9f72f8d35d83daafc399120553d63e4c9fb7d0d (patch)
treea9d91ebdfdb91a3c9e208a9b35373de7ad14d816 /wm/icewm
parent46c31de70e49f64808d0231a87860a2e300fffdc (diff)
downloadpkgsrc-e9f72f8d35d83daafc399120553d63e4c9fb7d0d.tar.gz
Apply patches from Iain Hibbert to make work the NetStatus app via
PR pkg/26001. To use it, just add the following lines into your ~/.icewm/preferences: (change ppp0 for your interface) TaskBarShowNetStatus = 1 NetworkStatusDevice = "ppp0"
Diffstat (limited to 'wm/icewm')
-rw-r--r--wm/icewm/distinfo4
-rw-r--r--wm/icewm/patches/patch-ae24
-rw-r--r--wm/icewm/patches/patch-af65
3 files changed, 92 insertions, 1 deletions
diff --git a/wm/icewm/distinfo b/wm/icewm/distinfo
index 8cbfcc7e26c..b22b41ba99d 100644
--- a/wm/icewm/distinfo
+++ b/wm/icewm/distinfo
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.16 2004/04/09 10:41:06 wiz Exp $
+$NetBSD: distinfo,v 1.17 2004/06/22 20:45:45 xtraeme Exp $
SHA1 (icewm-1.2.13.tar.gz) = ebfe807cbe3a9d931386833033eb9cb1792ea485
Size (icewm-1.2.13.tar.gz) = 839636 bytes
SHA1 (patch-ab) = 791868a4320a62ac81de487667f90cbdaeacd2a7
SHA1 (patch-ad) = 4b4feeb255a035a77195bf6e6fe5ffda6d428754
+SHA1 (patch-ae) = b1db6d35fb2454c132c734b67483d8a9d22ed9df
+SHA1 (patch-af) = 8b074ce39a46873a09978e18904b252dfec0eecf
diff --git a/wm/icewm/patches/patch-ae b/wm/icewm/patches/patch-ae
new file mode 100644
index 00000000000..ac64c42da8d
--- /dev/null
+++ b/wm/icewm/patches/patch-ae
@@ -0,0 +1,24 @@
+$NetBSD: patch-ae,v 1.7 2004/06/22 20:45:45 xtraeme Exp $
+
+Turn on HAVE_NET_STATUS for NetBSD
+
+--- src/apppstatus.h.orig Sat Sep 27 08:54:45 2003
++++ src/apppstatus.h Sun Jun 20 18:19:04 2004
+@@ -9,7 +9,7 @@
+ #define NETSTATUS_H
+
+ #ifdef CONFIG_APPLET_NET_STATUS
+-#if defined(linux) || defined(__FreeBSD__)
++#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
+
+ #define HAVE_NET_STATUS 1
+
+@@ -61,7 +61,7 @@
+ };
+
+
+-#else // linux || __FreeBSD__
++#else // linux || __FreeBSD__ || __NetBSD__
+ #undef CONFIG_APPLET_NET_STATUS
+ #endif
+ #endif // CONFIG_APPLET_NET_STATUS
diff --git a/wm/icewm/patches/patch-af b/wm/icewm/patches/patch-af
new file mode 100644
index 00000000000..67e1bfe635f
--- /dev/null
+++ b/wm/icewm/patches/patch-af
@@ -0,0 +1,65 @@
+$NetBSD: patch-af,v 1.8 2004/06/22 20:45:45 xtraeme Exp $
+
+Add some code for NetBSD to
+ a) check if an interface is up, and
+ b) get the in/out character count for that interface
+
+--- src/apppstatus.cc.orig Sat Sep 27 08:54:45 2003
++++ src/apppstatus.cc Sun Jun 20 20:45:26 2004
+@@ -363,6 +363,26 @@
+ return isUpIsdn();
+ #endif
+
++#ifdef __NetBSD__
++ struct ifreq ifr;
++
++ if (fNetDev == 0)
++ return false;
++
++ int s = socket(AF_INET, SOCK_DGRAM, 0);
++
++ if( s != -1 ) {
++ strncpy(ifr.ifr_name, fNetDev, sizeof(ifr.ifr_name));
++ if( ioctl(s, SIOCGIFFLAGS, (caddr_t)&ifr) != -1 ) {
++ if( ifr.ifr_flags & IFF_UP ) {
++ close(s);
++ return true;
++ }
++ }
++ close(s);
++ }
++ return false;
++#else
+ char buffer[32 * sizeof(struct ifreq)];
+ struct ifconf ifc;
+ struct ifreq *ifr;
+@@ -395,6 +415,7 @@
+
+ close(s);
+ return false;
++#endif // __NetBSD__
+ #endif // if 0
+ }
+
+@@ -522,6 +543,21 @@
+ }
+ }
+ #endif //FreeBSD
++#ifdef __NetBSD__
++ struct ifdatareq ifdr;
++ struct if_data * const ifi = &ifdr.ifdr_data;
++ int s;
++
++ s = socket(AF_INET, SOCK_DGRAM, 0);
++ if( s != -1 ) {
++ strncpy(ifdr.ifdr_name, fNetDev, sizeof(ifdr.ifdr_name));
++ if (ioctl(s, SIOCGIFDATA, &ifdr) != -1) {
++ cur_ibytes = ifi->ifi_ibytes;
++ cur_obytes = ifi->ifi_obytes;
++ }
++ close(s);
++ }
++#endif //__NetBSD__
+
+ // correct the values and look for overflows
+ //msg("w/o corrections: ibytes: %lld, prev_ibytes; %lld, offset: %lld", cur_ibytes, prev_ibytes, offset_ibytes);