]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_evpn_private.h
bgpd: Replace bgp_flag_* to [UN]SET/CHECK_FLAG macros
[mirror_frr.git] / bgpd / bgp_evpn_private.h
index 88b57ff9eacd634634da2b3c8d503034bb485248..76cf8b2cd618e6990dd8fac3d1bbd0a7d7fa3a98 100644 (file)
@@ -188,6 +188,16 @@ struct bgp_evpn_info {
        /* EVPN enable - advertise svi macip routes */
        int advertise_svi_macip;
 
+       /* PIP feature knob */
+       bool advertise_pip;
+       /* PIP IP (sys ip) */
+       struct in_addr pip_ip;
+       struct in_addr pip_ip_static;
+       /* PIP MAC (sys MAC) */
+       struct ethaddr pip_rmac;
+       struct ethaddr pip_rmac_static;
+       struct ethaddr pip_rmac_zebra;
+       bool is_anycast_mac;
 };
 
 static inline int is_vrf_rd_configured(struct bgp *bgp_vrf)
@@ -240,6 +250,7 @@ static inline void bgpevpn_unlink_from_l3vni(struct bgpevpn *vpn)
        listnode_delete(vpn->bgp_vrf->l2vnis, vpn);
 
        /* remove the backpointer to the vrf instance */
+       bgp_unlock(vpn->bgp_vrf);
        vpn->bgp_vrf = NULL;
 }
 
@@ -256,7 +267,7 @@ static inline void bgpevpn_link_to_l3vni(struct bgpevpn *vpn)
                return;
 
        /* associate the vpn to the bgp_vrf instance */
-       vpn->bgp_vrf = bgp_vrf;
+       vpn->bgp_vrf = bgp_lock(bgp_vrf);
        listnode_add_sort(bgp_vrf->l2vnis, vpn);
 
        /* check if we are advertising two labels for this vpn */
@@ -274,6 +285,11 @@ static inline int is_vni_live(struct bgpevpn *vpn)
        return (CHECK_FLAG(vpn->flags, VNI_FLAG_LIVE));
 }
 
+static inline int is_l3vni_live(struct bgp *bgp_vrf)
+{
+       return (bgp_vrf->l3vni && bgp_vrf->l3vni_svi_ifindex);
+}
+
 static inline int is_rd_configured(struct bgpevpn *vpn)
 {
        return (CHECK_FLAG(vpn->flags, VNI_FLAG_RD_CFGD));
@@ -495,6 +511,16 @@ static inline int is_es_local(struct evpnes *es)
        return CHECK_FLAG(es->flags, EVPNES_LOCAL) ? 1 : 0;
 }
 
+static inline bool bgp_evpn_is_svi_macip_enabled(struct bgpevpn *vpn)
+{
+       struct bgp *bgp_evpn = NULL;
+
+       bgp_evpn = bgp_get_evpn();
+
+       return (bgp_evpn->evpn_info->advertise_svi_macip ||
+               vpn->advertise_svi_macip);
+}
+
 extern void bgp_evpn_install_uninstall_default_route(struct bgp *bgp_vrf,
                                                     afi_t afi, safi_t safi,
                                                     bool add);
@@ -537,4 +563,5 @@ extern struct evpnes *bgp_evpn_es_new(struct bgp *bgp, esi_t *esi,
                                      struct ipaddr *originator_ip);
 extern void bgp_evpn_es_free(struct bgp *bgp, struct evpnes *es);
 extern bool bgp_evpn_lookup_l3vni_l2vni_table(vni_t vni);
+extern int update_routes_for_vni(struct bgp *bgp, struct bgpevpn *vpn);
 #endif /* _BGP_EVPN_PRIVATE_H */