summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/netstat/main.c')
-rw-r--r--usr.bin/netstat/main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index f54db4e..43b3232 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -342,6 +342,7 @@ int Qflag; /* show netisr information */
int rflag; /* show routing tables (or routing stats) */
int sflag; /* show protocol statistics */
int Wflag; /* wide display */
+int Tflag; /* TCP Information */
int xflag; /* extra information, includes all socket buffer info */
int zflag; /* zero stats */
@@ -361,7 +362,7 @@ main(int argc, char *argv[])
af = AF_UNSPEC;
- while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:Qq:rSsuWw:xz"))
+ while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:Qq:rSTsuWw:xz"))
!= -1)
switch(ch) {
case 'A':
@@ -476,6 +477,9 @@ main(int argc, char *argv[])
interval = atoi(optarg);
iflag = 1;
break;
+ case 'T':
+ Tflag = 1;
+ break;
case 'x':
xflag = 1;
break;
@@ -515,6 +519,9 @@ main(int argc, char *argv[])
if (!live)
setgid(getgid());
+ if (xflag && Tflag)
+ errx(1, "-x and -T are incompatible, pick one.");
+
if (Bflag) {
if (!live)
usage();
@@ -794,7 +801,7 @@ 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 [-AaLnSWx] [-f protocol_family | -p protocol]\n"
+"usage: netstat [-AaLnSTWx] [-f protocol_family | -p protocol]\n"
" [-M core] [-N system]",
" netstat -i | -I interface [-abdhnW] [-f address_family]\n"
" [-M core] [-N system]",
OpenPOWER on IntegriCloud