Multicast changes from lbl
authorKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Tue, 7 Jul 1992 06:36:21 +0000 (22:36 -0800)
committerKeith Sklower <sklower@ucbvax.Berkeley.EDU>
Tue, 7 Jul 1992 06:36:21 +0000 (22:36 -0800)
SCCS-vsn: usr.bin/netstat/ns.c 5.15
SCCS-vsn: usr.bin/netstat/main.c 5.29
SCCS-vsn: usr.bin/netstat/if.c 5.17
SCCS-vsn: usr.bin/netstat/iso.c 5.12
SCCS-vsn: usr.bin/netstat/route.c 5.24
SCCS-vsn: usr.bin/netstat/inet.c 5.18
SCCS-vsn: usr.bin/netstat/unix.c 5.13
SCCS-vsn: usr.bin/netstat/Makefile 5.16
SCCS-vsn: usr.bin/netstat/netstat.h 5.3

usr/src/usr.bin/netstat/Makefile
usr/src/usr.bin/netstat/if.c
usr/src/usr.bin/netstat/inet.c
usr/src/usr.bin/netstat/iso.c
usr/src/usr.bin/netstat/main.c
usr/src/usr.bin/netstat/netstat.h
usr/src/usr.bin/netstat/ns.c
usr/src/usr.bin/netstat/route.c
usr/src/usr.bin/netstat/unix.c

index 4e2eca5..d13ec56 100644 (file)
@@ -1,4 +1,4 @@
-#      @(#)Makefile    5.15 (Berkeley) %G%
+#      @(#)Makefile    5.16 (Berkeley) %G%
 
 PROG=  netstat
 OBJS=  host.o inet.o if.o main.o mbuf.o route.o unix.o ns.o bbnnet.o
 
 PROG=  netstat
 OBJS=  host.o inet.o if.o main.o mbuf.o route.o unix.o ns.o bbnnet.o
