summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2014-05-08 19:35:12 +0000
committermelifaro <melifaro@FreeBSD.org>2014-05-08 19:35:12 +0000
commit0576e440912c1dc60e93e505b337ba5ce6f23148 (patch)
tree24a4db7a7d8960d039590cfdfd373acba8a7db28 /usr.bin/netstat
parent89bf7e80ea7ce88fd4bbd25c5f6576c40dea5acd (diff)
downloadFreeBSD-src-0576e440912c1dc60e93e505b337ba5ce6f23148.zip
FreeBSD-src-0576e440912c1dc60e93e505b337ba5ce6f23148.tar.gz
Merge r260524,r260540
r260524: Add -4/-6 shorthand for -finet/-finet6 in route(8) and netstat(8). r260540: Bump dates in nestat(1) and route(8) man pages. Fix several small errors introduced by r260524. Suggested by: glebius
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/main.c32
-rw-r--r--usr.bin/netstat/netstat.123
2 files changed, 39 insertions, 16 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 89a7f57..42e7080 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -350,9 +350,23 @@ main(int argc, char *argv[])
af = AF_UNSPEC;
- while ((ch = getopt(argc, argv, "AaBbdF:f:ghI:iLlM:mN:np:Qq:rSTsuWw:xz"))
+ while ((ch = getopt(argc, argv, "46AaBbdF:f:ghI:iLlM:mN:np:Qq:rSTsuWw:xz"))
!= -1)
switch(ch) {
+ case '4':
+#ifdef INET
+ af = AF_INET;
+#else
+ errx(1, "IPv4 support is not compiled in");
+#endif
+ break;
+ case '6':
+#ifdef INET6
+ af = AF_INET6;
+#else
+ errx(1, "IPv6 support is not compiled in");
+#endif
+ break;
case 'A':
Aflag = 1;
break;
@@ -850,21 +864,21 @@ static void
usage(void)
{
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
-"usage: netstat [-AaLnSTWx] [-f protocol_family | -p protocol]\n"
+"usage: netstat [-46AaLnSTWx] [-f protocol_family | -p protocol]\n"
" [-M core] [-N system]",
-" netstat -i | -I interface [-abdhnW] [-f address_family]\n"
+" netstat -i | -I interface [-46abdhnW] [-f address_family]\n"
" [-M core] [-N system]",
-" netstat -w wait [-I interface] [-d] [-M core] [-N system] [-q howmany]",
-" netstat -s [-s] [-z] [-f protocol_family | -p protocol]\n"
+" netstat -w wait [-I interface] [-46d] [-M core] [-N system] [-q howmany]",
+" netstat -s [-s] [-46z] [-f protocol_family | -p protocol]\n"
" [-M core] [-N system]",
-" netstat -i | -I interface -s [-f protocol_family | -p protocol]\n"
+" netstat -i | -I interface [-46s] [-f protocol_family | -p protocol]\n"
" [-M core] [-N system]",
" netstat -m [-M core] [-N system]",
" netstat -B [-I interface]",
-" netstat -r [-AanW] [-f address_family] [-M core] [-N system]",
+" netstat -r [-46AanW] [-f address_family] [-M core] [-N system]",
" netstat -rs [-s] [-M core] [-N system]",
-" netstat -g [-W] [-f address_family] [-M core] [-N system]",
-" netstat -gs [-s] [-f address_family] [-M core] [-N system]",
+" netstat -g [-46W] [-f address_family] [-M core] [-N system]",
+" netstat -gs [-46s] [-f address_family] [-M core] [-N system]",
" netstat -Q");
exit(1);
}
diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1
index d4f12af..2c998b7 100644
--- a/usr.bin/netstat/netstat.1
+++ b/usr.bin/netstat/netstat.1
@@ -28,7 +28,7 @@
.\" @(#)netstat.1 8.8 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd October 15, 2013
+.Dd January 11, 2014
.Dt NETSTAT 1
.Os
.Sh NAME
@@ -45,7 +45,7 @@ depending on the options for the information presented.
.It Xo
.Bk -words
.Nm
-.Op Fl AaLnSTWx
+.Op Fl 46AaLnSTWx
.Op Fl f Ar protocol_family | Fl p Ar protocol
.Op Fl M Ar core
.Op Fl N Ar system
@@ -92,7 +92,7 @@ retransmits, out-of-order packets received, and zero-sized windows advertised.
.Bk -words
.Nm
.Fl i | I Ar interface
-.Op Fl abdhnW
+.Op Fl 46abdhnW
.Op Fl f Ar address_family
.Ek
.Xc
@@ -153,7 +153,7 @@ is also present, show the number of dropped packets.
.Bk -words
.Nm
.Fl s Op Fl s
-.Op Fl z
+.Op Fl 46z
.Op Fl f Ar protocol_family | Fl p Ar protocol
.Op Fl M Ar core
.Op Fl N Ar system
@@ -174,6 +174,7 @@ is also present, reset statistic counters after displaying them.
.Bk -words
.Nm
.Fl i | I Ar interface Fl s
+.Op Fl 46
.Op Fl f Ar protocol_family | Fl p Ar protocol
.Op Fl M Ar core
.Op Fl N Ar system
@@ -214,7 +215,7 @@ states.
.Bk -words
.Nm
.Fl r
-.Op Fl AanW
+.Op Fl 46AanW
.Op Fl F Ar fibnum
.Op Fl f Ar address_family
.Op Fl M Ar core
@@ -268,7 +269,7 @@ is repeated, counters with a value of zero are suppressed.
.Bk -words
.Nm
.Fl g
-.Op Fl W
+.Op Fl 46W
.Op Fl f Ar address_family
.Op Fl M Ar core
.Op Fl N Ar system
@@ -287,7 +288,7 @@ address families.
.Bk -words
.Nm
.Fl gs
-.Op Fl s
+.Op Fl 46s
.Op Fl f Ar address_family
.Op Fl M Ar core
.Op Fl N Ar system
@@ -316,6 +317,14 @@ The flags field shows available ISR handlers:
.Pp
Some options have the general meaning:
.Bl -tag -width flag
+.It Fl 4
+Is shorthand for
+.Fl f
+.Ar inet
+.It Fl 6
+Is shorthand for
+.Fl f
+.Ar inet6
.It Fl f Ar address_family , Fl p Ar protocol
Limit display to those records
of the specified
OpenPOWER on IntegriCloud