diff options
| author | Abhishek N R <abnr@vmware.com> | 2022-06-09 03:51:41 -0700 |
|---|---|---|
| committer | Abhishek N R <abnr@vmware.com> | 2022-06-09 03:51:41 -0700 |
| commit | 8e15c9aa064d92f290ace12d578274a3c575a98e (patch) | |
| tree | 3ea143bad2300225ef80bc0913c1fe10d0d83bfe /pimd/pim_cmd_common.c | |
| parent | e7c01c676950b0fe48ab44310a65e22cbcc5d0ee (diff) | |
pim6d: Moving reusable code to common api for "show ip/ipv6 multicast" 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 | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index a2a0891779..7a05118677 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -4081,3 +4081,37 @@ int pim_show_state_vrf_all_helper(struct vty *vty, const char *s_or_g_str, return CMD_SUCCESS; } + +int pim_show_multicast_helper(const char *vrf, struct vty *vty) +{ + struct vrf *v; + struct pim_instance *pim; + + 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_cmd_show_ip_multicast_helper(pim, vty); + + return CMD_SUCCESS; +} + +int pim_show_multicast_vrf_all_helper(struct vty *vty) +{ + struct vrf *vrf; + + RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) { + vty_out(vty, "VRF: %s\n", vrf->name); + pim_cmd_show_ip_multicast_helper(vrf->info, vty); + } + + return CMD_SUCCESS; +} |
