aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sysutils/xperfmon/files/patch-aa2
-rw-r--r--sysutils/xperfmon/files/patch-ac62
-rw-r--r--sysutils/xperfmon3/files/patch-aa2
-rw-r--r--sysutils/xperfmon3/files/patch-ac62
4 files changed, 126 insertions, 2 deletions
diff --git a/sysutils/xperfmon/files/patch-aa b/sysutils/xperfmon/files/patch-aa
index 34596e00688b..5a44adbca135 100644
--- a/sysutils/xperfmon/files/patch-aa
+++ b/sysutils/xperfmon/files/patch-aa
@@ -11,7 +11,7 @@ diff -c -N ../xperfmon++/freebsd_system.c ./freebsd_system.c
+ * Copyright 1989, PCS Computer Systeme GmbH, West Germany
+ * Copyright 1994, Sterling Software @ NASA-Ames Research Center
+ * Copyright 1995, Regents of the University of California,
-+ * Lars K ler <Lars_Koeller@odie.physik2.uni-rostock.de
++ * Lars Koeller <Lars_Koeller@odie.physik2.uni-rostock.de
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
diff --git a/sysutils/xperfmon/files/patch-ac b/sysutils/xperfmon/files/patch-ac
new file mode 100644
index 000000000000..1b74333552d9
--- /dev/null
+++ b/sysutils/xperfmon/files/patch-ac
@@ -0,0 +1,62 @@
+--- freebsd_system.c.orig Sun Jan 19 18:43:41 1997
++++ freebsd_system.c Sun Jan 19 18:42:59 1997
+@@ -75,6 +75,7 @@
+ #include <sys/sysctl.h>
+ #include <sys/dkstat.h>
+ #include <sys/buf.h>
++#include <sys/time.h>
+ #include <sys/vmmeter.h>
+ #include <vm/vm.h>
+ #include <net/if.h>
+@@ -310,7 +311,8 @@
+ Collect the Network-Traffic
+ */
+
+- if (nl[N_IFNET].n_value != 0) {
++ if ((ifnetaddr = nl[N_IFNET].n_value) != 0) {
++#if __FreeBSD_version <= 199701
+ struct ifnet ifnet;
+ kread(N_IFNET, &ifnetaddr, sizeof(ifnetaddr));
+ old_packets = packets;
+@@ -322,6 +324,41 @@
+ packets.collisions += ifnet.if_collisions;
+ ifnetaddr = (u_long) ifnet.if_next;
+ }
++#else /* 3.0-current, Jan 1997 */
++ /* Stolen from netstat/if.c */
++ struct ifnet ifnet;
++ struct ifnethead ifnethead;
++ u_long ifaddraddr, ifnetfound;
++ struct ifaddr ifa;
++
++ if(kvm_read(kd, ifnetaddr, (char *)&ifnethead, sizeof ifnethead) == -1)
++ return;
++ ifnetaddr = (u_long)ifnethead.tqh_first;
++ if(kvm_read(kd, ifnetaddr, (char *)&ifnet, sizeof ifnet) == -1)
++ return;
++
++ old_packets = packets;
++ packets.input = packets.output = packets.collisions = 0;
++ ifaddraddr = 0;
++ while (ifnetaddr || ifaddraddr) {
++ if (ifaddraddr == 0) {
++ ifnetfound = ifnetaddr;
++ if(kvm_read(kd, ifnetaddr, (char *)&ifnet, sizeof ifnet) == -1)
++ return;
++ ifnetaddr = (u_long)ifnet.if_link.tqe_next;
++ ifaddraddr = (u_long)ifnet.if_addrhead.tqh_first;
++ }
++ if (kvm_read(kd, ifaddraddr, (char *)&ifa, sizeof ifa) == -1) {
++ ifaddraddr = 0;
++ continue;
++ }
++ ifaddraddr = (u_long)ifa.ifa_link.tqe_next;
++
++ packets.input += ifnet.if_ipackets;
++ packets.output += ifnet.if_opackets;
++ packets.collisions += ifnet.if_collisions;
++ }
++#endif
+ }
+
+ /*
diff --git a/sysutils/xperfmon3/files/patch-aa b/sysutils/xperfmon3/files/patch-aa
index 34596e00688b..5a44adbca135 100644
--- a/sysutils/xperfmon3/files/patch-aa
+++ b/sysutils/xperfmon3/files/patch-aa
@@ -11,7 +11,7 @@ diff -c -N ../xperfmon++/freebsd_system.c ./freebsd_system.c
+ * Copyright 1989, PCS Computer Systeme GmbH, West Germany
+ * Copyright 1994, Sterling Software @ NASA-Ames Research Center
+ * Copyright 1995, Regents of the University of California,
-+ * Lars K ler <Lars_Koeller@odie.physik2.uni-rostock.de
++ * Lars Koeller <Lars_Koeller@odie.physik2.uni-rostock.de
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
diff --git a/sysutils/xperfmon3/files/patch-ac b/sysutils/xperfmon3/files/patch-ac
new file mode 100644
index 000000000000..1b74333552d9
--- /dev/null
+++ b/sysutils/xperfmon3/files/patch-ac
@@ -0,0 +1,62 @@
+--- freebsd_system.c.orig Sun Jan 19 18:43:41 1997
++++ freebsd_system.c Sun Jan 19 18:42:59 1997
+@@ -75,6 +75,7 @@
+ #include <sys/sysctl.h>
+ #include <sys/dkstat.h>
+ #include <sys/buf.h>
++#include <sys/time.h>
+ #include <sys/vmmeter.h>
+ #include <vm/vm.h>
+ #include <net/if.h>
+@@ -310,7 +311,8 @@
+ Collect the Network-Traffic
+ */
+
+- if (nl[N_IFNET].n_value != 0) {
++ if ((ifnetaddr = nl[N_IFNET].n_value) != 0) {
++#if __FreeBSD_version <= 199701
+ struct ifnet ifnet;
+ kread(N_IFNET, &ifnetaddr, sizeof(ifnetaddr));
+ old_packets = packets;
+@@ -322,6 +324,41 @@
+ packets.collisions += ifnet.if_collisions;
+ ifnetaddr = (u_long) ifnet.if_next;
+ }
++#else /* 3.0-current, Jan 1997 */
++ /* Stolen from netstat/if.c */
++ struct ifnet ifnet;
++ struct ifnethead ifnethead;
++ u_long ifaddraddr, ifnetfound;
++ struct ifaddr ifa;
++
++ if(kvm_read(kd, ifnetaddr, (char *)&ifnethead, sizeof ifnethead) == -1)
++ return;
++ ifnetaddr = (u_long)ifnethead.tqh_first;
++ if(kvm_read(kd, ifnetaddr, (char *)&ifnet, sizeof ifnet) == -1)
++ return;
++
++ old_packets = packets;
++ packets.input = packets.output = packets.collisions = 0;
++ ifaddraddr = 0;
++ while (ifnetaddr || ifaddraddr) {
++ if (ifaddraddr == 0) {
++ ifnetfound = ifnetaddr;
++ if(kvm_read(kd, ifnetaddr, (char *)&ifnet, sizeof ifnet) == -1)
++ return;
++ ifnetaddr = (u_long)ifnet.if_link.tqe_next;
++ ifaddraddr = (u_long)ifnet.if_addrhead.tqh_first;
++ }
++ if (kvm_read(kd, ifaddraddr, (char *)&ifa, sizeof ifa) == -1) {
++ ifaddraddr = 0;
++ continue;
++ }
++ ifaddraddr = (u_long)ifa.ifa_link.tqe_next;
++
++ packets.input += ifnet.if_ipackets;
++ packets.output += ifnet.if_opackets;
++ packets.collisions += ifnet.if_collisions;
++ }
++#endif
+ }
+
+ /*