diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-05-22 22:12:41 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-24 19:51:37 +0200 |
commit | ae4a6b57ca01f791663b4c82018eff8e8ef69886 (patch) | |
tree | 0621c0c330a33327bfd2e984c29c557d51eb22f1 /pimd/pim_cmd.h | |
parent | pimd: Cleanup the rest of the global config to be vrf aware for spacing (diff) | |
download | frr-ae4a6b57ca01f791663b4c82018eff8e8ef69886.tar.xz frr-ae4a6b57ca01f791663b4c82018eff8e8ef69886.zip |
pimd: Create macro to get appropriate pim instance
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_cmd.h')
-rw-r--r-- | pimd/pim_cmd.h | 9 |
1 files changed, 9 insertions, 0 deletions
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 */ |