On Sun, Jul 27, 2014 at 11:15:41AM +0200, Claudio Jeker wrote:
> Not a big fan since this makes the bgpctl show output no longer fit 80
> chars and so will wrap lines on default terminals.
> [...]

Agreed, that's not good.

> While it is OK to
> increase the size it should be taken away from other fields in some whay.
> An option would be to drop the OutQ since that field has only limited
> value IMO.
> [...]

Right. I dare say on most links the OutQ column is 0 most of the
time anyway, or the link has problems that are visible in other
ways as well.

> [...]
> PS: you only need 11 chars and not 12 for AS-DOT notation
> [...]

Whoops, off by one.

The attached patch addresses the issues you pointed out by removing the
OutQ field and increasing the AS column width by 3 characters. The
output fits into 77 characters now.

-- 
        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    27 Jul 2014 09:53:18 -0000
@@ -508,8 +508,8 @@ fmt_peer(const char *descr, const struct
 void
 show_summary_head(void)
 {
-       printf("%-20s %8s %10s %10s %5s %-8s %s\n", "Neighbor", "AS",
-           "MsgRcvd", "MsgSent", "OutQ", "Up/Down", "State/PrfRcvd");
+       printf("%-20s %11s %10s %10s %-8s %s\n", "Neighbor", "AS",
+           "MsgRcvd", "MsgSent", "Up/Down", "State/PrfRcvd");
 }
 
 int
@@ -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 %11s %10llu %10llu %-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 +
@@ -533,7 +533,6 @@ show_summary_msg(struct imsg *imsg, int 
                    p->stats.msg_sent_open + p->stats.msg_sent_notification +
                    p->stats.msg_sent_update + p->stats.msg_sent_keepalive +
                    p->stats.msg_sent_rrefresh,
-                   p->wbuf.queued,
                    fmt_timeframe(p->stats.last_updown));
                if (p->state == STATE_ESTABLISHED) {
                        printf("%6u", p->stats.prefix_cnt);

Reply via email to