summaryrefslogtreecommitdiffstats
path: root/freebsd/usr.bin/netstat/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/usr.bin/netstat/main.c')
-rw-r--r--freebsd/usr.bin/netstat/main.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/freebsd/usr.bin/netstat/main.c b/freebsd/usr.bin/netstat/main.c
index f3d1003f..1caecbe0 100644
--- a/freebsd/usr.bin/netstat/main.c
+++ b/freebsd/usr.bin/netstat/main.c
@@ -444,9 +444,23 @@ main(int argc, char *argv[])
af = AF_UNSPEC;
- while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:Qq:rSTsuWw:xz"))
+ while ((ch = getopt(argc, argv, "46AaBbdf: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;
@@ -891,21 +905,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);
}