diff options
Diffstat (limited to 'wm/icewm/patches/patch-af')
-rw-r--r-- | wm/icewm/patches/patch-af | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/wm/icewm/patches/patch-af b/wm/icewm/patches/patch-af deleted file mode 100644 index c89bd68aea4..00000000000 --- a/wm/icewm/patches/patch-af +++ /dev/null @@ -1,65 +0,0 @@ -$NetBSD: patch-af,v 1.9 2004/06/26 23:56:21 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 -@@ -358,6 +358,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; -@@ -390,6 +410,7 @@ - - close(s); - return false; -+#endif - } - - void NetStatus::updateStatus() { -@@ -510,6 +531,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); |