]> git.puffer.fish Git - mirror/frr.git/commitdiff
pim6d: Adding pim_cmd_lookup api in pim_cmd_common file
authorSai Gomathi N <nsaigomathi@vmware.com>
Wed, 27 Apr 2022 15:07:53 +0000 (08:07 -0700)
committerSai Gomathi N <nsaigomathi@vmware.com>
Tue, 17 May 2022 05:47:04 +0000 (22:47 -0700)
Adding pim_cmd_lookup function for clear CLIs

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
pimd/pim_cmd_common.c
pimd/pim_cmd_common.h

index f4479abfab6bf08cdc5421cd07a789b2e853f53c..6f81862db4502e3131f277028fce11eafc9626ca 100644 (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;
index 1431ce32e12eb8ef2fe3135466ded20bc36453fe..b8264e24c464d318ea69c3a43b4065fd64c5a6b3 100644 (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);