]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/netstat/netstat.1
Upgrade our copy of clang and llvm to 3.5.1 release. This is a bugfix
[FreeBSD/FreeBSD.git] / usr.bin / netstat / netstat.1
1 .\" Copyright (c) 1983, 1990, 1992, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)netstat.1   8.8 (Berkeley) 4/18/94
29 .\" $FreeBSD$
30 .\"
31 .Dd June 4, 2014
32 .Dt NETSTAT 1
33 .Os
34 .Sh NAME
35 .Nm netstat
36 .Nd show network status and statistics
37 .Sh SYNOPSIS
38 .Bk -words
39 .Bl -tag -width "netstat"
40 .It Nm
41 .Op Fl 46AaLnRSTWx
42 .Op Fl f Ar protocol_family | Fl p Ar protocol
43 .Op Fl M Ar core
44 .Op Fl N Ar system
45 .It Nm Fl i | I Ar interface
46 .Op Fl 46abdhnW
47 .Op Fl f Ar address_family
48 .Op Fl M Ar core
49 .Op Fl N Ar system
50 .It Nm Fl w Ar wait
51 .Op Fl I Ar interface
52 .Op Fl 46d
53 .Op Fl M Ar core
54 .Op Fl N Ar system
55 .Op Fl q Ar howmany
56 .It Nm Fl s
57 .Op Fl 46sz
58 .Op Fl f Ar protocol_family | Fl p Ar protocol
59 .Op Fl M Ar core
60 .Op Fl N Ar system
61 .It Nm Fl i | I Ar interface Fl s
62 .Op Fl 46s
63 .Op Fl f Ar protocol_family | Fl p Ar protocol
64 .Op Fl M Ar core
65 .Op Fl N Ar system
66 .It Nm Fl m
67 .Op Fl M Ar core
68 .Op Fl N Ar system
69 .It Nm Fl B
70 .Op Fl z
71 .Op Fl I Ar interface
72 .It Nm Fl r
73 .Op Fl 46AnW
74 .Op Fl F Ar fibnum
75 .Op Fl f Ar address_family
76 .Op Fl M Ar core
77 .Op Fl N Ar system
78 .It Nm Fl rs
79 .Op Fl s
80 .Op Fl M Ar core
81 .Op Fl N Ar system
82 .It Nm Fl g
83 .Op Fl 46W
84 .Op Fl f Ar address_family
85 .Op Fl M Ar core
86 .Op Fl N Ar system
87 .It Nm Fl gs
88 .Op Fl 46s
89 .Op Fl f Ar address_family
90 .Op Fl M Ar core
91 .Op Fl N Ar system
92 .It Nm Fl Q
93 .El
94 .Ek
95 .Sh DESCRIPTION
96 The
97 .Nm
98 command symbolically displays the contents of various network-related
99 data structures.
100 There are a number of output formats,
101 depending on the options for the information presented.
102 .Bl -tag -width indent
103 .It Xo
104 .Bk -words
105 .Nm
106 .Op Fl 46AaLnRSTWx
107 .Op Fl f Ar protocol_family | Fl p Ar protocol
108 .Op Fl M Ar core
109 .Op Fl N Ar system
110 .Ek
111 .Xc
112 Display a list of active sockets
113 (protocol control blocks)
114 for each network protocol.
115 .Pp
116 The default display for active sockets shows the local
117 and remote addresses, send and receive queue sizes (in bytes), protocol,
118 and the internal state of the protocol.
119 Address formats are of the form
120 .Dq host.port
121 or
122 .Dq network.port
123 if a socket's address specifies a network but no specific host address.
124 When known, the host and network addresses are displayed symbolically
125 according to the databases
126 .Xr hosts 5
127 and
128 .Xr networks 5 ,
129 respectively.
130 If a symbolic name for an address is unknown, or if
131 the
132 .Fl n
133 option is specified, the address is printed numerically, according
134 to the address family.
135 For more information regarding
136 the Internet IPv4
137 .Dq dot format ,
138 refer to
139 .Xr inet 3 .
140 Unspecified,
141 or
142 .Dq wildcard ,
143 addresses and ports appear as
144 .Dq Li * .
145 .Bl -tag -width indent
146 .It Fl 4
147 Show IPv4 only.
148 See
149 .Sx GENERAL OPTIONS .
150 .It Fl 6
151 Show IPv6 only.
152 See
153 .Sx GENERAL OPTIONS .
154 .It Fl A
155 Show the address of a protocol control block (PCB)
156 associated with a socket; used for debugging.
157 .It Fl a
158 Show the state of all sockets;
159 normally sockets used by server processes are not shown.
160 .It Fl L
161 Show the size of the various listen queues.
162 The first count shows the number of unaccepted connections,
163 the second count shows the amount of unaccepted incomplete connections,
164 and the third count is the maximum number of queued connections.
165 .It Fl n
166 Do not resolve numeric addresses and port numbers to names.
167 See
168 .Sx GENERAL OPTIONS .
169 .It Fl R
170 Display the flowid and flowtype for each socket.
171 flowid is a 32 bit hardware specific identifier for each flow.
172 flowtype defines which protocol fields are hashed to produce the id.
173 A complete listing is available in
174 .Pa sys/mbuf.h
175 under
176 .Dv M_HASHTYPE_* .
177 .It Fl S
178 Show network addresses as numbers (as with
179 .Fl n )
180 but show ports symbolically.
181 .It Fl T
182 Display diagnostic information from the TCP control block.
183 Fields include the number of packets requiring retransmission,
184 received out-of-order, and those advertising a zero-sized window.
185 .It Fl W
186 Avoid truncating addresses even if this causes some fields to overflow.
187 .It Fl x
188 Display socket buffer and TCP timer statistics for each
189 internet socket.
190 .Pp
191 The
192 .Fl x
193 flag causes
194 .Nm
195 to output all the information recorded about data
196 stored in the socket buffers.
197 The fields are:
198 .Bl -column ".Li R-MBUF"
199 .It Li R-MBUF Ta Number of mbufs in the receive queue.
200 .It Li S-MBUF Ta Number of mbufs in the send queue.
201 .It Li R-CLUS Ta Number of clusters, of any type, in the receive
202 queue.
203 .It Li S-CLUS Ta Number of clusters, of any type, in the send queue.
204 .It Li R-HIWA Ta Receive buffer high water mark, in bytes.
205 .It Li S-HIWA Ta Send buffer high water mark, in bytes.
206 .It Li R-LOWA Ta Receive buffer low water mark, in bytes.
207 .It Li S-LOWA Ta Send buffer low water mark, in bytes.
208 .It Li R-BCNT Ta Receive buffer byte count.
209 .It Li S-BCNT Ta Send buffer byte count.
210 .It Li R-BMAX Ta Maximum bytes that can be used in the receive buffer.
211 .It Li S-BMAX Ta Maximum bytes that can be used in the send buffer.
212 .El
213 .It Fl f Ar protocol_family
214 Filter by
215 .Ar protocol_family .
216 See
217 .Sx GENERAL OPTIONS .
218 .It Fl p Ar protocol
219 Filter by
220 .Ar protocol .
221 See
222 .Sx GENERAL OPTIONS .
223 .It Fl M
224 Use an alternative core.
225 See
226 .Sx GENERAL OPTIONS .
227 .It Fl N
228 Use an alternative kernel image.
229 See
230 .Sx GENERAL OPTIONS .
231 .El
232 .It Xo
233 .Bk -words
234 .Nm
235 .Fl i | I Ar interface
236 .Op Fl 46abdhnW
237 .Op Fl f Ar address_family
238 .Op Fl M Ar core
239 .Op Fl N Ar system
240 .Ek
241 .Xc
242 Show the state of all network interfaces or a single
243 .Ar interface
244 which have been auto-configured
245 (interfaces statically configured into a system, but not
246 located at boot time are not shown).
247 An asterisk
248 .Pq Dq Li *
249 after an interface name indicates that the interface is
250 .Dq down .
251 .Pp
252 When
253 .Nm
254 is invoked with
255 .Fl i
256 .Pq all interfaces
257 or
258 .Fl I Ar interface ,
259 it provides a table of cumulative
260 statistics regarding packets transferred, errors, and collisions.
261 The network addresses of the interface
262 and the maximum transmission unit
263 .Pq Dq mtu
264 are also displayed.
265 .Bl -tag -width indent
266 .It Fl 4
267 Show IPv4 only.
268 See
269 .Sx GENERAL OPTIONS .
270 .It Fl 6
271 Show IPv6 only.
272 See
273 .Sx GENERAL OPTIONS .
274 .It Fl a
275 Multicast addresses currently in use are shown
276 for each Ethernet interface and for each IP interface address.
277 Multicast addresses are shown on separate lines following the interface
278 address with which they are associated.
279 .It Fl b
280 Show the number of bytes in and out.
281 .It Fl d
282 Show the number of dropped packets.
283 .It Fl h
284 Print all counters in human readable form.
285 .It Fl n
286 Do not resolve numeric addresses and port numbers to names.
287 See
288 .Sx GENERAL OPTIONS .
289 .It Fl W
290 Avoid truncating interface names even if this causes some fields to overflow.
291 .Sx GENERAL OPTIONS .
292 .It Fl f Ar protocol_family
293 Filter by
294 .Ar protocol_family .
295 See
296 .Sx GENERAL OPTIONS .
297 .El
298 .It Xo
299 .Bk -words
300 .Nm
301 .Fl w Ar wait
302 .Op Fl I Ar interface
303 .Op Fl 46d
304 .Op Fl M Ar core
305 .Op Fl N Ar system
306 .Op Fl q Ar howmany
307 .Ek
308 .Xc
309 At intervals of
310 .Ar wait
311 seconds, display the information regarding packet traffic on all
312 configured network interfaces or a single
313 .Ar interface .
314 .Pp
315 When
316 .Nm
317 is invoked with the
318 .Fl w
319 option and a
320 .Ar wait
321 interval argument, it displays a running count of statistics related to
322 network interfaces.
323 An obsolescent version of this option used a numeric parameter
324 with no option, and is currently supported for backward compatibility.
325 By default, this display summarizes information for all interfaces.
326 Information for a specific interface may be displayed with the
327 .Fl I Ar interface
328 option.
329 .Bl -tag -width indent
330 .It Fl I Ar interface
331 Only show information regarding
332 .Ar interface
333 .It Fl 4
334 Show IPv4 only.
335 See
336 .Sx GENERAL OPTIONS .
337 .It Fl 6
338 Show IPv6 only.
339 See
340 .Sx GENERAL OPTIONS .
341 .It Fl d
342 Show the number of dropped packets.
343 .It Fl M
344 Use an alternative core.
345 See
346 .Sx GENERAL OPTIONS .
347 .It Fl N
348 Use an alternative kernel image.
349 See
350 .Sx GENERAL OPTIONS .
351 .It Fl q
352 Exit after
353 .Ar howmany
354 outputs.
355 .El
356 .It Xo
357 .Bk -words
358 .Nm
359 .Fl s
360 .Op Fl 46sz
361 .Op Fl f Ar protocol_family | Fl p Ar protocol
362 .Op Fl M Ar core
363 .Op Fl N Ar system
364 .Ek
365 .Xc
366 Display system-wide statistics for each network protocol.
367 .Bl -tag -width indent
368 .It Fl 4
369 Show IPv4 only.
370 See
371 .Sx GENERAL OPTIONS .
372 .It Fl 6
373 Show IPv6 only.
374 See
375 .Sx GENERAL OPTIONS .
376 .It Fl s
377 If
378 .Fl s
379 is repeated, counters with a value of zero are suppressed.
380 .It Fl z
381 Reset statistic counters after displaying them.
382 .It Fl f Ar protocol_family
383 Filter by
384 .Ar protocol_family .
385 See
386 .Sx GENERAL OPTIONS .
387 .It Fl p Ar protocol
388 Filter by
389 .Ar protocol .
390 See
391 .Sx GENERAL OPTIONS .
392 .It Fl M
393 Use an alternative core.
394 See
395 .Sx GENERAL OPTIONS .
396 .It Fl N
397 Use an alternative kernel image
398 See
399 .Sx GENERAL OPTIONS .
400 .El
401 .It Xo
402 .Bk -words
403 .Nm
404 .Fl i | I Ar interface Fl s
405 .Op Fl 46s
406 .Op Fl f Ar protocol_family | Fl p Ar protocol
407 .Op Fl M Ar core
408 .Op Fl N Ar system
409 .Ek
410 .Xc
411 Display per-interface statistics for each network protocol.
412 .Bl -tag -width indent
413 .It Fl 4
414 Show IPv4 only
415 See
416 .Sx GENERAL OPTIONS .
417 .It Fl 6
418 Show IPv6 only
419 See
420 .Sx GENERAL OPTIONS .
421 .It Fl s
422 If
423 .Fl s
424 is repeated, counters with a value of zero are suppressed.
425 .It Fl f Ar protocol_family
426 Filter by
427 .Ar protocol_family .
428 See
429 .Sx GENERAL OPTIONS .
430 .It Fl p Ar protocol
431 Filter by
432 .Ar protocol .
433 See
434 .Sx GENERAL OPTIONS .
435 .It Fl M
436 Use an alternative core
437 See
438 .Sx GENERAL OPTIONS .
439 .It Fl N
440 Use an alternative kernel image
441 See
442 .Sx GENERAL OPTIONS .
443 .El
444 .It Xo
445 .Bk -words
446 .Nm
447 .Fl m
448 .Op Fl M Ar core
449 .Op Fl N Ar system
450 .Ek
451 .Xc
452 Show statistics recorded by the memory management routines
453 .Pq Xr mbuf 9 .
454 The network manages a private pool of memory buffers.
455 .Bl -tag -width indent
456 .It Fl M
457 Use an alternative core
458 See
459 .Sx GENERAL OPTIONS .
460 .It Fl N
461 Use an alternative kernel image
462 See
463 .Sx GENERAL OPTIONS .
464 .El
465 .It Xo
466 .Bk -words
467 .Nm
468 .Fl B
469 .Op Fl z
470 .Op Fl I Ar interface
471 .Ek
472 .Xc
473 Show statistics about
474 .Xr bpf 4
475 peers.
476 This includes information like
477 how many packets have been matched, dropped and received by the
478 bpf device, also information about current buffer sizes and device
479 states.
480 .Pp
481 The
482 .Xr bpf 4
483 flags displayed when
484 .Nm
485 is invoked with the
486 .Fl B
487 option represent the underlying parameters of the bpf peer.
488 Each flag is
489 represented as a single lower case letter.
490 The mapping between the letters and flags in order of appearance are:
491 .Bl -column ".Li i"
492 .It Li p Ta Set if listening promiscuously
493 .It Li i Ta Dv BIOCIMMEDIATE No has been set on the device
494 .It Li f Ta Dv BIOCGHDRCMPLT No status: source link addresses are being
495 filled automatically
496 .It Li s Ta Dv BIOCGSEESENT No status: see packets originating locally and
497 remotely on the interface.
498 .It Li a Ta Packet reception generates a signal
499 .It Li l Ta Dv BIOCLOCK No status: descriptor has been locked
500 .El
501 .Pp
502 For more information about these flags, please refer to
503 .Xr bpf 4 .
504 .Bl -tag -width indent
505 .It Fl z
506 Reset statistic counters after displaying them.
507 .El
508 .It Xo
509 .Bk -words
510 .Nm
511 .Fl r
512 .Op Fl 46AnW
513 .Op Fl F Ar fibnum
514 .Op Fl f Ar address_family
515 .Op Fl M Ar core
516 .Op Fl N Ar system
517 .Ek
518 .Xc
519 Display the contents of routing tables.
520 .Pp
521 When
522 .Nm
523 is invoked with the routing table option
524 .Fl r ,
525 it lists the available routes and their status.
526 Each route consists of a destination host or network, and a gateway to use
527 in forwarding packets.
528 The flags field shows a collection of information about the route stored
529 as binary choices.
530 The individual flags are discussed in more detail in the
531 .Xr route 8
532 and
533 .Xr route 4
534 manual pages.
535 The mapping between letters and flags is:
536 .Bl -column ".Li W" ".Dv RTF_WASCLONED"
537 .It Li 1 Ta Dv RTF_PROTO1 Ta "Protocol specific routing flag #1"
538 .It Li 2 Ta Dv RTF_PROTO2 Ta "Protocol specific routing flag #2"
539 .It Li 3 Ta Dv RTF_PROTO3 Ta "Protocol specific routing flag #3"
540 .It Li B Ta Dv RTF_BLACKHOLE Ta "Just discard pkts (during updates)"
541 .It Li b Ta Dv RTF_BROADCAST Ta "The route represents a broadcast address"
542 .It Li D Ta Dv RTF_DYNAMIC Ta "Created dynamically (by redirect)"
543 .It Li G Ta Dv RTF_GATEWAY Ta "Destination requires forwarding by intermediary"
544 .It Li H Ta Dv RTF_HOST Ta "Host entry (net otherwise)"
545 .It Li L Ta Dv RTF_LLINFO Ta "Valid protocol to link address translation"
546 .It Li M Ta Dv RTF_MODIFIED Ta "Modified dynamically (by redirect)"
547 .It Li R Ta Dv RTF_REJECT Ta "Host or net unreachable"
548 .It Li S Ta Dv RTF_STATIC Ta "Manually added"
549 .It Li U Ta Dv RTF_UP Ta "Route usable"
550 .It Li X Ta Dv RTF_XRESOLVE Ta "External daemon translates proto to link address"
551 .El
552 .Pp
553 Direct routes are created for each
554 interface attached to the local host;
555 the gateway field for such entries shows the address of the outgoing interface.
556 The refcnt field gives the
557 current number of active uses of the route.
558 Connection oriented
559 protocols normally hold on to a single route for the duration of
560 a connection while connectionless protocols obtain a route while sending
561 to the same destination.
562 The use field provides a count of the number of packets
563 sent using that route.
564 The interface entry indicates the network interface utilized for the route.
565 .Bl -tag -width indent
566 .It Fl 4
567 Show IPv4 only.
568 See
569 .Sx GENERAL OPTIONS .
570 .It Fl 6
571 Show IPv6 only.
572 See
573 .Sx GENERAL OPTIONS .
574 .It Fl A
575 Show the contents of the internal Patricia tree
576 structures; used for debugging.
577 .It Fl n
578 Do not resolve numeric addresses and port numbers to names.
579 See
580 .Sx GENERAL OPTIONS .
581 .It Fl W
582 Show the path MTU for each route, and print interface names with a
583 wider field size.
584 .It Fl F
585 Display the routing table with the number
586 .Ar fibnum .
587 If the specified
588 .Ar fibnum
589 is -1 or
590 .Fl F
591 is not specified,
592 the default routing table is displayed.
593 .It Fl f
594 Display the routing table for a particular
595 .Ar address_family .
596 .It Fl M
597 Use an alternative core
598 See
599 .Sx GENERAL OPTIONS .
600 .It Fl N
601 Use an alternative kernel image
602 See
603 .Sx GENERAL OPTIONS .
604 .El
605 .It Xo
606 .Bk -words
607 .Nm
608 .Fl rs
609 .Op Fl s
610 .Op Fl M Ar core
611 .Op Fl N Ar system
612 .Ek
613 .Xc
614 Display routing statistics.
615 .Bl -tag -width indent
616 .It Fl s
617 If
618 .Fl s
619 is repeated, counters with a value of zero are suppressed.
620 .It Fl M
621 Use an alternative core
622 See
623 .Sx GENERAL OPTIONS .
624 .It Fl N
625 Use an alternative kernel image
626 See
627 .Sx GENERAL OPTIONS .
628 .El
629 .It Xo
630 .Bk -words
631 .Nm
632 .Fl g
633 .Op Fl 46W
634 .Op Fl f Ar address_family
635 .Op Fl M Ar core
636 .Op Fl N Ar system
637 .Ek
638 .Xc
639 Display the contents of the multicast virtual interface tables,
640 and multicast forwarding caches.
641 Entries in these tables will appear only when the kernel is
642 actively forwarding multicast sessions.
643 This option is applicable only to the
644 .Cm inet
645 and
646 .Cm inet6
647 address families.
648 .Bl -tag -width indent
649 .It Fl 4
650 Show IPv4 only
651 See
652 .Sx GENERAL OPTIONS .
653 .It Fl 6
654 Show IPv6 only
655 See
656 .Sx GENERAL OPTIONS .
657 .It Fl W
658 Avoid truncating addresses even if this causes some fields to overflow.
659 .It Fl f Ar protocol_family
660 Filter by
661 .Ar protocol_family .
662 See
663 .Sx GENERAL OPTIONS .
664 .It Fl M
665 Use an alternative core
666 See
667 .Sx GENERAL OPTIONS .
668 .It Fl N
669 Use an alternative kernel image
670 See
671 .Sx GENERAL OPTIONS .
672 .El
673 .It Xo
674 .Bk -words
675 .Nm
676 .Fl gs
677 .Op Fl 46s
678 .Op Fl f Ar address_family
679 .Op Fl M Ar core
680 .Op Fl N Ar system
681 .Ek
682 .Xc
683 Show multicast routing statistics.
684 .Bl -tag -width indent
685 .It Fl 4
686 Show IPv4 only
687 See
688 .Sx GENERAL OPTIONS .
689 .It Fl 6
690 Show IPv6 only
691 See
692 .Sx GENERAL OPTIONS .
693 .It Fl s
694 If
695 .Fl s
696 is repeated, counters with a value of zero are suppressed.
697 .It Fl f Ar protocol_family
698 Filter by
699 .Ar protocol_family .
700 See
701 .Sx GENERAL OPTIONS .
702 .It Fl M
703 Use an alternative core
704 See
705 .Sx GENERAL OPTIONS .
706 .It Fl N
707 Use an alternative kernel image
708 See
709 .Sx GENERAL OPTIONS .
710 .El
711 .It Xo
712 .Bk -words
713 .Nm
714 .Fl Q
715 .Ek
716 .Xc
717 Show
718 .Xr netisr 9
719 statistics.
720 The flags field shows available ISR handlers:
721 .Bl -column ".Li W" ".Dv NETISR_SNP_FLAGS_DRAINEDCPU"
722 .It Li C Ta Dv NETISR_SNP_FLAGS_M2CPUID Ta "Able to map mbuf to cpu id"
723 .It Li D Ta Dv NETISR_SNP_FLAGS_DRAINEDCPU  Ta "Has queue drain handler"
724 .It Li F Ta Dv NETISR_SNP_FLAGS_M2FLOW Ta "Able to map mbuf to flow id"
725 .El
726 .El
727 .Pp
728 .Ss GENERAL OPTIONS
729 Some options have the general meaning:
730 .Bl -tag -width flag
731 .It Fl 4
732 Is shorthand for
733 .Fl f
734 .Ar inet
735 .Pq Show only IPv4
736 .It Fl 6
737 Is shorthand for
738 .Fl f
739 .Ar inet6
740 .Pq Show only IPv6
741 .It Fl f Ar address_family , Fl p Ar protocol
742 Limit display to those records
743 of the specified
744 .Ar address_family
745 or a single
746 .Ar protocol .
747 The following address families and protocols are recognized:
748 .Pp
749 .Bl -tag -width ".Cm netgraph , ng Pq Dv AF_NETGRAPH" -compact
750 .It Em Family
751 .Em Protocols
752 .It Cm inet Pq Dv AF_INET
753 .Cm divert , icmp , igmp , ip , ipsec , pim, sctp , tcp , udp
754 .It Cm inet6 Pq Dv AF_INET6
755 .Cm icmp6 , ip6 , ipsec6 , rip6 , tcp , udp
756 .It Cm pfkey Pq Dv PF_KEY
757 .Cm pfkey
758 .It Cm netgraph , ng Pq Dv AF_NETGRAPH
759 .Cm ctrl , data
760 .It Cm unix Pq Dv AF_UNIX
761 .It Cm link Pq Dv AF_LINK
762 .El
763 .Pp
764 The program will complain if
765 .Ar protocol
766 is unknown or if there is no statistics routine for it.
767 .It Fl M
768 Extract values associated with the name list from the specified core
769 instead of the default
770 .Pa /dev/kmem .
771 .It Fl N
772 Extract the name list from the specified system instead of the default,
773 which is the kernel image the system has booted from.
774 .It Fl n
775 Show network addresses and ports as numbers.
776 Normally
777 .Nm
778 attempts to resolve addresses and ports,
779 and display them symbolically.
780 .El
781 .Sh SEE ALSO
782 .Xr fstat 1 ,
783 .Xr nfsstat 1 ,
784 .Xr procstat 1 ,
785 .Xr ps 1 ,
786 .Xr sockstat 1 ,
787 .Xr bpf 4 ,
788 .Xr inet 4 ,
789 .Xr route 4 ,
790 .Xr unix 4 ,
791 .Xr hosts 5 ,
792 .Xr networks 5 ,
793 .Xr protocols 5 ,
794 .Xr services 5 ,
795 .Xr iostat 8 ,
796 .Xr route 8 ,
797 .Xr trpt 8 ,
798 .Xr vmstat 8 ,
799 .Xr mbuf 9
800 .Sh HISTORY
801 The
802 .Nm
803 command appeared in
804 .Bx 4.2 .
805 .Pp
806 IPv6 support was added by WIDE/KAME project.
807 .Sh BUGS
808 The notion of errors is ill-defined.