summaryrefslogtreecommitdiff
path: root/net/netspeed_applet/files/patch-src_netspeed.c
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2003-02-09 05:03:05 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2003-02-09 05:03:05 +0000
commit5ff0e91908e73b2edfbbe782cf08afcdd43c8328 (patch)
tree5bc75f5c1d87e4c0f48c3e0f229f135370452124 /net/netspeed_applet/files/patch-src_netspeed.c
parentMake sure we tack the interface unit number under the end of the if_name. (diff)
Add netspeed_applet, a GNOME 2 applet that shows how much network traffic
occurs on an interface. Requested by: Muhannad Asfour <muhannad07@cogeco.ca>
Notes
Notes: svn path=/head/; revision=75155
Diffstat (limited to 'net/netspeed_applet/files/patch-src_netspeed.c')
-rw-r--r--net/netspeed_applet/files/patch-src_netspeed.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/net/netspeed_applet/files/patch-src_netspeed.c b/net/netspeed_applet/files/patch-src_netspeed.c
new file mode 100644
index 000000000000..3695d54860e4
--- /dev/null
+++ b/net/netspeed_applet/files/patch-src_netspeed.c
@@ -0,0 +1,36 @@
+--- src/netspeed.c.orig Sat Feb 8 23:21:50 2003
++++ src/netspeed.c Sat Feb 8 23:22:42 2003
+@@ -20,6 +20,7 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+@@ -260,6 +261,7 @@
+ devinfo->ip = NULL;
+ /* Get the hardware/physical adress/ MAC
+ */
++#ifndef __FreeBSD__
+ if (ioctl(fd, SIOCGIFHWADDR, &request) == 0)
+ {
+ unsigned char hwaddr[6];
+@@ -275,12 +277,17 @@
+ #endif
+ }
+ else
++#endif
+ devinfo->hwaddr = NULL;
+ /* Get the subnetmask
+ */
+ if (ioctl(fd, SIOCGIFNETMASK, &request) == 0)
+ {
++#ifdef __FreeBSD__
++ struct sockaddr_in *address = (struct sockaddr_in*)&request.ifr_addr;
++#else
+ struct sockaddr_in *address = (struct sockaddr_in*)&request.ifr_netmask;
++#endif
+ devinfo->netmask = g_strdup_printf("%s", inet_ntoa(address->sin_addr));
+ }
+ else