json_object *json;
};
-#if defined(HAVE_CUMULUS)
static void display_vrf_import_rt(struct vty *vty, struct vrf_irt_node *irt,
json_object *json)
{
for (ALL_LIST_ELEMENTS(irt->vnis, node, nnode, tmp_vpn)) {
if (json)
json_object_array_add(
- json_vnis, json_object_new_int64(tmp_vpn->vni));
+ json_vnis, json_object_new_int(tmp_vpn->vni));
else
vty_out(vty, " %u\n", tmp_vpn->vni);
}
vty_out(vty, "\n");
}
}
-#endif /* HAVE_CUMULUS */
static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
enum bgp_show_type type, void *output_arg,
argv[idx_gwip]->arg, argv[idx_ethtag]->arg);
}
-#if defined(HAVE_CUMULUS)
-
static void evpn_import_rt_delete_auto(struct bgp *bgp, struct bgpevpn *vpn)
{
evpn_rt_delete_auto(bgp, vpn->vni, vpn->import_rtl);
list_delete_node(vpn->import_rtl, node_to_del);
}
+ assert(vpn->import_rtl);
/* Reset to auto RT - this also rebuilds the RT to VNI mapping */
if (list_isempty(vpn->import_rtl)) {
UNSET_FLAG(vpn->flags, VNI_FLAG_IMPRT_CFGD);
list_delete_node(vpn->export_rtl, node_to_del);
}
+ assert(vpn->export_rtl);
if (list_isempty(vpn->export_rtl)) {
UNSET_FLAG(vpn->flags, VNI_FLAG_EXPRT_CFGD);
bgp_evpn_derive_auto_rt_export(bgp, vpn);
bgp->advertise_autort_rfc8365 = 0;
bgp_evpn_handle_autort_change(bgp);
}
-#endif /* HAVE_CUMULUS */
static void write_vni_config(struct vty *vty, struct bgpevpn *vpn)
{
}
}
-#if defined(HAVE_CUMULUS)
DEFUN (bgp_evpn_advertise_default_gw_vni,
bgp_evpn_advertise_default_gw_vni_cmd,
"advertise-default-gw",
{
int idx = 0;
uint8_t uj = 0;
- esi_t esi = {0};
+ esi_t esi;
json_object *json = NULL;
struct bgp *bgp = NULL;
+ memset(&esi, 0, sizeof(esi));
uj = use_json(argc, argv);
bgp = bgp_get_default();
JSON_STR)
{
int uj = 0;
- esi_t esi = {0};
+ esi_t esi;
struct bgp *bgp = NULL;
json_object *json = NULL;
+ memset(&esi, 0, sizeof(esi));
bgp = bgp_get_default();
if (!bgp)
return CMD_WARNING;
return CMD_SUCCESS;
}
-#if defined(HAVE_CUMULUS)
DEFUN(test_adv_evpn_type4_route,
test_adv_evpn_type4_route_cmd,
"advertise es ESI",
ALIAS_HIDDEN(show_bgp_l2vpn_evpn_import_rt, show_bgp_evpn_import_rt_cmd,
"show bgp evpn import-rt",
SHOW_STR BGP_STR EVPN_HELP_STR "Show import route target\n")
-#endif
DEFUN_NOSH (bgp_evpn_vni,
bgp_evpn_vni_cmd,
evpn_unconfigure_export_rt(bgp, vpn, NULL);
return CMD_SUCCESS;
}
-#endif
static int vni_cmp(const void **a, const void **b)
{
install_element(VIEW_NODE, &show_ip_bgp_l2vpn_evpn_all_overlay_cmd);
install_element(BGP_EVPN_NODE, &no_evpnrt5_network_cmd);
install_element(BGP_EVPN_NODE, &evpnrt5_network_cmd);
-#if defined(HAVE_CUMULUS)
install_element(BGP_EVPN_NODE, &bgp_evpn_advertise_all_vni_cmd);
install_element(BGP_EVPN_NODE, &no_bgp_evpn_advertise_all_vni_cmd);
install_element(BGP_EVPN_NODE, &bgp_evpn_advertise_autort_rfc8365_cmd);
install_element(BGP_EVPN_VNI_NODE, &bgp_evpn_advertise_vni_subnet_cmd);
install_element(BGP_EVPN_VNI_NODE,
&no_bgp_evpn_advertise_vni_subnet_cmd);
-#endif
}
prefix2str(p, buf, PREFIX_STRLEN);
len = vty_out(vty, "%s", buf);
} else if (p->family == AF_EVPN) {
-#if defined(HAVE_CUMULUS)
if (!json)
len = vty_out(
vty, "%s",
BUFSIZ));
else
bgp_evpn_route2json((struct prefix_evpn *)p, json);
-#else
- prefix2str(p, buf, PREFIX_STRLEN);
- len = vty_out(vty, "%s", buf);
-#endif
} else if (p->family == AF_FLOWSPEC) {
route_vty_out_flowspec(vty, p, NULL,
json ?
{
char buf[INET6_ADDRSTRLEN];
char buf1[BUFSIZ];
-#if defined(HAVE_CUMULUS)
char buf2[EVPN_ROUTE_STRLEN];
-#endif
struct attr *attr;
int sockunion_vty_out(struct vty *, union sockunion *);
time_t tbuf;
json_nexthop_global = json_object_new_object();
}
-#if defined(HAVE_CUMULUS)
if (!json_paths && safi == SAFI_EVPN) {
char tag_buf[30];
}
}
}
-#endif
attr = binfo->attr;
if (binfo->extra && binfo->extra->damp_info)
bgp_damp_info_vty(vty, binfo, json_path);
-/* Remote Label */
-#if defined(HAVE_CUMULUS)
+ /* Remote Label */
if (binfo->extra && bgp_is_valid_label(&binfo->extra->label[0])
- && safi != SAFI_EVPN)
-#else
- if (binfo->extra && bgp_is_valid_label(&binfo->extra->label[0]))
-#endif
- {
+ && safi != SAFI_EVPN) {
mpls_label_t label =
label_pton(&binfo->extra->label[0]);
if (json_paths)
struct listnode *node, *nnode;
char buf1[RD_ADDRSTRLEN];
char buf2[INET6_ADDRSTRLEN];
-#if defined(HAVE_CUMULUS)
char buf3[EVPN_ROUTE_STRLEN];
-#endif
char prefix_str[BUFSIZ];
int count = 0;
int best = 0;
json, "prefix",
prefix2str(p, prefix_str, sizeof(prefix_str)));
} else {
-#if defined(HAVE_CUMULUS)
if (safi == SAFI_EVPN)
vty_out(vty, "BGP routing table entry for %s%s%s\n",
prd ? prefix_rd2str(prd, buf1, sizeof(buf1))
inet_ntop(p->family, &p->u.prefix, buf2,
INET6_ADDRSTRLEN),
p->prefixlen);
-#else
- if (p->family == AF_ETHERNET)
- prefix2str(p, buf2, INET6_ADDRSTRLEN);
- else
- inet_ntop(p->family, &p->u.prefix, buf2,
- INET6_ADDRSTRLEN);
- vty_out(vty, "BGP routing table entry for %s%s%s/%d\n",
- ((safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP
- || safi == SAFI_EVPN)
- ? prefix_rd2str(prd, buf1, sizeof(buf1))
- : ""),
- ((safi == SAFI_MPLS_VPN) || (safi == SAFI_EVPN)) ? ":"
- : "",
- buf2, p->prefixlen);
-#endif
if (has_valid_label)
vty_out(vty, "Local label: %d\n", label);
-#if defined(HAVE_CUMULUS)
if (bgp_labeled_safi(safi) && safi != SAFI_EVPN)
-#else
- if (bgp_labeled_safi(safi))
-#endif
vty_out(vty, "not allocated\n");
}