Hi people,
I'm running OpenBGPD with a few peers that have large 4-byte AS numbers.
Displaying the table of peers with `bgpctl show` shows the stats just
fine, but the length of the AS number shifts the content of the
statistics confusingly far to the right, such as in the following
example:
$ bgpctl show
Neighbor AS MsgRcvd MsgSent OutQ Up/Down
State/PrfRcvd
peer 1 64734.12580 316 466 0 00:07:04 364
peer 2 64734.12578 251 293 0 00:40:06 365
peer 3 64828 17545 13466 0 3d17h35m 325
The attached patch makes the 'AS' column 4 characters larger, with the
following result:
$ bgpctl show
Neighbor AS MsgRcvd MsgSent OutQ Up/Down
State/PrfRcvd
peer 1 64734.12580 317 468 0 00:07:51 364
peer 2 64734.12578 252 295 0 00:40:53 365
peer 3 64828 17547 13467 0 3d17h36m 325
--
Gregor Best
Index: bgpctl.c
===================================================================
RCS file: /mnt/media/cvs/src/usr.sbin/bgpctl/bgpctl.c,v
retrieving revision 1.174
diff -u -p -u -r1.174 bgpctl.c
--- bgpctl.c 18 Mar 2014 13:47:14 -0000 1.174
+++ bgpctl.c 26 Jul 2014 13:49:17 -0000
@@ -508,7 +508,7 @@ fmt_peer(const char *descr, const struct
void
show_summary_head(void)
{
- printf("%-20s %8s %10s %10s %5s %-8s %s\n", "Neighbor", "AS",
+ printf("%-20s %12s %10s %10s %5s %-8s %s\n", "Neighbor", "AS",
"MsgRcvd", "MsgSent", "OutQ", "Up/Down", "State/PrfRcvd");
}
@@ -525,7 +525,7 @@ show_summary_msg(struct imsg *imsg, int
p->conf.remote_masklen, nodescr);
if (strlen(s) >= 20)
s[20] = 0;
- printf("%-20s %8s %10llu %10llu %5u %-8s ",
+ printf("%-20s %12s %10llu %10llu %5u %-8s ",
s, log_as(p->conf.remote_as),
p->stats.msg_rcvd_open + p->stats.msg_rcvd_notification +
p->stats.msg_rcvd_update + p->stats.msg_rcvd_keepalive +