From ae4a6b57ca01f791663b4c82018eff8e8ef69886 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 22 May 2017 16:12:41 -0400 Subject: pimd: Create macro to get appropriate pim instance Signed-off-by: Donald Sharp --- pimd/pim_cmd.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pimd/pim_cmd.h') diff --git a/pimd/pim_cmd.h b/pimd/pim_cmd.h index 64751d868..886751487 100644 --- a/pimd/pim_cmd.h +++ b/pimd/pim_cmd.h @@ -66,4 +66,13 @@ void pim_cmd_init(void); +/* + * 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_H */ -- cgit v1.2.3