yet more flags, document getting ISO specific stats
[unix-history] / usr / src / usr.bin / netstat / netstat.1
index b5ac8d2..2b83e96 100644 (file)
@@ -1,11 +1,10 @@
-.\" Copyright (c) 1983, 1990 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1983, 1990, 1992, 1993
+.\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\"
-.\" %sccs.include.redist.man%
+.\" %sccs.include.redist.roff%
 .\"
 .\"
-.\"     @(#)netstat.1  6.13 (Berkeley) %G%
+.\"    @(#)netstat.1   8.6 (Berkeley) %G%
 .\"
 .\"
-.Vx
 .Dd 
 .Dt NETSTAT 1
 .Os BSD 4.2
 .Dd 
 .Dt NETSTAT 1
 .Os BSD 4.2
 .Nm netstat
 .Op Fl Aan
 .Op Fl f Ar address_family
 .Nm netstat
 .Op Fl Aan
 .Op Fl f Ar address_family
-.Op Ar system
-.Op Ar core
+.Op Fl M Ar core
+.Op Fl N Ar system
 .Nm netstat
 .Nm netstat
-.Op Fl himnrs
+.Op Fl dghimnrs
 .Op Fl f Ar address_family
 .Op Fl M Ar core
 .Op Fl N Ar system
 .Nm netstat
 .Op Fl f Ar address_family
 .Op Fl M Ar core
 .Op Fl N Ar system
 .Nm netstat
-.Op Fl n
-.Op Fl I Op Ar interface
+.Op Fl dn
+.Op Fl I Ar interface
 .Op Fl M Ar core
 .Op Fl N Ar system
 .Op Fl w Ar wait
 .Op Fl M Ar core
 .Op Fl N Ar system
 .Op Fl w Ar wait
@@ -53,54 +52,62 @@ traffic on the configured network interfaces.
 The fourth form displays statistics about the named protocol.
 .Pp
 The options have the following meaning:
 The fourth form displays statistics about the named protocol.
 .Pp
 The options have the following meaning:
-.Tw Fl
-.Tp Fl A
+.Bl -tag -width flag
+.It Fl A
 With the default display,
 show the address of any protocol control blocks associated with sockets; used
 for debugging.
 With the default display,
 show the address of any protocol control blocks associated with sockets; used
 for debugging.
-.Tp Fl a
+.It Fl a
 With the default display,
 show the state of all sockets; normally sockets used by
 server processes are not shown.
 With the default display,
 show the state of all sockets; normally sockets used by
 server processes are not shown.
-.Tp Fl d
+.It Fl d
 With either interface display (option
 .Fl i
 or an interval, as described below),
 show the number of dropped packets.
 With either interface display (option
 .Fl i
 or an interval, as described below),
 show the number of dropped packets.
-.Tp Fl h
-Show the state of the IMP host table.
-.Tp Fl i
+.It Fl g
+Show information related to multicast (group address) routing.
+By default, show the IP Multicast virtual-interface and routing tables.
+If the
+.Fl s
+option is also present, show multicast routing statistics.
+.It Fl h
+Show the state of the
+.Tn IMP
+host table (obsolete).
+.It Fl i
 Show the state of interfaces which have been auto-configured
 (interfaces statically configured into a system, but not
 located at boot time are not shown).
 Show the state of interfaces which have been auto-configured
 (interfaces statically configured into a system, but not
 located at boot time are not shown).
-.Tp Cx Fl I
-.Ws
-.Ar interface
-.Cx
-Show information only about this interface;
-used with an
+If the
+.Fl a
+options is also present, multicast addresses currently in use are shown
+for each Ethernet interface and for each IP interface address.
+Multicast addresses are shown on separate lines following the interface
+address with which they are associated.
+.It Fl I Ar interface 
+Show information about the specified interface;
+used with a
 .Ar wait
 interval as described below.
 .Ar wait
 interval as described below.
-.Tp Fl M
+.It Fl M
 Extract values associated with the name list from the specified core
 instead of the default
 .Pa /dev/kmem .
 Extract values associated with the name list from the specified core
 instead of the default
 .Pa /dev/kmem .
-.Tp Fl m
+.It Fl m
 Show statistics recorded by the memory management routines
 (the network manages a private pool of memory buffers).
 Show statistics recorded by the memory management routines
 (the network manages a private pool of memory buffers).
-.Tp Fl N
+.It Fl N
 Extract the name list from the specified system instead of the default
 .Pa /vmunix .
 Extract the name list from the specified system instead of the default
 .Pa /vmunix .
-.Tp Fl n
+.It Fl n
 Show network addresses as numbers (normally
 .Nm netstat
 interprets addresses and attempts to display them
 symbolically).
 This option may be used with any of the display formats.
 Show network addresses as numbers (normally
 .Nm netstat
 interprets addresses and attempts to display them
 symbolically).
 This option may be used with any of the display formats.
-.Tp Cx Fl p
-.Ws
-.Ar protocol
-.Cx
+.It Fl p Ar protocol 
 Show statistics about
 .Ar protocol  ,
 which is either a well-known name for a protocol or an alias for it.  Some
 Show statistics about
 .Ar protocol  ,
 which is either a well-known name for a protocol or an alias for it.  Some
@@ -111,17 +118,15 @@ report.
 The program will complain if
 .Ar protocol
 is unknown or if there is no statistics routine for it.
 The program will complain if
 .Ar protocol
 is unknown or if there is no statistics routine for it.
