]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Moving the common function from pim_cmd.h file
authorSai Gomathi N <nsaigomathi@vmware.com>
Wed, 2 Mar 2022 14:40:19 +0000 (06:40 -0800)
committerSai Gomathi N <nsaigomathi@vmware.com>
Tue, 5 Apr 2022 07:00:10 +0000 (00:00 -0700)
Moving the PIM_DECLVAR_CONTEXT function to the
common file pim_cmd_common.h file

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

index 1ea2ef58ed7da9ea40178f20292dc7111ed902d0..3bcd0d5d6dd38a080d0bd542150851ff902b1643 100644 (file)
@@ -111,4 +111,12 @@ int gm_process_no_last_member_query_interval_cmd(struct vty *vty);
                (vrf) ? vrf->info : pim_get_pim_instance(VRF_DEFAULT);         \
        vrf = (vrf) ? vrf : pim->vrf
 
+/*
+ * Special Macro to allow us to get the correct pim_instance;
+ */
+#define PIM_DECLVAR_CONTEXT(A, B)                                              \
+       struct vrf *A = VTY_GET_CONTEXT(vrf);                                  \
+       struct pim_instance *B =                                               \
+               (vrf) ? vrf->info : pim_get_pim_instance(VRF_DEFAULT);         \
+       vrf = (vrf) ? vrf : pim->vrf
 #endif /* PIM_CMD_COMMON_H */