summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/inet.c
diff options
context:
space:
mode:
authorhiren <hiren@FreeBSD.org>2015-04-06 18:40:50 +0000
committerhiren <hiren@FreeBSD.org>2015-04-06 18:40:50 +0000
commit39fb34452ff3bc4927f319c53cfad417efb4e883 (patch)
treefab8dc20b771524ae042d1c3a2ab99512f74b231 /usr.bin/netstat/inet.c
parent511fc2e53ec0c25a92e2d1a47a46821b30ee2b6d (diff)
downloadFreeBSD-src-39fb34452ff3bc4927f319c53cfad417efb4e883.zip
FreeBSD-src-39fb34452ff3bc4927f319c53cfad417efb4e883.tar.gz
MFC r266418, r266448
Add the flowtype to the inpcb. Add -R to netstat to dump RSS/flow information. Reviewed by: delphij Relnotes: yes (for r266448) Sponsored by: Limelight Networks
Diffstat (limited to 'usr.bin/netstat/inet.c')
-rw-r--r--usr.bin/netstat/inet.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 09b3110..f8ff31b 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -429,7 +429,7 @@ protopr(u_long off, const char *name, int af1, int proto)
"%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s",
"Proto", "Recv-Q", "Send-Q",
"Local Address", "Foreign Address");
- if (!xflag)
+ if (!xflag && !Rflag)
printf(" (state)");
}
if (xflag) {
@@ -441,6 +441,9 @@ protopr(u_long off, const char *name, int af1, int proto)
printf(" %7.7s %7.7s %7.7s %7.7s %7.7s %7.7s",
"rexmt", "persist", "keep",
"2msl", "delack", "rcvtime");
+ } else if (Rflag) {
+ printf (" %8.8s %5.5s",
+ "flowid", "ftype");
}
putchar('\n');
first = 0;
@@ -549,7 +552,7 @@ protopr(u_long off, const char *name, int af1, int proto)
timer->tt_delack / 1000, (timer->tt_delack % 1000) / 10,
timer->t_rcvtime / 1000, (timer->t_rcvtime % 1000) / 10);
}
- if (istcp && !Lflag && !xflag && !Tflag) {
+ if (istcp && !Lflag && !xflag && !Tflag && !Rflag) {
if (tp->t_state < 0 || tp->t_state >= TCP_NSTATES)
printf("%d", tp->t_state);
else {
@@ -560,7 +563,12 @@ protopr(u_long off, const char *name, int af1, int proto)
putchar('*');
#endif /* defined(TF_NEEDSYN) && defined(TF_NEEDFIN) */
}
- }
+ }
+ if (Rflag) {
+ printf(" %08x %5d",
+ inp->inp_flowid,
+ inp->inp_flowtype);
+ }
putchar('\n');
}
if (xig != oxig && xig->xig_gen != oxig->xig_gen) {
OpenPOWER on IntegriCloud