diff options
Diffstat (limited to 'zebra/zserv.c')
| -rw-r--r-- | zebra/zserv.c | 60 |
1 files changed, 37 insertions, 23 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c index 7f806d82c3..8a1ed115a7 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -888,7 +888,9 @@ static void zebra_show_client_detail(struct vty *vty, struct zserv *client) vty_out(vty, "Client: %s", zebra_route_string(client->proto)); if (client->instance) - vty_out(vty, " Instance: %d", client->instance); + vty_out(vty, " Instance: %u", client->instance); + if (client->session_id) + vty_out(vty, " [%u]", client->session_id); vty_out(vty, "\n"); vty_out(vty, "------------------------ \n"); @@ -936,32 +938,32 @@ static void zebra_show_client_detail(struct vty *vty, struct zserv *client) 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, + vty_out(vty, "IPv4 %-12u%-12u%-12u\n", client->v4_route_add_cnt, client->v4_route_upd8_cnt, client->v4_route_del_cnt); - vty_out(vty, "IPv6 %-12d%-12d%-12d\n", client->v6_route_add_cnt, + vty_out(vty, "IPv6 %-12u%-12u%-12u\n", client->v6_route_add_cnt, client->v6_route_upd8_cnt, client->v6_route_del_cnt); - vty_out(vty, "Redist:v4 %-12d%-12d%-12d\n", client->redist_v4_add_cnt, + vty_out(vty, "Redist:v4 %-12u%-12u%-12u\n", client->redist_v4_add_cnt, 0, client->redist_v4_del_cnt); - vty_out(vty, "Redist:v6 %-12d%-12d%-12d\n", client->redist_v6_add_cnt, + vty_out(vty, "Redist:v6 %-12u%-12u%-12u\n", client->redist_v6_add_cnt, 0, client->redist_v6_del_cnt); - vty_out(vty, "Connected %-12d%-12d%-12d\n", client->ifadd_cnt, 0, + vty_out(vty, "Connected %-12u%-12u%-12u\n", client->ifadd_cnt, 0, client->ifdel_cnt); - vty_out(vty, "BFD peer %-12d%-12d%-12d\n", client->bfd_peer_add_cnt, + vty_out(vty, "BFD peer %-12u%-12u%-12u\n", client->bfd_peer_add_cnt, client->bfd_peer_upd8_cnt, client->bfd_peer_del_cnt); - vty_out(vty, "NHT v4 %-12d%-12d%-12d\n", + vty_out(vty, "NHT v4 %-12u%-12u%-12u\n", client->v4_nh_watch_add_cnt, 0, client->v4_nh_watch_rem_cnt); - vty_out(vty, "NHT v6 %-12d%-12d%-12d\n", + vty_out(vty, "NHT v6 %-12u%-12u%-12u\n", client->v6_nh_watch_add_cnt, 0, client->v6_nh_watch_rem_cnt); - vty_out(vty, "VxLAN SG %-12d%-12d%-12d\n", client->vxlan_sg_add_cnt, + vty_out(vty, "VxLAN SG %-12u%-12u%-12u\n", client->vxlan_sg_add_cnt, 0, client->vxlan_sg_del_cnt); - vty_out(vty, "Interface Up Notifications: %d\n", client->ifup_cnt); - vty_out(vty, "Interface Down Notifications: %d\n", client->ifdown_cnt); - vty_out(vty, "VNI add notifications: %d\n", client->vniadd_cnt); - vty_out(vty, "VNI delete notifications: %d\n", client->vnidel_cnt); - vty_out(vty, "L3-VNI add notifications: %d\n", client->l3vniadd_cnt); - vty_out(vty, "L3-VNI delete notifications: %d\n", client->l3vnidel_cnt); - vty_out(vty, "MAC-IP add notifications: %d\n", client->macipadd_cnt); - vty_out(vty, "MAC-IP delete notifications: %d\n", client->macipdel_cnt); + vty_out(vty, "Interface Up Notifications: %u\n", client->ifup_cnt); + vty_out(vty, "Interface Down Notifications: %u\n", client->ifdown_cnt); + vty_out(vty, "VNI add notifications: %u\n", client->vniadd_cnt); + vty_out(vty, "VNI delete notifications: %u\n", client->vnidel_cnt); + vty_out(vty, "L3-VNI add notifications: %u\n", client->l3vniadd_cnt); + vty_out(vty, "L3-VNI delete notifications: %u\n", client->l3vnidel_cnt); + vty_out(vty, "MAC-IP add notifications: %u\n", client->macipadd_cnt); + vty_out(vty, "MAC-IP delete notifications: %u\n", client->macipdel_cnt); TAILQ_FOREACH (info, &client->gr_info_queue, gr_info) { vty_out(vty, "VRF : %s\n", vrf_id_to_name(info->vrf_id)); @@ -995,11 +997,16 @@ static void zebra_show_stale_client_detail(struct vty *vty, time_t uptime; struct client_gr_info *info = NULL; struct zserv *s = NULL; - - if (client->instance) - vty_out(vty, " Instance: %d", client->instance); + bool first_p = true; TAILQ_FOREACH (info, &client->gr_info_queue, gr_info) { + if (first_p) { + if (client->instance) + vty_out(vty, " Instance: %u", client->instance); + if (client->session_id) + vty_out(vty, " [%u]", client->session_id); + first_p = false; + } vty_out(vty, "VRF : %s\n", vrf_id_to_name(info->vrf_id)); vty_out(vty, "Capabilities : "); switch (info->capabilities) { @@ -1070,19 +1077,26 @@ static void zebra_show_client_brief(struct vty *vty, struct zserv *client) client->v6_route_del_cnt); } -struct zserv *zserv_find_client(uint8_t proto, unsigned short instance) +struct zserv *zserv_find_client_session(uint8_t proto, unsigned short instance, + uint32_t session_id) { struct listnode *node, *nnode; struct zserv *client; for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) { - if (client->proto == proto && client->instance == instance) + if (client->proto == proto && client->instance == instance && + client->session_id == session_id) return client; } return NULL; } +struct zserv *zserv_find_client(uint8_t proto, unsigned short instance) +{ + return zserv_find_client_session(proto, instance, 0); +} + /* This command is for debugging purpose. */ DEFUN (show_zebra_client, show_zebra_client_cmd, |
