summaryrefslogtreecommitdiff
path: root/zebra/zebra_router.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-04-03 08:00:14 -0400
committerGitHub <noreply@github.com>2019-04-03 08:00:14 -0400
commit06566f41f7f2cfaf0696872744bf7b4e48967eb0 (patch)
tree4a646f22f28f91f147e1d838ca5c2ec341d74a0d /zebra/zebra_router.h
parent2b4e2584b56836816ef13d43e2188deef68ffca8 (diff)
parentd074383c621d904847d6c1cdf1e4d8825caf14ba (diff)
Merge pull request #3923 from Tuetuopay/evpn-session-vrf
Add support for EVPN session in the non-default VRF
Diffstat (limited to 'zebra/zebra_router.h')
-rw-r--r--zebra/zebra_router.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/zebra/zebra_router.h b/zebra/zebra_router.h
index 61f2902233..72b5e9b9b1 100644
--- a/zebra/zebra_router.h
+++ b/zebra/zebra_router.h
@@ -108,6 +108,11 @@ struct zebra_router {
/* Mlag information for the router */
struct zebra_mlag_info mlag_info;
+
+ /*
+ * The EVPN instance, if any
+ */
+ struct zebra_vrf *evpn_vrf;
};
extern struct zebra_router zrouter;
@@ -134,6 +139,16 @@ extern void zebra_router_show_table_summary(struct vty *vty);
extern uint32_t zebra_router_get_next_sequence(void);
+static inline vrf_id_t zebra_vrf_get_evpn_id(void)
+{
+ return zrouter.evpn_vrf ? zvrf_id(zrouter.evpn_vrf) : VRF_DEFAULT;
+}
+static inline struct zebra_vrf *zebra_vrf_get_evpn(void)
+{
+ return zrouter.evpn_vrf ? zrouter.evpn_vrf
+ : zebra_vrf_lookup_by_id(VRF_DEFAULT);
+}
+
#ifdef __cplusplus
}
#endif