aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/netstat/inet.c
diff options
context:
space:
mode:
authorJonathan T. Looney <jtl@FreeBSD.org>2018-03-22 09:40:08 +0000
committerJonathan T. Looney <jtl@FreeBSD.org>2018-03-22 09:40:08 +0000
commit2529f56ed32d808dc3911c369c731f1b21664de6 (patch)
tree10fb714a61fcbeeb5416e8b9c9164da2772610d2 /usr.bin/netstat/inet.c
parentbf8e3513bbd411c51e6aa59995b0ef1e45bf55bb (diff)
Notes
Diffstat (limited to 'usr.bin/netstat/inet.c')
-rw-r--r--usr.bin/netstat/inet.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 03c779dcad70a..ad347f5c416ee 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -321,7 +321,7 @@ protopr(u_long off, const char *name, int af1, int proto)
"Proto", "Recv-Q", "Send-Q",
"Local Address", "Foreign Address");
if (!xflag && !Rflag)
- xo_emit(" (state)");
+ xo_emit(" {T:/%-11.11s}", "(state)");
}
if (xflag) {
xo_emit(" {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} "
@@ -339,6 +339,8 @@ protopr(u_long off, const char *name, int af1, int proto)
xo_emit(" {T:/%8.8s} {T:/%5.5s}",
"flowid", "ftype");
}
+ if (Pflag)
+ xo_emit(" {T:/%s}", "Log ID");
xo_emit("\n");
first = 0;
}
@@ -478,9 +480,9 @@ protopr(u_long off, const char *name, int af1, int proto)
}
if (istcp && !Lflag && !xflag && !Tflag && !Rflag) {
if (tp->t_state < 0 || tp->t_state >= TCP_NSTATES)
- xo_emit("{:tcp-state/%d}", tp->t_state);
+ xo_emit("{:tcp-state/%-11d}", tp->t_state);
else {
- xo_emit("{:tcp-state/%s}",
+ xo_emit("{:tcp-state/%-11s}",
tcpstates[tp->t_state]);
#if defined(TF_NEEDSYN) && defined(TF_NEEDFIN)
/* Show T/TCP `hidden state' */
@@ -495,6 +497,9 @@ protopr(u_long off, const char *name, int af1, int proto)
inp->inp_flowid,
inp->inp_flowtype);
}
+ if (istcp && Pflag)
+ xo_emit(" {:log-id/%s}", tp->xt_logid[0] == '\0' ?
+ "-" : tp->xt_logid);
xo_emit("\n");
xo_close_instance("socket");
}