summaryrefslogtreecommitdiff
path: root/pimd/pim_cmd_common.c
diff options
context:
space:
mode:
authorSai Gomathi N <nsaigomathi@vmware.com>2022-06-09 03:23:28 -0700
committerSai Gomathi N <nsaigomathi@vmware.com>2022-06-09 03:23:28 -0700
commitcefa37cf41709bc23a1be296b6ed63097ea47350 (patch)
tree908546d941f71f1aaeae812eef90b7cce7ef0536 /pimd/pim_cmd_common.c
parent78b0e6907301bf93500a9341035541770f90b896 (diff)
pim6d: Moving the common lines of pim_show_nexthop cli
Moving the common lines of pim_show_nexthop cli in pim_cmd.c and pim6_cmd.c to pim_cmd_common.c file Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
Diffstat (limited to 'pimd/pim_cmd_common.c')
-rw-r--r--pimd/pim_cmd_common.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c
index e7299f2214..666d7672eb 100644
--- a/pimd/pim_cmd_common.c
+++ b/pimd/pim_cmd_common.c
@@ -2597,6 +2597,20 @@ static int pim_print_pnc_cache_walkcb(struct hash_bucket *bucket, void *arg)
return CMD_SUCCESS;
}
+int pim_show_nexthop_cmd_helper(const char *vrf, struct vty *vty)
+{
+ struct vrf *v;
+
+ v = vrf_lookup_by_name(vrf ? vrf : VRF_DEFAULT_NAME);
+
+ if (!v)
+ return CMD_WARNING;
+
+ pim_show_nexthop(v->info, vty);
+
+ return CMD_SUCCESS;
+}
+
void pim_show_nexthop(struct pim_instance *pim, struct vty *vty)
{
struct pnc_cache_walk_data cwd;