/* if we are already advertising ipv4 prefix as type-5
* nothing to do
*/
- if (!rmap_changed && CHECK_FLAG(bgp_vrf->vrf_flags,
- BGP_VRF_ADVERTISE_IPV4_IN_EVPN))
+ if (!rmap_changed &&
+ CHECK_FLAG(bgp_vrf->af_flags[AFI_L2VPN][SAFI_EVPN],
+ BGP_L2VPN_EVPN_ADVERTISE_IPV4_UNICAST))
return CMD_WARNING;
- SET_FLAG(bgp_vrf->vrf_flags,
- BGP_VRF_ADVERTISE_IPV4_IN_EVPN);
+ SET_FLAG(bgp_vrf->af_flags[AFI_L2VPN][SAFI_EVPN],
+ BGP_L2VPN_EVPN_ADVERTISE_IPV4_UNICAST);
} else {
/* if we are already advertising ipv6 prefix as type-5
* nothing to do
*/
- if (!rmap_changed && CHECK_FLAG(bgp_vrf->vrf_flags,
- BGP_VRF_ADVERTISE_IPV6_IN_EVPN))
+ if (!rmap_changed &&
+ CHECK_FLAG(bgp_vrf->af_flags[AFI_L2VPN][SAFI_EVPN],
+ BGP_L2VPN_EVPN_ADVERTISE_IPV6_UNICAST))
return CMD_WARNING;
- SET_FLAG(bgp_vrf->vrf_flags,
- BGP_VRF_ADVERTISE_IPV6_IN_EVPN);
+ SET_FLAG(bgp_vrf->af_flags[AFI_L2VPN][SAFI_EVPN],
+ BGP_L2VPN_EVPN_ADVERTISE_IPV6_UNICAST);
}
if (rmap_changed) {
/* if we are not advertising ipv4 prefix as type-5
* nothing to do
*/
- if (CHECK_FLAG(bgp_vrf->vrf_flags,
- BGP_VRF_ADVERTISE_IPV4_IN_EVPN)) {
+ if (CHECK_FLAG(bgp_vrf->af_flags[AFI_L2VPN][SAFI_EVPN],
+ BGP_L2VPN_EVPN_ADVERTISE_IPV4_UNICAST)) {
bgp_evpn_withdraw_type5_routes(bgp_vrf, afi, safi);
- UNSET_FLAG(bgp_vrf->vrf_flags,
- BGP_VRF_ADVERTISE_IPV4_IN_EVPN);
+ UNSET_FLAG(bgp_vrf->af_flags[AFI_L2VPN][SAFI_EVPN],
+ BGP_L2VPN_EVPN_ADVERTISE_IPV4_UNICAST);
}
} else {
/* if we are not advertising ipv6 prefix as type-5
* nothing to do
*/
- if (CHECK_FLAG(bgp_vrf->vrf_flags,
- BGP_VRF_ADVERTISE_IPV6_IN_EVPN)) {
+ if (CHECK_FLAG(bgp_vrf->af_flags[AFI_L2VPN][SAFI_EVPN],
+ BGP_L2VPN_EVPN_ADVERTISE_IPV6_UNICAST)) {
bgp_evpn_withdraw_type5_routes(bgp_vrf, afi, safi);
UNSET_FLAG(bgp_vrf->vrf_flags,
- BGP_VRF_ADVERTISE_IPV6_IN_EVPN);
+ BGP_L2VPN_EVPN_ADVERTISE_IPV6_UNICAST);
}
}
if (bgp->advertise_gw_macip)
vty_out(vty, " advertise-default-gw\n");
- if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_ADVERTISE_IPV4_IN_EVPN))
+ if (CHECK_FLAG(bgp->af_flags[AFI_L2VPN][SAFI_EVPN],
+ BGP_L2VPN_EVPN_ADVERTISE_IPV4_UNICAST))
vty_out(vty, " advertise ipv4 unicast\n");
- if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_ADVERTISE_IPV6_IN_EVPN))
+ if (CHECK_FLAG(bgp->af_flags[AFI_L2VPN][SAFI_EVPN],
+ BGP_L2VPN_EVPN_ADVERTISE_IPV6_UNICAST))
vty_out(vty, " advertise ipv6 unicast\n");
}
u_int16_t af_flags[AFI_MAX][SAFI_MAX];
#define BGP_CONFIG_DAMPENING (1 << 0)
+/* l2vpn evpn flags */
+#define BGP_L2VPN_EVPN_ADVERTISE_IPV4_UNICAST (1 << 0)
+#define BGP_L2VPN_EVPN_ADVERTISE_IPV6_UNICAST (1 << 1)
+
+
/* Route table for next-hop lookup cache. */
struct bgp_table *nexthop_cache_table[AFI_MAX];
/* vrf flags */
uint32_t vrf_flags;
#define BGP_VRF_AUTO (1 << 0)
-#define BGP_VRF_ADVERTISE_IPV4_IN_EVPN (1 << 1)
-#define BGP_VRF_ADVERTISE_IPV6_IN_EVPN (1 << 2)
-#define BGP_VRF_IMPORT_RT_CFGD (1 << 3)
-#define BGP_VRF_EXPORT_RT_CFGD (1 << 4)
-#define BGP_VRF_RD_CFGD (1 << 5)
+#define BGP_VRF_IMPORT_RT_CFGD (1 << 1)
+#define BGP_VRF_EXPORT_RT_CFGD (1 << 2)
+#define BGP_VRF_RD_CFGD (1 << 3)
/* unique ID for auto derivation of RD for this vrf */
uint16_t vrf_rd_id;