From: Donald Sharp Date: Fri, 9 Dec 2016 16:05:08 +0000 (-0500) Subject: pimd: Start abstraction of zclient data structure for pim_zebra.c X-Git-Tag: frr-3.0-branchpoint~60^2~14 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8799b66b94ffcf42ad5660b8863f4341cf30c80d;p=matthieu%2Ffrr.git pimd: Start abstraction of zclient data structure for pim_zebra.c Start the abstraction of the zclient data structure out from a global variable for the entire program to a global variable to the pim_zebra.c file. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 7e60232bac..7dc1aeccb9 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -2825,15 +2825,8 @@ DEFUN (show_ip_multicast, } vty_out(vty, "%s", VTY_NEWLINE); - vty_out(vty, "Zclient update socket: "); - if (qpim_zclient_update) { - vty_out(vty, "%d failures=%d%s", qpim_zclient_update->sock, - qpim_zclient_update->fail, VTY_NEWLINE); - } - else { - vty_out(vty, "%s", VTY_NEWLINE); - } + pim_zebra_zclient_update (vty); pim_zlookup_show_ip_multicast (vty); vty_out(vty, "%s", VTY_NEWLINE); diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index b21da624d6..e1a23ab4a3 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -1232,3 +1232,17 @@ void pim_forward_stop(struct pim_ifchannel *ch) ch->interface, PIM_OIF_FLAG_PROTO_PIM); } + +void +pim_zebra_zclient_update (struct vty *vty) +{ + vty_out(vty, "Zclient update socket: "); + + if (qpim_zclient_update) { + vty_out(vty, "%d failures=%d%s", qpim_zclient_update->sock, + qpim_zclient_update->fail, VTY_NEWLINE); + } + else { + vty_out(vty, "%s", VTY_NEWLINE); + } +} diff --git a/pimd/pim_zebra.h b/pimd/pim_zebra.h index 0c302efbd5..476185def1 100644 --- a/pimd/pim_zebra.h +++ b/pimd/pim_zebra.h @@ -25,6 +25,7 @@ #include "pim_ifchannel.h" void pim_zebra_init(char *zebra_sock_path); +void pim_zebra_zclient_update (struct vty *vty); void pim_scan_individual_oil (struct channel_oil *c_oil); void pim_scan_oil(void);