summaryrefslogtreecommitdiffstats
path: root/pimd/pim_cmd.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-05-22 22:12:41 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 19:51:37 +0200
commitae4a6b57ca01f791663b4c82018eff8e8ef69886 (patch)
tree0621c0c330a33327bfd2e984c29c557d51eb22f1 /pimd/pim_cmd.h
parentpimd: Cleanup the rest of the global config to be vrf aware for spacing (diff)
downloadfrr-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.h9
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 */