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>
This commit is contained in:
Sai Gomathi N 2022-04-27 08:07:53 -07:00
parent 58d5712048
commit fe0c6838c5
2 changed files with 16 additions and 0 deletions

View File

@ -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;

View File

@ -121,6 +121,7 @@ void show_mroute_count(struct pim_instance *pim, struct vty *vty,
json_object *json);
void show_mroute_summary(struct pim_instance *pim, struct vty *vty,
json_object *json);
struct vrf *pim_cmd_lookup(struct vty *vty, const char *name);
void clear_mroute(struct pim_instance *pim);
void clear_pim_statistics(struct pim_instance *pim);