-.Tp Fl s
+.It Fl s
 Show per-protocol statistics.
 Show per-protocol statistics.
-.Tp Fl r
+If this option is repeated, counters with a value of zero are suppressed.
+.It Fl r
 Show the routing tables.
 When
 .Fl s
 is also present, show routing statistics instead.
 Show the routing tables.
 When
 .Fl s
 is also present, show routing statistics instead.
-.Tp Cx Fl f
-.Ws
-.Ar address_family
-.Cx
+.It Fl f Ar address_family 
 Limit statistics or address control block reports to those
 of the specified
 .Ar address family  .
 Limit statistics or address control block reports to those
 of the specified
 .Ar address family  .
@@ -129,15 +134,22 @@ The following address families
 are recognized:
 .Ar inet  ,
 for
 are recognized:
 .Ar inet  ,
 for
-.Li AF_INET  ,
+.Dv AF_INET  ,
 .Ar ns ,
 for
 .Ar ns ,
 for
-.Li AF_NS  ,
+.Dv AF_NS  ,
+.Ar iso ,
+for
+.Dv AF_ISO ,
 and
 .Ar unix  ,
 for
 and
 .Ar unix  ,
 for
-.Li AF_UNIX  .
-.Tp
+.Dv AF_UNIX  .
+.It Fl w Ar wait
+Show network interface statistics at intervals of
+.Ar wait
+seconds.
+.El
 .Pp
 The default display, for active sockets, shows the local
 and remote addresses, send and receive queue sizes (in bytes), protocol,
 .Pp
 The default display, for active sockets, shows the local
 and remote addresses, send and receive queue sizes (in bytes), protocol,
@@ -169,10 +181,31 @@ and the maximum transmission unit (``mtu'') are also displayed.
 The routing table display indicates the available routes and
 their status.  Each route consists of a destination host or network
 and a gateway to use in forwarding packets.  The flags field shows
 The routing table display indicates the available routes and
 their status.  Each route consists of a destination host or network
 and a gateway to use in forwarding packets.  The flags field shows
-the state of the route (``U'' if ``up''), whether the route
-is to a gateway (``G''), whether the route was created dynamically
-by a redirect (``D''), and whether the route has been modified
-by a redirect (``M'').  Direct routes are created for each
+a collection of information about the route stored as
+binary choices.  The individual flags are discussed in more
+detail in the
+.Xr route 8
+and
+.Xr route 4
+manual pages.
+The mapping between letters and flags is:
+.Bd -literal
+U   RTF_UP        Route useable 
+G   RTF_GATEWAY   Destination requires forwarding by intermediary
+H   RTF_HOST      Host entry (net otherwise) 
+R   RTF_REJECT    Host or net unreachable 
+D   RTF_DYNAMIC   Created dynamically (by redirect) 
+M   RTF_MODIFIED  Modified dynamically (by redirect) 
+C   RTF_CLONING   Generate new routes on use 
+X   RTF_XRESOLVE  External daemon translates proto to link address
+L   RTF_LLINFO    Valid protocol to link address translation.
+S   RTF_STATIC    Manually added 
+B   RTF_BLACKHOLE Just discard pkts (during updates) 
+1   RTF_PROTO2    Protocol specific routing flag #1 
+2   RTF_PROTO1    Protocol specific routing flag #2 
+.Ed
+.Pp
+Direct routes are created for each
 interface attached to the local host;
 the gateway field for such entries shows the address of the outgoing interface.
 The refcnt field gives the
 interface attached to the local host;
 the gateway field for such entries shows the address of the outgoing interface.
 The refcnt field gives the
@@ -186,10 +219,14 @@ interface utilized for the route.
 .Pp
 When
 .Nm netstat
 .Pp
 When
 .Nm netstat
-is invoked with a
+is invoked with the
+.Fl w
+option and a
 .Ar wait
 interval argument, it displays a running count of statistics related to
 network interfaces.
 .Ar wait
 interval argument, it displays a running count of statistics related to
 network interfaces.
+An obsolescent version of this option used a numeric parameter
+with no option, and is currently supported for backward compatibility.
 This display consists of a column for the primary interface (the first
 interface found during autoconfiguration) and a column summarizing
 information for all interfaces.
 This display consists of a column for the primary interface (the first
 interface found during autoconfiguration) and a column summarizing
 information for all interfaces.
@@ -211,8 +248,10 @@ accumulated over the preceding interval.
 .Xr trpt 8 ,
 .Xr trsp 8
 .Sh HISTORY
 .Xr trpt 8 ,
 .Xr trsp 8
 .Sh HISTORY
-.Nm Netstat
-appeared in 4.2 BSD.
+The
+.Nm netstat
+command appeared in
+.Bx 4.2 .
 .\" .Sh FILES
 .\" .Bl -tag -width /dev/kmem -compact
 .\" .It Pa /vmunix
 .\" .Sh FILES
 .\" .Bl -tag -width /dev/kmem -compact
 .\" .It Pa /vmunix
@@ -222,5 +261,3 @@ appeared in 4.2 BSD.
 .\" .El
 .Sh BUGS
 The notion of errors is ill-defined.
 .\" .El
 .Sh BUGS
 The notion of errors is ill-defined.
-.Pp
-Collisions mean something else for the IMP.