not every value return in an nlist structure was being
[unix-history] / usr / src / usr.bin / netstat / inet.c
index ba855d6..3e5d251 100644 (file)
@@ -1,4 +1,4 @@
-    /*
+/*
  * Copyright (c) 1983, 1988 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1983, 1988 Regents of the University of California.
  * All rights reserved.
  *
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)inet.c     5.17 (Berkeley) %G%";
+static char sccsid[] = "@(#)inet.c     5.19 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -38,14 +38,15 @@ static char sccsid[] = "@(#)inet.c  5.17 (Berkeley) %G%";
 #include <netdb.h>
 #include <stdio.h>
 #include <string.h>
 #include <netdb.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 #include "netstat.h"
 
 struct inpcb inpcb;
 struct tcpcb tcpcb;
 struct socket sockb;
 
 #include "netstat.h"
 
 struct inpcb inpcb;
 struct tcpcb tcpcb;
 struct socket sockb;
 
-char *inetname __P((struct in_addr *));
-void inetprint __P((struct in_addr *, int, char *));
+char   *inetname __P((struct in_addr *));
+void   inetprint __P((struct in_addr *, int, char *));
 
 /*
  * Print a summary of connections related to an Internet
 
 /*
  * Print a summary of connections related to an Internet
@@ -55,7 +56,7 @@ void inetprint __P((struct in_addr *, int, char *));
  */
 void
 protopr(off, name)
  */
 void
 protopr(off, name)
-       off_t off;
+       u_long off;
        char *name;
 {
        struct inpcb cb;
        char *name;
 {
        struct inpcb cb;
@@ -73,7 +74,7 @@ protopr(off, name)
                return;
        while (inpcb.inp_next != (struct inpcb *)off) {
                next = inpcb.inp_next;
                return;
        while (inpcb.inp_next != (struct inpcb *)off) {
                next = inpcb.inp_next;
-               kread((off_t)next, (char *)&inpcb, sizeof (inpcb));
+               kread((u_long)next, (char *)&inpcb, sizeof (inpcb));
                if (inpcb.inp_prev != prev) {
                        printf("???\n");
                        break;
                if (inpcb.inp_prev != prev) {
                        printf("???\n");
                        break;
@@ -83,9 +84,9 @@ protopr(off, name)
                        prev = next;
                        continue;
                }
                        prev = next;
                        continue;
                }
-               kread((off_t)inpcb.inp_socket, (char *)&sockb, sizeof (sockb));
+               kread((u_long)inpcb.inp_socket, (char *)&sockb, sizeof (sockb));
                if (istcp) {
                if (istcp) {
-                       kread((off_t)inpcb.inp_ppcb,
+                       kread((u_long)inpcb.inp_ppcb,
                            (char *)&tcpcb, sizeof (tcpcb));
                }
                if (first) {
                            (char *)&tcpcb, sizeof (tcpcb));
                }
                if (first) {
@@ -127,7 +128,7 @@ protopr(off, name)
  */
 void
 tcp_stats(off, name)
  */
 void
 tcp_stats(off, name)
-       off_t off;
+       u_long off;
        char *name;
 {
        struct tcpstat tcpstat;
        char *name;
 {
        struct tcpstat tcpstat;
@@ -196,7 +197,7 @@ tcp_stats(off, name)
  */
 void
 udp_stats(off, name)
  */
 void
 udp_stats(off, name)
-       off_t off;
+       u_long off;
        char *name;
 {
        struct udpstat udpstat;
        char *name;
 {
        struct udpstat udpstat;
@@ -224,7 +225,7 @@ udp_stats(off, name)
  */
 void
 ip_stats(off, name)
  */
 void
 ip_stats(off, name)
-       off_t off;
+       u_long off;
        char *name;
 {
        struct ipstat ipstat;
        char *name;
 {
        struct ipstat ipstat;
@@ -280,7 +281,7 @@ static      char *icmpnames[] = {
  */
 void
 icmp_stats(off, name)
  */
 void
 icmp_stats(off, name)
-       off_t off;
+       u_long off;
        char *name;
 {
        struct icmpstat icmpstat;
        char *name;
 {
        struct icmpstat icmpstat;