From 588a30273da0c8833d62011151a44e4d8d571ddf Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 22 Nov 2019 19:29:55 -0500 Subject: [PATCH 1/3] zebra: Adjust column display of `show zebra client summ` for openfabric The openfabric daemon has a longer name than anticipated for `show zebra client summary` adjust to allow it to fit without making columns all blomped. Before: robot# show zebra client summ Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes -------------------------------------------------------------------------------- static 00:00:06 00:00:06 00:00:06 4/0 0/0 openfabric 00:00:06 00:00:06 00:00:06 0/0 0/0 After: [sharpd@robot frr4]$ vtysh -c "show zebra client summ" Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes -------------------------------------------------------------------------------- static 00:02:16 00:02:16 00:02:16 4/0 0/0 openfabric 00:02:16 00:02:16 00:02:16 0/0 0/0 Signed-off-by: Donald Sharp --- zebra/zserv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zebra/zserv.c b/zebra/zserv.c index b0991e98f8..d361929593 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -965,7 +965,7 @@ static void zebra_show_client_brief(struct vty *vty, struct zserv *client) last_write_time = (time_t)atomic_load_explicit(&client->last_write_time, memory_order_relaxed); - vty_out(vty, "%-8s%12s %12s%12s%8d/%-8d%8d/%-8d\n", + vty_out(vty, "%-10s%12s %12s%12s%8d/%-8d%8d/%-8d\n", zebra_route_string(client->proto), zserv_time_buf(&connect_time, cbuf, ZEBRA_TIME_BUF), zserv_time_buf(&last_read_time, rbuf, ZEBRA_TIME_BUF), @@ -1019,7 +1019,7 @@ DEFUN (show_zebra_client_summary, struct zserv *client; vty_out(vty, - "Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes \n"); + "Name Connect Time Last Read Last Write IPv4 Routes IPv6 Routes \n"); vty_out(vty, "--------------------------------------------------------------------------------\n"); From 0037287bee3aed680824389f57fc6fc821f1cdb6 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 22 Nov 2019 19:59:40 -0500 Subject: [PATCH 2/3] zebra: Fix `show zebra client` display to handle columns right Before: Type Add Update Del ================================================== IPv4 11539033 272 10751107 IPv6 1122106 43 1047081 After: Type Add Update Del ================================================== IPv4 10517740 64 9729917 IPv6 1016590 8 941567 Signed-off-by: Donald Sharp --- zebra/zserv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra/zserv.c b/zebra/zserv.c index d361929593..419f30e6d3 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -914,7 +914,7 @@ static void zebra_show_client_detail(struct vty *vty, struct zserv *client) zserv_command_string(last_write_cmd)); vty_out(vty, "\n"); - vty_out(vty, "Type Add Update Del \n"); + vty_out(vty, "Type Add Update Del \n"); vty_out(vty, "================================================== \n"); vty_out(vty, "IPv4 %-12d%-12d%-12d\n", client->v4_route_add_cnt, client->v4_route_upd8_cnt, client->v4_route_del_cnt); From 59f8141924d15ea3760d1cf888324eba77455fd0 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 22 Nov 2019 20:14:21 -0500 Subject: [PATCH 3/3] zebra: Fix `show ip nexthop route-map` and `show ip protocol` These commands were not properly lining up in their columns. Fix this. After: VRF: default Protocol : route-map ------------------------------------- bgp : NO_INSTALL vnc-direct : none vnc-rn : none bgp-direct : none bgp-direct-to-nve-groups : none Signed-off-by: Donald Sharp --- zebra/zebra_routemap.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 364f5755d8..091f66f9eb 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -203,22 +203,22 @@ static void show_vrf_proto_rm(struct vty *vty, struct zebra_vrf *zvrf, { int i; - vty_out(vty, "Protocol : route-map\n"); - vty_out(vty, "------------------------\n"); + vty_out(vty, "Protocol : route-map\n"); + vty_out(vty, "-------------------------------------\n"); for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { if (PROTO_RM_NAME(zvrf, af_type, i)) - vty_out(vty, "%-10s : %-10s\n", zebra_route_string(i), + vty_out(vty, "%-24s : %-10s\n", zebra_route_string(i), PROTO_RM_NAME(zvrf, af_type, i)); else - vty_out(vty, "%-10s : none\n", zebra_route_string(i)); + vty_out(vty, "%-24s : none\n", zebra_route_string(i)); } if (PROTO_RM_NAME(zvrf, af_type, i)) - vty_out(vty, "%-10s : %-10s\n", "any", + vty_out(vty, "%-24s : %-10s\n", "any", PROTO_RM_NAME(zvrf, af_type, i)); else - vty_out(vty, "%-10s : none\n", "any"); + vty_out(vty, "%-24s : none\n", "any"); } static void show_vrf_nht_rm(struct vty *vty, struct zebra_vrf *zvrf, @@ -226,22 +226,22 @@ static void show_vrf_nht_rm(struct vty *vty, struct zebra_vrf *zvrf, { int i; - vty_out(vty, "Protocol : route-map\n"); - vty_out(vty, "------------------------\n"); + vty_out(vty, "Protocol : route-map\n"); + vty_out(vty, "-------------------------------------\n"); for (i = 0; i < ZEBRA_ROUTE_MAX; i++) { if (NHT_RM_NAME(zvrf, af_type, i)) - vty_out(vty, "%-10s : %-10s\n", zebra_route_string(i), + vty_out(vty, "%-24s : %-10s\n", zebra_route_string(i), NHT_RM_NAME(zvrf, af_type, i)); else - vty_out(vty, "%-10s : none\n", zebra_route_string(i)); + vty_out(vty, "%-24s : none\n", zebra_route_string(i)); } if (NHT_RM_NAME(zvrf, af_type, i)) - vty_out(vty, "%-10s : %-10s\n", "any", + vty_out(vty, "%-24s : %-10s\n", "any", NHT_RM_NAME(zvrf, af_type, i)); else - vty_out(vty, "%-10s : none\n", "any"); + vty_out(vty, "%-24s : none\n", "any"); } static int show_proto_rm(struct vty *vty, int af_type, const char *vrf_all,