#define EVPN_ROUTE_STRLEN 200 /* Must be >> MAC + IPv6 strings. */
#define EVPN_AUTORT_VXLAN 0x10000000
+#define EVPN_ENABLED(bgp) (bgp)->advertise_all_vni
static inline int is_evpn_enabled(void)
{
struct bgp *bgp = NULL;
bgp = bgp_get_evpn();
- return bgp ? bgp->advertise_all_vni : 0;
+ return bgp ? EVPN_ENABLED(bgp) : 0;
}
static inline void vni2label(vni_t vni, mpls_label_t *label)
if (!bgp)
return CMD_WARNING;
- if (!bgp->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp)) {
vty_out(vty,
"This command is only supported under the EVPN VRF\n");
return CMD_WARNING;
if (!bgp)
return CMD_WARNING;
- if (!bgp->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp)) {
vty_out(vty,
"This command is only supported under the EVPN VRF\n");
return CMD_WARNING;
if (!bgp_vrf)
return CMD_WARNING;
- if (!bgp_vrf->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp_vrf)) {
vty_out(vty,
"This command is only supported under the EVPN VRF\n");
return CMD_WARNING;
if (!bgp_vrf)
return CMD_WARNING;
- if (!bgp_vrf->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp_vrf)) {
vty_out(vty,
"This command is only supported under the EVPN VRF\n");
return CMD_WARNING;
if (!bgp_vrf)
return CMD_WARNING;
- if (!bgp_vrf->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp_vrf)) {
vty_out(vty,
"This command is only supported under the EVPN VRF\n");
return CMD_WARNING;
if (!bgp)
return CMD_WARNING;
- if (!bgp->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp)) {
vty_out(vty,
"This command is only supported under EVPN VRF\n");
return CMD_WARNING;
if (!bgp)
return CMD_WARNING;
- if (!bgp->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp)) {
vty_out(vty,
"This command is only supported under EVPN VRF\n");
return CMD_WARNING;
if (!bgp)
return CMD_WARNING;
- if (!bgp->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp)) {
vty_out(vty,
"This command is only supported under EVPN VRF\n");
return CMD_WARNING;
if (!bgp)
return CMD_WARNING;
- if (!bgp->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp)) {
vty_out(vty,
"This command is only supported under EVPN VRF\n");
return CMD_WARNING;
if (!bgp)
return CMD_WARNING;
- if (!bgp->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp)) {
vty_out(vty,
"This command is only supported under EVPN VRF\n");
return CMD_WARNING;
if (!bgp)
return CMD_WARNING;
- if (!bgp->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp)) {
vty_out(vty,
"This command is only supported under EVPN VRF\n");
return CMD_WARNING;
if (!bgp)
return CMD_WARNING;
- if (!bgp->advertise_all_vni) {
+ if (!EVPN_ENABLED(bgp)) {
vty_out(vty,
"This command is only supported under EVPN VRF\n");
return CMD_WARNING;
return CMD_WARNING;
#if ENABLE_BGP_VNC
- if (bgp->advertise_all_vni
- && type == ZEBRA_ROUTE_VNC_DIRECT) {
+ if (EVPN_ENABLED(bgp) && type == ZEBRA_ROUTE_VNC_DIRECT) {
vnc_export_bgp_enable(
bgp, afi); /* only enables if mode bits cfg'd */
}
* status. red lookup fails if there is no zebra connection.
*/
#if ENABLE_BGP_VNC
- if (bgp->advertise_all_vni && type == ZEBRA_ROUTE_VNC_DIRECT) {
+ if (EVPN_ENABLED(bgp) && type == ZEBRA_ROUTE_VNC_DIRECT) {
vnc_export_bgp_disable(bgp, afi);
}
#endif
/* Mismatch between EVPN VRF and current VRF (should be prevented by
* bgpd's cli) */
- if (is_evpn_enabled() && !zvrf->advertise_all_vni)
+ if (is_evpn_enabled() && !EVPN_ENABLED(zvrf))
return;
s = msg;
return;
zvrf->advertise_all_vni = advertise;
- if (zvrf->advertise_all_vni) {
+ if (EVPN_ENABLED(zvrf)) {
zvrf_default->evpn_vrf_id = zvrf_id(zvrf);
/* Note BUM handling */