summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-04-09 05:33:17 +0000
committerdg <dg@FreeBSD.org>1995-04-09 05:33:17 +0000
commitaef6dbd77bce0cbf593b63c208181b0a0811845c (patch)
tree47ab209dffad2c3584cf0bb3361c3ad8e3a8f97b /usr.bin/netstat
parent8566f5db7b084268d6fa84f25e5f649954e31280 (diff)
downloadFreeBSD-src-aef6dbd77bce0cbf593b63c208181b0a0811845c.zip
FreeBSD-src-aef6dbd77bce0cbf593b63c208181b0a0811845c.tar.gz
Updated netstat to grok 4.4 QUEUE macros now being used to like the PCBs
together.
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/inet.c17
-rw-r--r--usr.bin/netstat/iso.c5
2 files changed, 12 insertions, 10 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 9b3cff6..72aac88 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -40,6 +40,7 @@ static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94";
#include <sys/socketvar.h>
#include <sys/mbuf.h>
#include <sys/protosw.h>
+#include <sys/queue.h>
#include <net/route.h>
#include <netinet/in.h>
@@ -86,26 +87,26 @@ protopr(off, name)
u_long off;
char *name;
{
- struct inpcb cb;
+ struct inpcbhead head;
register struct inpcb *prev, *next;
int istcp;
static int first = 1;
if (off == 0)
return;
+
istcp = strcmp(name, "tcp") == 0;
- kread(off, (char *)&cb, sizeof (struct inpcb));
- inpcb = cb;
+ kread(off, (char *)&head, sizeof (struct inpcbhead));
prev = (struct inpcb *)off;
- if (inpcb.inp_next == (struct inpcb *)off)
- return;
- while (inpcb.inp_next != (struct inpcb *)off) {
- next = inpcb.inp_next;
+
+ for (next = head.lh_first; next != NULL; next = inpcb.list.le_next) {
kread((u_long)next, (char *)&inpcb, sizeof (inpcb));
- if (inpcb.inp_prev != prev) {
+#if 0
+ if (*inpcb.list.le_prev != prev) {
printf("???\n");
break;
}
+#endif
if (!aflag &&
inet_lnaof(inpcb.inp_laddr) == INADDR_ANY) {
prev = next;
diff --git a/usr.bin/netstat/iso.c b/usr.bin/netstat/iso.c
index 1eecf15..ade4144 100644
--- a/usr.bin/netstat/iso.c
+++ b/usr.bin/netstat/iso.c
@@ -36,8 +36,8 @@ static char sccsid[] = "@(#)iso.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
/*
- * $Header: iso.c,v 1.5 92/06/04 00:36:32 leres Exp $
- * $Source: /usr/src/usr.bin/netstat/RCS/iso.c,v $
+ * $Header: /home/ncvs/src/usr.bin/netstat/iso.c,v 1.1.1.1 1994/05/27 12:32:25 rgrimes Exp $
+ * $Source: /home/ncvs/src/usr.bin/netstat/iso.c,v $
*/
/*******************************************************************************
Copyright IBM Corporation 1987
@@ -73,6 +73,7 @@ SOFTWARE.
#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
+#include <sys/queue.h>
#include <errno.h>
#include <net/if.h>
#include <net/route.h>
OpenPOWER on IntegriCloud