]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_router.h
Merge branch 'master' into evpn-session-vrf
[mirror_frr.git] / zebra / zebra_router.h
index 61f2902233114ca3ce8116aa253d47f3f1729227..72b5e9b9b1e0088c392268f7fe8eb301a2fed031 100644 (file)
@@ -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