]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_evpn_private.h
Merge pull request #8887 from LabNConsulting/chopps/fix-test-retries
[mirror_frr.git] / bgpd / bgp_evpn_private.h
index 77b37463447b034a15ccd54556d522dfc1509528..c46f34bf742a5674f467356bf99715abbcf0809b 100644 (file)
@@ -62,6 +62,7 @@ RB_PROTOTYPE(bgp_es_evi_rb_head, bgp_evpn_es_evi, rb_node,
 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" */
@@ -102,6 +103,15 @@ struct bgpevpn {
        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;
@@ -112,10 +122,10 @@ struct bgpevpn {
        /* 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
@@ -178,6 +188,12 @@ struct bgp_evpn_info {
        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));
@@ -612,7 +628,8 @@ extern struct bgpevpn *bgp_evpn_lookup_vni(struct bgp *bgp, vni_t vni);
 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);
@@ -631,4 +648,13 @@ bgp_global_evpn_node_lookup(struct bgp_table *table, afi_t afi, safi_t safi,
                            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 */