Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / usr.bin / sockstat / sockstat.1
1 .\"-
2 .\" Copyright (c) 1999 Dag-Erling Coïdan Smørgrav
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer
10 .\"    in this position and unchanged.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. The name of the author may not be used to endorse or promote products
15 .\"    derived from this software without specific prior written permission.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD: src/usr.bin/sockstat/sockstat.1,v 1.6.2.7 2001/08/16 13:17:04 ru Exp $
29 .\" $DragonFly: src/usr.bin/sockstat/sockstat.1,v 1.2 2003/06/17 04:29:31 dillon Exp $
30 .\"
31 .Dd April 13, 1999
32 .Dt SOCKSTAT 1
33 .Os
34 .Sh NAME
35 .Nm sockstat
36 .Nd list open sockets
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl 46clu
40 .Sh DESCRIPTION
41 The
42 .Nm
43 command lists open Internet or
44 .Ux
45 domain sockets.
46 .Pp
47 The following options are available:
48 .Bl -tag -width Fl
49 .It Fl 4
50 Show
51 .Dv AF_INET
52 (IPv4) sockets.
53 .It Fl 6
54 Show
55 .Dv AF_INET6
56 (IPv6) sockets.
57 .It Fl c
58 Show connected sockets.
59 .It Fl l
60 Show listening sockets.
61 .It Fl u
62 Show
63 .Dv AF_LOCAL
64 .Pq Ux
65 sockets.
66 .El
67 .Pp
68 If neither
69 .Fl 4 , 6
70 or
71 .Fl u
72 is specified,
73 .Nm
74 will list sockets in all three domains.
75 .Pp
76 If neither
77 .Fl c
78 or
79 .Fl l
80 is specified,
81 .Nm
82 will list both listening and connected sockets.
83 .Pp
84 The information listed for each
85 socket is:
86 .Bl -tag -width "FOREIGN ADDRESS"
87 .It Li USER
88 The user who owns the socket.
89 .It Li COMMAND
90 The command which holds the socket.
91 .It Li PID
92 The process ID of the command which holds the socket.
93 .It Li FD
94 The file descriptor number of the socket.
95 .It Li PROTO
96 The transport protocol associated with the socket for Internet
97 sockets, or the type of socket (stream or datagram) for
98 .Ux
99 sockets.
100 .It Li ADDRESS
101 .No ( Ux
102 sockets only)
103 For bound sockets, this is the filename of the socket.
104 For other sockets, it is the name, PID and file descriptor number of
105 the peer, or
106 .Dq Li "(none)"
107 if the socket is neither bound nor connected.
108 .It Li LOCAL ADDRESS
109 (Internet sockets only)
110 The address the local end of the socket is bound to (see
111 .Xr getsockname 2 ) .
112 .It Li FOREIGN ADDRESS
113 (Internet sockets only)
114 The address the foreign end of the socket is bound to (see
115 .Xr getpeername 2 ) .
116 .El
117 .Sh SEE ALSO
118 .Xr fstat 1 ,
119 .Xr netstat 1 ,
120 .Xr inet 4 ,
121 .Xr inet6 4
122 .Sh HISTORY
123 The
124 .Nm
125 command appeared in
126 .Fx 3.1 .
127 .Sh AUTHORS
128 The
129 .Nm
130 command and this manual page were written by
131 .An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .