diff options
| author | Abhishek N R <abnr@vmware.com> | 2022-06-09 01:33:01 -0700 |
|---|---|---|
| committer | Abhishek N R <abnr@vmware.com> | 2022-06-09 01:33:01 -0700 |
| commit | 5e52c8d5c84e35cc5bbddeb79929ba38324b0204 (patch) | |
| tree | 0e64d012cbcc79c5ab4b84966d85296f2b9a1b0f /pimd/pim_cmd_common.c | |
| parent | e21c4e907540714cba39d5421699e5726911bec4 (diff) | |
pim6d: Moving reusable code to common api for "show pim secondary" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
Diffstat (limited to 'pimd/pim_cmd_common.c')
| -rw-r--r-- | pimd/pim_cmd_common.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index 3bc7381e0d..303c9abe13 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -3865,3 +3865,25 @@ int pim_show_rp_vrf_all_helper(struct vty *vty, const char *group_str, return CMD_SUCCESS; } + +int pim_show_secondary_helper(const char *vrf, struct vty *vty) +{ + struct pim_instance *pim; + struct vrf *v; + + v = vrf_lookup_by_name(vrf ? vrf : VRF_DEFAULT_NAME); + + if (!v) + return CMD_WARNING; + + pim = pim_get_pim_instance(v->vrf_id); + + if (!pim) { + vty_out(vty, "%% Unable to find pim instance\n"); + return CMD_WARNING; + } + + pim_show_neighbors_secondary(pim, vty); + + return CMD_SUCCESS; +} |
