diff options
| author | Jafar Al-Gharaibeh <Jafaral@users.noreply.github.com> | 2019-02-21 10:41:53 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-21 10:41:53 -0600 |
| commit | 080c8b47a2557750f4cabf31aa76f567ca694eb6 (patch) | |
| tree | c3c1684cbbe002691985f9b6fbf7cc33409efca1 /pimd/pim_cmd.c | |
| parent | 02c2ba976775f6f51606568ee566b9b4e3f51c0e (diff) | |
| parent | 7f9adc7c67d0b7a64bdd575a7172df9692f5499b (diff) | |
Merge pull request #3841 from donaldsharp/pim_test
Add `test pim keepalive-reset A.B.C.D A.B.C.D` command to pim
Diffstat (limited to 'pimd/pim_cmd.c')
| -rw-r--r-- | pimd/pim_cmd.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index d2d2445a15..193eddf68a 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -6404,6 +6404,56 @@ static int pim_cmd_interface_add(struct interface *ifp) return 1; } +DEFPY_HIDDEN (pim_test_sg_keepalive, + pim_test_sg_keepalive_cmd, + "test pim [vrf NAME$name] keepalive-reset A.B.C.D$source A.B.C.D$group", + "Test code\n" + PIM_STR + VRF_CMD_HELP_STR + "Reset the Keepalive Timer\n" + "The Source we are resetting\n" + "The Group we are resetting\n") +{ + struct pim_upstream *up; + struct pim_instance *pim; + struct prefix_sg sg; + + sg.src = source; + sg.grp = group; + + if (!name) + pim = pim_get_pim_instance(VRF_DEFAULT); + else { + struct vrf *vrf = vrf_lookup_by_name(name); + + if (!vrf) { + vty_out(vty, "%% Vrf specified: %s does not exist\n", + name); + return CMD_WARNING; + } + + pim = pim_get_pim_instance(vrf->vrf_id); + } + + if (!pim) { + vty_out(vty, "%% Unable to find pim instance\n"); + return CMD_WARNING; + } + + up = pim_upstream_find(pim, &sg); + if (!up) { + vty_out(vty, "%% Unable to find %s specified\n", + pim_str_sg_dump(&sg)); + return CMD_WARNING; + } + + vty_out(vty, "Setting %s to current keep alive time: %d\n", + pim_str_sg_dump(&sg), pim->keep_alive_time); + pim_upstream_keep_alive_timer_start(up, pim->keep_alive_time); + + return CMD_SUCCESS; +} + DEFPY_HIDDEN (interface_ip_pim_activeactive, interface_ip_pim_activeactive_cmd, "[no$no] ip pim active-active", @@ -8667,7 +8717,6 @@ DEFUN (show_ip_msdp_sa_sg_vrf_all, return CMD_SUCCESS; } - void pim_cmd_init(void) { install_node(&interface_node, @@ -8676,6 +8725,8 @@ void pim_cmd_init(void) install_node(&debug_node, pim_debug_config_write); + install_element(ENABLE_NODE, &pim_test_sg_keepalive_cmd); + install_element(CONFIG_NODE, &ip_pim_rp_cmd); install_element(VRF_NODE, &ip_pim_rp_cmd); install_element(CONFIG_NODE, &no_ip_pim_rp_cmd); |