index 0827685..ac8585c 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)if.c       5.16 (Berkeley) %G%";
+static char sccsid[] = "@(#)if.c       5.17 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -25,6 +25,7 @@ static char sccsid[] = "@(#)if.c      5.16 (Berkeley) %G%";
 #include <stdio.h>
 #include <string.h>
 #include <signal.h>
 #include <stdio.h>
 #include <string.h>
 #include <signal.h>
+#include <unistd.h>
 #include "netstat.h"
 
 #define        YES     1
 #include "netstat.h"
 
 #define        YES     1
index ba855d6..c0f8e17 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.18 (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
index f227814..c097929 100644 (file)
@@ -1,17 +1,17 @@
-/*-
- * Copyright (c) 1989, 1990 The Regents of the University of California.
+/*
+ * Copyright (c) 1983, 1988 Regents of the University of California.
  * All rights reserved.
  *
  * %sccs.include.redist.c%
  */
 
 #ifndef lint
  * All rights reserved.
  *
  * %sccs.include.redist.c%
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)iso.c      5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)iso.c      5.12 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
- * $Header: iso.c,v 3.3 88/12/08 14:44:49 hagens Exp $
- * $Source: /usr/argo/src/ucb/netstat/RCS/iso.c,v $
+ * $Header: iso.c,v 1.5 92/06/04 00:36:32 leres Exp $
+ * $Source: /usr/src/usr.bin/netstat/RCS/iso.c,v $
  */
 /*******************************************************************************
                  Copyright IBM Corporation 1987
  */
 /*******************************************************************************
                  Copyright IBM Corporation 1987
@@ -74,14 +74,17 @@ SOFTWARE.
 #undef IncStat
 #endif
 #include <netiso/cons_pcb.h>
 #undef IncStat
 #endif
 #include <netiso/cons_pcb.h>
+#include <arpa/inet.h>
 #include <netdb.h>
 #include <string.h>
 #include <stdio.h>
 #include <netdb.h>
 #include <string.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include "netstat.h"
 
 static void tprintstat __P((struct tp_stat *, int));
 static void isonetprint __P((struct sockaddr_iso *, int));
 static void hexprint __P((int, char *, char *));
 #include "netstat.h"
 
 static void tprintstat __P((struct tp_stat *, int));
 static void isonetprint __P((struct sockaddr_iso *, int));
 static void hexprint __P((int, char *, char *));
+extern void inetprint __P((struct in_addr *, int, char *));
 
 /*
  *     Dump esis stats
 
 /*
  *     Dump esis stats
@@ -223,8 +226,10 @@ iso_protopr(off, name)
        }
 }
 
        }
 }
 
+void
 iso_protopr1(kern_addr, istp)
 iso_protopr1(kern_addr, istp)
-off_t kern_addr;
+       off_t kern_addr;
+       int istp;
 {
        if (first) {
                printf("Active ISO net connections");
 {
        if (first) {
                printf("Active ISO net connections");
@@ -242,7 +247,7 @@ off_t kern_addr;
        }
        if (Aflag)
                        printf("%8x ",
        }
        if (Aflag)
                        printf("%8x ",
-                                       (sockb.so_pcb ? (off_t)sockb.so_pcb : (off_t)kern_addr));
+                                       (sockb.so_pcb ? (void *)sockb.so_pcb : (void *)kern_addr));
        printf("%-5.5s %6d %6d ", "tp", sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc);
        if (istp && tpcb.tp_lsuffixlen) {
                        hexprint(tpcb.tp_lsuffixlen, tpcb.tp_lsuffix, "()");
        printf("%-5.5s %6d %6d ", "tp", sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc);
        if (istp && tpcb.tp_lsuffixlen) {
                        hexprint(tpcb.tp_lsuffixlen, tpcb.tp_lsuffix, "()");
@@ -272,9 +277,10 @@ off_t kern_addr;
        }
 }
 
        }
 }
 
+void
 tp_protopr(off, name)
 tp_protopr(off, name)
-off_t off;
-char *name;
+       off_t off;
+       char *name;
 {
        struct tp_ref *tpr, *tpr_base;
        struct tp_refinfo tpkerninfo;
 {
        struct tp_ref *tpr, *tpr_base;
        struct tp_refinfo tpkerninfo;
@@ -301,11 +307,11 @@ char *name;
                kget(tpcb.tp_sock, sockb);
                if (tpcb.tp_npcb) switch(tpcb.tp_netservice) {
                        case IN_CLNS:
                kget(tpcb.tp_sock, sockb);
                if (tpcb.tp_npcb) switch(tpcb.tp_netservice) {
                        case IN_CLNS:
-                               tp_inproto(tpkerninfo.tpr_base);
+                               tp_inproto((off_t)tpkerninfo.tpr_base);
                                break;
                        default:
                                kget(tpcb.tp_npcb, isopcb);
                                break;
                        default:
                                kget(tpcb.tp_npcb, isopcb);
-                               iso_protopr1(tpcb.tp_npcb, 1);
+                               iso_protopr1((off_t)tpcb.tp_npcb, 1);
                                break;
                }
                if (tpcb.tp_state >= tp_NSTATES)
                                break;
                }
                if (tpcb.tp_state >= tp_NSTATES)
@@ -315,8 +321,10 @@ char *name;
                putchar('\n');
        }
 }
                putchar('\n');
        }
 }
+
+void
 tp_inproto(pcb)
 tp_inproto(pcb)
-off_t pcb;
+       off_t pcb;
 {
        struct inpcb inpcb;
        kget(tpcb.tp_npcb, inpcb);
 {
        struct inpcb inpcb;
        kget(tpcb.tp_npcb, inpcb);
@@ -324,10 +332,12 @@ off_t pcb;
                return;
        if (Aflag)
                printf("%8x ", pcb);
                return;
        if (Aflag)
                printf("%8x ", pcb);
-       printf("%-5.5s %6d %6d ", "tpip", sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc);
+       printf("%-5.5s %6d %6d ", "tpip",
+           sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc);
        inetprint(&inpcb.inp_laddr, inpcb.inp_lport, "tp");
        inetprint(&inpcb.inp_faddr, inpcb.inp_fport, "tp");
 }
        inetprint(&inpcb.inp_laddr, inpcb.inp_lport, "tp");
        inetprint(&inpcb.inp_faddr, inpcb.inp_fport, "tp");
 }
+
 /*
  * Pretty print an iso address (net address + port).
  * If the nflag was specified, use numbers instead of names.
 /*
  * Pretty print an iso address (net address + port).
  * If the nflag was specified, use numbers instead of names.
@@ -741,21 +751,21 @@ tprintstat(s, indent)
        fprintf(OUT,
                "\n%*sACK reasons:\n", indent, " ");
        fprintf(OUT, "\t%*s%6d not acked immediately\n", indent, " ",
        fprintf(OUT,
                "\n%*sACK reasons:\n", indent, " ");
        fprintf(OUT, "\t%*s%6d not acked immediately\n", indent, " ",
-                                                                               s->ts_ackreason[_ACK_DONT_] );
+               s->ts_ackreason[_ACK_DONT_] );
        fprintf(OUT, "\t%*s%6d strategy==each\n", indent, " ",
        fprintf(OUT, "\t%*s%6d strategy==each\n", indent, " ",
-                                                                               s->ts_ackreason[_ACK_STRAT_EACH_] );
+               s->ts_ackreason[_ACK_STRAT_EACH_] );
        fprintf(OUT, "\t%*s%6d strategy==fullwindow\n", indent, " ",
        fprintf(OUT, "\t%*s%6d strategy==fullwindow\n", indent, " ",
-                                                                               s->ts_ackreason[_ACK_STRAT_FULLWIN_] );
+               s->ts_ackreason[_ACK_STRAT_FULLWIN_] );
        fprintf(OUT, "\t%*s%6d duplicate DT\n", indent, " ",
        fprintf(OUT, "\t%*s%6d duplicate DT\n", indent, " ",
-                                                                               s->ts_ackreason[_ACK_DUP_] );
+               s->ts_ackreason[_ACK_DUP_] );
        fprintf(OUT, "\t%*s%6d EOTSDU\n", indent, " ",
        fprintf(OUT, "\t%*s%6d EOTSDU\n", indent, " ",
-                                                                               s->ts_ackreason[_ACK_EOT_] );
+               s->ts_ackreason[_ACK_EOT_] );
        fprintf(OUT, "\t%*s%6d reordered DT\n", indent, " ",
        fprintf(OUT, "\t%*s%6d reordered DT\n", indent, " ",
-                                                                               s->ts_ackreason[_ACK_REORDER_] );
+               s->ts_ackreason[_ACK_REORDER_] );
        fprintf(OUT, "\t%*s%6d user rcvd\n", indent, " ",
        fprintf(OUT, "\t%*s%6d user rcvd\n", indent, " ",
-                                                                               s->ts_ackreason[_ACK_USRRCV_] );
+               s->ts_ackreason[_ACK_USRRCV_] );
        fprintf(OUT, "\t%*s%6d fcc reqd\n", indent, " ",
        fprintf(OUT, "\t%*s%6d fcc reqd\n", indent, " ",
-                                                                               s->ts_ackreason[_ACK_FCC_] );
+               s->ts_ackreason[_ACK_FCC_] );
 }
 #ifndef SSEL
 #define SSEL(s) ((s)->siso_tlen + TSEL(s))
 }
 #ifndef SSEL
 #define SSEL(s) ((s)->siso_tlen + TSEL(s))
@@ -776,6 +786,7 @@ isonetprint(siso, islocal)
                hexprint(siso->siso_plen, PSEL(siso), "<>");
        putchar(' ');
 }
                hexprint(siso->siso_plen, PSEL(siso), "<>");
        putchar(' ');
 }
+
 static char hexlist[] = "0123456789abcdef", obuf[128];
 
 static void
 static char hexlist[] = "0123456789abcdef", obuf[128];
 
 static void
index 524ecd1..fb91e0d 100644 (file)
@@ -12,23 +12,27 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.28 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.29 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
+#include <sys/file.h>
 #include <sys/protosw.h>
 #include <sys/socket.h>
 #include <sys/protosw.h>
 #include <sys/socket.h>
-#include <sys/file.h>
+
+#include <netinet/in.h>
+
+#include <ctype.h>
 #include <errno.h>
 #include <errno.h>
-#include <netdb.h>
-#include <nlist.h>
 #include <kvm.h>
 #include <limits.h>
 #include <kvm.h>
 #include <limits.h>
+#include <netdb.h>
+#include <nlist.h>
+#include <paths.h>
 #include <stdio.h>
 #include <stdio.h>
-#include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdlib.h>
 #include <string.h>
-#include <paths.h>
+#include <unistd.h>
 #include "netstat.h"
 
 struct nlist nl[] = {
 #include "netstat.h"
 
 struct nlist nl[] = {
@@ -80,6 +84,20 @@ struct nlist nl[] = {
        { "_cltb"},
 #define N_CLTPSTAT     23
        { "_cltpstat"},
        { "_cltb"},
 #define N_CLTPSTAT     23
        { "_cltpstat"},
+#define        N_NFILE         24
+       { "_nfile" },
+#define        N_FILE          25
+       { "_file" },
+#define N_IGMPSTAT     26
+       { "_igmpstat" },
+#define N_MRTPROTO     27
+       { "_ip_mrtproto" },
+#define N_MRTSTAT      28
+       { "_mrtstat" },
+#define N_MRTTABLE     29
+       { "_mrttable" },
+#define N_VIFTABLE     30
+       { "_viftable" },
 
     /* BBN Internet protocol implementation */
 #define        N_TCP           23
 
     /* BBN Internet protocol implementation */
 #define        N_TCP           23
