Great !!! It's working on my FreeBSD 3.0 machine now ... !!!

This commit is contained in:
Martin Baulig
1998-11-17 23:15:12 +00:00
parent 92f1bf261c
commit 7a0a779311
5 changed files with 49 additions and 3 deletions

View File

@@ -28,6 +28,11 @@
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#ifdef HAVE_NET_IF_VAR_H
#include <net/if_var.h>
#endif
#include <netinet/in.h>
#include <netinet/in_var.h>
@@ -102,7 +107,11 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
tname, 16) != 16))
glibtop_error_io_r (server, "kvm_read (ifnetaddr)");
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300000)
ifaddraddr = (u_long) ifnet.if_addrhead.tqh_first;
#else
ifaddraddr = (u_long) ifnet.if_addrlist;
#endif
}
if (ifaddraddr) {
@@ -171,10 +180,18 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
buf->flags = _glibtop_sysdeps_netload;
return;
}
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300000)
ifaddraddr = (u_long)ifaddr.ifa.ifa_link.tqe_next;
#else
ifaddraddr = (u_long)ifaddr.ifa.ifa_next;
#endif
}
#if (defined __FreeBSD__) && (__FreeBSD_version >= 300000)
ifnetaddr = (u_long) ifnet.if_link.tqe_next;
#else
ifnetaddr = (u_long) ifnet.if_next;
#endif
}
}