1 .\" $NetBSD: sockstat.1,v 1.6 2006/07/14 21:14:24 peter Exp $
3 .\" Copyright (c) 2005 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
30 .\" Copyright (c) 1999 Dag-Erling Coïdan Smørgrav
31 .\" All rights reserved.
33 .\" Redistribution and use in source and binary forms, with or without
34 .\" modification, are permitted provided that the following conditions
36 .\" 1. Redistributions of source code must retain the above copyright
37 .\" notice, this list of conditions and the following disclaimer
38 .\" in this position and unchanged.
39 .\" 2. Redistributions in binary form must reproduce the above copyright
40 .\" notice, this list of conditions and the following disclaimer in the
41 .\" documentation and/or other materials provided with the distribution.
42 .\" 3. The name of the author may not be used to endorse or promote products
43 .\" derived from this software without specific prior written permission.
45 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
46 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
47 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
48 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
49 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
51 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
52 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
53 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
54 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 .\" FreeBSD: src/usr.bin/sockstat/sockstat.1,v 1.19 2004/08/25 16:36:17 roam Exp
67 .Op Fl f Ar address_family
72 command lists open Internet or
76 The following options are available:
87 Show connected sockets.
88 .It Fl f Ar address_family
89 Limit listed sockets to those of the specified
91 The following address families
106 Show listening sockets.
109 No attempt will be made to look up symbolic names for addresses
112 Only show Internet sockets if either the local or foreign port number
113 is on the specified list.
116 argument is a comma-separated list of port numbers and ranges
117 specified as first and last port separated by a dash.
131 will list sockets in all three domains.
139 will list both listening and connected sockets, as well as those
140 sockets that are in neither state.
142 The information listed for each
144 .Bl -tag -width "FOREIGN ADDRESS"
146 The user who owns the socket.
148 The command which holds the socket.
150 The process ID of the command which holds the socket.
152 The file descriptor number of the socket.
154 The transport protocol associated with the socket for Internet
155 sockets, or the type of socket (stream or datagram) for
159 For Internet sockets, this is the address to which the local end
160 of the socket is bound (see
161 .Xr getsockname 2 ) .
164 sockets, it is the socket's filename or
166 .It Li FOREIGN ADDRESS
167 The address to which the foreign end of the socket is bound (see
186 It was then rewritten for
192 command was written by
194 .Aq atatat@NetBSD.org .
195 This manual page was written by
196 .An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org
197 and was adapted to match the
201 .Aq atatat@NetBSD.org .