@@ -186,7 +204,7 @@ main(argc, argv)
                prog = argv[0];
        af = AF_UNSPEC;
 
                prog = argv[0];
        af = AF_UNSPEC;
 
-       while ((ch = getopt(argc, argv, "Aadf:hI:iM:mN:np:rstuw")) != EOF)
+       while ((ch = getopt(argc, argv, "AaBdf:hI:iM:mN:np:rstuw")) != EOF)
                switch((char)ch) {
                case 'A':
                        Aflag = 1;
                switch((char)ch) {
                case 'A':
                        Aflag = 1;
@@ -194,6 +212,9 @@ main(argc, argv)
                case 'a':
                        aflag = 1;
                        break;
                case 'a':
                        aflag = 1;
                        break;
+               case 'B':
+                       Bflag = 1;
+                       break;
                case 'd':
                        dflag = 1;
                        break;
                case 'd':
                        dflag = 1;
                        break;
@@ -341,6 +362,16 @@ main(argc, argv)
                        routepr((off_t)nl[N_RTREE].n_value);
                exit(0);
        }
                        routepr((off_t)nl[N_RTREE].n_value);
                exit(0);
        }
+       if (Bflag) {
+               if (sflag)
+                       mrt_stats((off_t)nl[N_MRTPROTO].n_value,
+                           (off_t)nl[N_MRTSTAT].n_value);
+               else
+                       mroutepr((off_t)nl[N_MRTPROTO].n_value,
+                           (off_t)nl[N_MRTTABLE].n_value,
+                           (off_t)nl[N_VIFTABLE].n_value);
+               exit(0);
+       }
 
 
                if (sflag) {
 
 
                if (sflag) {
@@ -379,6 +410,13 @@ plural(n)
        return (n != 1 ? "s" : "");
 }
 
        return (n != 1 ? "s" : "");
 }
 
+char *
+plurales(n)
+       int n;
+{
+       return (n != 1 ? "es" : "");
+}
+
 /*
  * Find the protox for the given "well-known" name.
  */
 /*
  * Find the protox for the given "well-known" name.
  */
index 1ed5fb2..913a7de 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)netstat.h   5.2 (Berkeley) %G%
+ *     @(#)netstat.h   5.3 (Berkeley) %G%
  */
 
 #include <sys/cdefs.h>
  */
 
 #include <sys/cdefs.h>
@@ -14,6 +14,7 @@ int   aflag;          /* show all sockets (including servers) */
 int    dflag;          /* show i/f dropped packets */
 int    hflag;          /* show IMP host table */
 int    iflag;          /* show interfaces */
 int    dflag;          /* show i/f dropped packets */
 int    hflag;          /* show IMP host table */
 int    iflag;          /* show interfaces */
+int    Bflag;          /* show multicast tables (or multicast stats) */
 int    mflag;          /* show memory stats */
 int    nflag;          /* show addresses numerically */
 int    pflag;          /* show given protocol */
 int    mflag;          /* show memory stats */
 int    nflag;          /* show addresses numerically */
 int    pflag;          /* show given protocol */
@@ -33,6 +34,7 @@ char  *prog;          /* program name */
 
 int    kread __P((off_t addr, char *buf, int size));
 char   *plural __P((int));
 
 int    kread __P((off_t addr, char *buf, int size));
 char   *plural __P((int));
+char   *plurales __P((int));
 
 void   protopr __P((off_t, char *));
 void   tcp_stats __P((off_t, char *));
 
 void   protopr __P((off_t, char *));
 void   tcp_stats __P((off_t, char *));
@@ -61,7 +63,6 @@ void  nsprotopr __P((off_t, char *));
 void   spp_stats __P((off_t, char *));
 void   idp_stats __P((off_t, char *));
 void   nserr_stats __P((off_t, char *));
 void   spp_stats __P((off_t, char *));
 void   idp_stats __P((off_t, char *));
 void   nserr_stats __P((off_t, char *));
-void   ns_erputil __P((int, int));
 
 void   intpr __P((int, off_t));
 
 
 void   intpr __P((int, off_t));
 
@@ -71,4 +72,10 @@ void esis_stats __P((off_t, char *));
 void   clnp_stats __P((off_t, char *));
 void   cltp_stats __P((off_t, char *));
 void   iso_protopr __P((off_t, char *));
 void   clnp_stats __P((off_t, char *));
 void   cltp_stats __P((off_t, char *));
 void   iso_protopr __P((off_t, char *));
+void   iso_protopr1 __P((off_t, int));
+void   tp_protopr __P((off_t, char *));
+void   tp_inproto __P((off_t));
 void   tp_stats __P((caddr_t, caddr_t));
 void   tp_stats __P((caddr_t, caddr_t));
+
+void   mroutepr __P((off_t, off_t, off_t));
+void   mrt_stats __P((off_t, off_t));
index eacae0d..178a52f 100644 (file)
@@ -1,12 +1,12 @@
 /*
 /*
- * Copyright (c) 1985, 1988 Regents of the University of California.
+ * Copyright (c) 1983, 1988 Regents of the University of California.
  * All rights reserved.
  *
  * %sccs.include.redist.c%
  */
 
 #ifndef lint
  * All rights reserved.
  *
  * %sccs.include.redist.c%
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)ns.c       5.14 (Berkeley) %G%";
+static char sccsid[] = "@(#)ns.c       5.15 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -43,6 +43,7 @@ struct        sppcb sppcb;
 struct socket sockb;
 
 static char *ns_prpr __P((struct ns_addr *));
 struct socket sockb;
 
 static char *ns_prpr __P((struct ns_addr *));
