diff options
author | Mitesh Kanjariya <mitesh@cumulusnetworks.com> | 2017-10-09 10:29:04 +0200 |
---|---|---|
committer | Mitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com> | 2017-12-14 19:57:05 +0100 |
commit | 6d8c58b7e16de505f05c057196dddbfab4bf20fb (patch) | |
tree | e0d4b3a62d78ffc2f68b59c521f3a215f22aeb28 /bgpd/bgp_evpn_private.h | |
parent | bgpd: link l2vnis(bgpevpn) to l3vni(vrf) (diff) | |
download | frr-6d8c58b7e16de505f05c057196dddbfab4bf20fb.tar.xz frr-6d8c58b7e16de505f05c057196dddbfab4bf20fb.zip |
bgpd: bgpevpn APIs to get l3vni/rmac and import/export RT list
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_evpn_private.h')
-rw-r--r-- | bgpd/bgp_evpn_private.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/bgpd/bgp_evpn_private.h b/bgpd/bgp_evpn_private.h index ca59c8ba4..e11f99f09 100644 --- a/bgpd/bgp_evpn_private.h +++ b/bgpd/bgp_evpn_private.h @@ -101,6 +101,50 @@ struct irt_node { #define RT_TYPE_EXPORT 2 #define RT_TYPE_BOTH 3 +static inline vni_t bgpevpn_get_l3vni(struct bgpevpn *vpn) +{ + struct bgp *bgp_vrf = NULL; + + bgp_vrf = bgp_lookup_by_vrf_id(vpn->tenant_vrf_id); + if (!bgp_vrf) + return 0; + + return bgp_vrf->l3vni; +} + +static inline void bgpevpn_get_rmac(struct bgpevpn *vpn, struct ethaddr *rmac) +{ + struct bgp *bgp_vrf = NULL; + + memset(rmac, 0, sizeof(struct ethaddr)); + bgp_vrf = bgp_lookup_by_vrf_id(vpn->tenant_vrf_id); + if (!bgp_vrf) + return; + memcpy(rmac, &bgp_vrf->rmac, sizeof(struct ethaddr)); +} + +static inline struct list *bgpevpn_get_vrf_export_rtl(struct bgpevpn *vpn) +{ + struct bgp *bgp_vrf = NULL; + + bgp_vrf = bgp_lookup_by_vrf_id(vpn->tenant_vrf_id); + if (!bgp_vrf) + return NULL; + + return bgp_vrf->vrf_export_rtl; +} + +static inline struct list *bgpevpn_get_vrf_import_rtl(struct bgpevpn *vpn) +{ + struct bgp *bgp_vrf = NULL; + + bgp_vrf = bgp_lookup_by_vrf_id(vpn->tenant_vrf_id); + if (!bgp_vrf) + return NULL; + + return bgp_vrf->vrf_import_rtl; +} + static inline void bgpevpn_unlink_from_l3vni(struct bgpevpn *vpn) { struct bgp *bgp_vrf = NULL; |