struct bgpevpn {
vni_t vni;
vrf_id_t tenant_vrf_id;
+ ifindex_t svi_ifindex;
uint32_t flags;
#define VNI_FLAG_CFGD 0x1 /* VNI is user configured */
#define VNI_FLAG_LIVE 0x2 /* VNI is "live" */
struct list *import_rtl;
struct list *export_rtl;
+ /*
+ * EVPN route that uses gateway IP overlay index as its nexthop
+ * needs to do a recursive lookup.
+ * A remote MAC/IP entry should be present for the gateway IP.
+ * Maintain a hash of the addresses received via remote MAC/IP routes
+ * for efficient gateway IP recursive lookup in this EVI
+ */
+ struct hash *remote_ip_hash;
+
/* Route table for EVPN routes for
* this VNI. */
struct bgp_table *route_table;
/* List of local ESs */
struct list *local_es_evi_list;
- QOBJ_FIELDS
+ QOBJ_FIELDS;
};
-DECLARE_QOBJ_TYPE(bgpevpn)
+DECLARE_QOBJ_TYPE(bgpevpn);
/* Mapping of Import RT to VNIs.
* The Import RTs of all VNIs are maintained in a hash table with each
bool is_anycast_mac;
};
+/* This structure defines an entry in remote_ip_hash */
+struct evpn_remote_ip {
+ struct ipaddr addr;
+ struct list *macip_path_list;
+};
+
static inline int is_vrf_rd_configured(struct bgp *bgp_vrf)
{
return (CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_RD_CFGD));
extern struct bgpevpn *bgp_evpn_new(struct bgp *bgp, vni_t vni,
struct in_addr originator_ip,
vrf_id_t tenant_vrf_id,
- struct in_addr mcast_grp);
+ struct in_addr mcast_grp,
+ ifindex_t svi_ifindex);
extern void bgp_evpn_free(struct bgp *bgp, struct bgpevpn *vpn);
extern bool bgp_evpn_lookup_l3vni_l2vni_table(vni_t vni);
extern int update_routes_for_vni(struct bgp *bgp, struct bgpevpn *vpn);
const struct prefix_evpn *evp,
struct prefix_rd *prd);
extern void bgp_evpn_import_route_in_vrfs(struct bgp_path_info *pi, int import);
+extern void bgp_evpn_update_type2_route_entry(struct bgp *bgp,
+ struct bgpevpn *vpn,
+ struct bgp_node *rn,
+ struct bgp_path_info *local_pi,
+ const char *caller);
+extern int bgp_evpn_route_entry_install_if_vrf_match(struct bgp *bgp_vrf,
+ struct bgp_path_info *pi,
+ int install);
+extern void bgp_evpn_import_type2_route(struct bgp_path_info *pi, int import);
#endif /* _BGP_EVPN_PRIVATE_H */