+static void ns_erputil __P((int, int));
 
 static int first = 1;
 
 
 static int first = 1;
 
index a509740..84b4d32 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)route.c    5.23 (Berkeley) %G%";
+static char sccsid[] = "@(#)route.c    5.24 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -30,10 +30,10 @@ static char sccsid[] = "@(#)route.c 5.23 (Berkeley) %G%";
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 #include "netstat.h"
 
 #include "netstat.h"
 
-#define kget(p, d) \
-       (kread((off_t)(p), (char *)&(d), sizeof (d)))
+#define kget(p, d) (kread((off_t)(p), (char *)&(d), sizeof (d)))
 
 /*
  * Definitions for showing gateway flags.
 
 /*
  * Definitions for showing gateway flags.
@@ -45,13 +45,17 @@ struct bits {
        { RTF_UP,       'U' },
        { RTF_GATEWAY,  'G' },
        { RTF_HOST,     'H' },
        { RTF_UP,       'U' },
        { RTF_GATEWAY,  'G' },
        { RTF_HOST,     'H' },
+       { RTF_REJECT,   'R' },
        { RTF_DYNAMIC,  'D' },
        { RTF_MODIFIED, 'M' },
        { RTF_DYNAMIC,  'D' },
        { RTF_MODIFIED, 'M' },
+       { RTF_DONE,     'd' }, /* Completed -- for routing messages only */
+       { RTF_MASK,     'm' }, /* Mask Present -- for routing messages only */
        { RTF_CLONING,  'C' },
        { RTF_XRESOLVE, 'X' },
        { RTF_LLINFO,   'L' },
        { RTF_CLONING,  'C' },
        { RTF_XRESOLVE, 'X' },
        { RTF_LLINFO,   'L' },
-       { RTF_REJECT,   'R' },
        { RTF_STATIC,   'S' },
        { RTF_STATIC,   'S' },
+       { RTF_PROTO1,   '1' },
+       { RTF_PROTO2,   '2' },
        { 0 }
 };
 
        { 0 }
 };
 
index 9ff30eb..f9c7519 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)unix.c     5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)unix.c     5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -25,13 +25,17 @@ static char sccsid[] = "@(#)unix.c  5.12 (Berkeley) %G%";
 struct uio;
 struct proc;
 #include <sys/file.h>
 struct uio;
 struct proc;
 #include <sys/file.h>
+
+#include <netinet/in.h>
+
+#include <stdio.h>
 #include <stdlib.h>
 #include "netstat.h"
 
 #include <stdlib.h>
 #include "netstat.h"
 
-static void unixdomainpr __P((struct socket *, caddr_t));
+static void unixdomainpr __P((struct socket *, caddr_t));
 
 
-struct file *file, *fileNFILE;
-int nfiles;
+struct file *file, *fileNFILE;
+int    nfiles;
 extern kvm_t *kvmd;
 
 void
 extern kvm_t *kvmd;
 
 void
@@ -96,7 +100,7 @@ unixdomainpr(so, soaddr)
            unp->unp_vnode, unp->unp_conn,
            unp->unp_refs, unp->unp_nextref);
        if (m)
            unp->unp_vnode, unp->unp_conn,
            unp->unp_refs, unp->unp_nextref);
        if (m)
-               printf(" %.*s", m->m_len - sizeof(sa->sun_family),
+               printf(" %.*s", m->m_len - (int)sizeof(sa->sun_family),
                    sa->sun_path);
        putchar('\n');
 }
                    sa->sun_path);
        putchar('\n');
 }