diff options
Diffstat (limited to 'zebra/zebra_router.h')
| -rw-r--r-- | zebra/zebra_router.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/zebra/zebra_router.h b/zebra/zebra_router.h index e5043f38ae..72b5e9b9b1 100644 --- a/zebra/zebra_router.h +++ b/zebra/zebra_router.h @@ -26,6 +26,10 @@ #include "zebra/zebra_ns.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * This header file contains the idea of a router and as such * owns data that is associated with a router from zebra's @@ -104,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; @@ -129,4 +138,19 @@ extern void zebra_router_sweep_route(void); 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 + #endif |
