summaryrefslogtreecommitdiff
path: root/pimd/pim_cmd_common.c
diff options
context:
space:
mode:
authorSai Gomathi N <nsaigomathi@vmware.com>2022-04-27 08:07:53 -0700
committerSai Gomathi N <nsaigomathi@vmware.com>2022-05-16 22:47:04 -0700
commitfe0c6838c5dc781fd3f55783f9c9061e6803a502 (patch)
tree09a9472d26d77f6add5531ab3cb14fcefbd888ee /pimd/pim_cmd_common.c
parent58d5712048f2a5518dd315648ae8b3d60abf62d6 (diff)
pim6d: Adding pim_cmd_lookup api in pim_cmd_common file
Adding pim_cmd_lookup function for clear CLIs Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
Diffstat (limited to 'pimd/pim_cmd_common.c')
-rw-r--r--pimd/pim_cmd_common.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c
index f4479abfab..6f81862db4 100644
--- a/pimd/pim_cmd_common.c
+++ b/pimd/pim_cmd_common.c
@@ -3564,6 +3564,21 @@ void show_mroute_summary(struct pim_instance *pim, struct vty *vty,
}
}
+struct vrf *pim_cmd_lookup(struct vty *vty, const char *name)
+{
+ struct vrf *vrf;
+
+ if (name)
+ vrf = vrf_lookup_by_name(name);
+ else
+ vrf = vrf_lookup_by_id(VRF_DEFAULT);
+
+ if (!vrf)
+ vty_out(vty, "Specified VRF: %s does not exist\n", name);
+
+ return vrf;
+}
+
void clear_mroute(struct pim_instance *pim)
{
struct pim_upstream *up;