mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 03:28:31 +00:00
bgpd: Remove HAVE_CUMULUS from evpn commands
In order to make EVPN behavior work without special casing the code, bring the evpn commands under HAVE_CUMULUS into the fold. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
d6076845b3
commit
e093d9d57b
@ -52,7 +52,6 @@ struct vni_walk_ctx {
|
|||||||
json_object *json;
|
json_object *json;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(HAVE_CUMULUS)
|
|
||||||
static void display_vrf_import_rt(struct vty *vty, struct vrf_irt_node *irt,
|
static void display_vrf_import_rt(struct vty *vty, struct vrf_irt_node *irt,
|
||||||
json_object *json)
|
json_object *json)
|
||||||
{
|
{
|
||||||
@ -980,7 +979,6 @@ static void show_vni_entry(struct hash_backet *backet, void *args[])
|
|||||||
vty_out(vty, "\n");
|
vty_out(vty, "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* HAVE_CUMULUS */
|
|
||||||
|
|
||||||
static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
|
static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
|
||||||
enum bgp_show_type type, void *output_arg,
|
enum bgp_show_type type, void *output_arg,
|
||||||
@ -1636,8 +1634,6 @@ DEFUN(no_evpnrt5_network,
|
|||||||
argv[idx_gwip]->arg, argv[idx_ethtag]->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)
|
static void evpn_import_rt_delete_auto(struct bgp *bgp, struct bgpevpn *vpn)
|
||||||
{
|
{
|
||||||
evpn_rt_delete_auto(bgp, vpn->vni, vpn->import_rtl);
|
evpn_rt_delete_auto(bgp, vpn->vni, vpn->import_rtl);
|
||||||
@ -2752,7 +2748,6 @@ static void evpn_unset_advertise_autort_rfc8365(struct bgp *bgp)
|
|||||||
bgp->advertise_autort_rfc8365 = 0;
|
bgp->advertise_autort_rfc8365 = 0;
|
||||||
bgp_evpn_handle_autort_change(bgp);
|
bgp_evpn_handle_autort_change(bgp);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_CUMULUS */
|
|
||||||
|
|
||||||
static void write_vni_config(struct vty *vty, struct bgpevpn *vpn)
|
static void write_vni_config(struct vty *vty, struct bgpevpn *vpn)
|
||||||
{
|
{
|
||||||
@ -2799,7 +2794,6 @@ static void write_vni_config(struct vty *vty, struct bgpevpn *vpn)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_CUMULUS)
|
|
||||||
DEFUN (bgp_evpn_advertise_default_gw_vni,
|
DEFUN (bgp_evpn_advertise_default_gw_vni,
|
||||||
bgp_evpn_advertise_default_gw_vni_cmd,
|
bgp_evpn_advertise_default_gw_vni_cmd,
|
||||||
"advertise-default-gw",
|
"advertise-default-gw",
|
||||||
@ -3904,7 +3898,6 @@ DEFUN(show_bgp_l2vpn_evpn_import_rt,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_CUMULUS)
|
|
||||||
DEFUN(test_adv_evpn_type4_route,
|
DEFUN(test_adv_evpn_type4_route,
|
||||||
test_adv_evpn_type4_route_cmd,
|
test_adv_evpn_type4_route_cmd,
|
||||||
"advertise es ESI",
|
"advertise es ESI",
|
||||||
@ -4064,7 +4057,6 @@ ALIAS_HIDDEN(show_bgp_l2vpn_evpn_route_vni_all, show_bgp_evpn_route_vni_all_cmd,
|
|||||||
ALIAS_HIDDEN(show_bgp_l2vpn_evpn_import_rt, show_bgp_evpn_import_rt_cmd,
|
ALIAS_HIDDEN(show_bgp_l2vpn_evpn_import_rt, show_bgp_evpn_import_rt_cmd,
|
||||||
"show bgp evpn import-rt",
|
"show bgp evpn import-rt",
|
||||||
SHOW_STR BGP_STR EVPN_HELP_STR "Show import route target\n")
|
SHOW_STR BGP_STR EVPN_HELP_STR "Show import route target\n")
|
||||||
#endif
|
|
||||||
|
|
||||||
DEFUN_NOSH (bgp_evpn_vni,
|
DEFUN_NOSH (bgp_evpn_vni,
|
||||||
bgp_evpn_vni_cmd,
|
bgp_evpn_vni_cmd,
|
||||||
@ -4841,7 +4833,6 @@ DEFUN (no_bgp_evpn_vni_rt_without_val,
|
|||||||
evpn_unconfigure_export_rt(bgp, vpn, NULL);
|
evpn_unconfigure_export_rt(bgp, vpn, NULL);
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int vni_cmp(const void **a, const void **b)
|
static int vni_cmp(const void **a, const void **b)
|
||||||
{
|
{
|
||||||
@ -4961,7 +4952,6 @@ void bgp_ethernetvpn_init(void)
|
|||||||
install_element(VIEW_NODE, &show_ip_bgp_l2vpn_evpn_all_overlay_cmd);
|
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, &no_evpnrt5_network_cmd);
|
||||||
install_element(BGP_EVPN_NODE, &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, &bgp_evpn_advertise_all_vni_cmd);
|
||||||
install_element(BGP_EVPN_NODE, &no_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_NODE, &bgp_evpn_advertise_autort_rfc8365_cmd);
|
||||||
@ -5027,5 +5017,4 @@ void bgp_ethernetvpn_init(void)
|
|||||||
install_element(BGP_EVPN_VNI_NODE, &bgp_evpn_advertise_vni_subnet_cmd);
|
install_element(BGP_EVPN_VNI_NODE, &bgp_evpn_advertise_vni_subnet_cmd);
|
||||||
install_element(BGP_EVPN_VNI_NODE,
|
install_element(BGP_EVPN_VNI_NODE,
|
||||||
&no_bgp_evpn_advertise_vni_subnet_cmd);
|
&no_bgp_evpn_advertise_vni_subnet_cmd);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -6282,7 +6282,6 @@ static void route_vty_out_route(struct prefix *p, struct vty *vty,
|
|||||||
prefix2str(p, buf, PREFIX_STRLEN);
|
prefix2str(p, buf, PREFIX_STRLEN);
|
||||||
len = vty_out(vty, "%s", buf);
|
len = vty_out(vty, "%s", buf);
|
||||||
} else if (p->family == AF_EVPN) {
|
} else if (p->family == AF_EVPN) {
|
||||||
#if defined(HAVE_CUMULUS)
|
|
||||||
if (!json)
|
if (!json)
|
||||||
len = vty_out(
|
len = vty_out(
|
||||||
vty, "%s",
|
vty, "%s",
|
||||||
@ -6290,10 +6289,6 @@ static void route_vty_out_route(struct prefix *p, struct vty *vty,
|
|||||||
BUFSIZ));
|
BUFSIZ));
|
||||||
else
|
else
|
||||||
bgp_evpn_route2json((struct prefix_evpn *)p, json);
|
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) {
|
} else if (p->family == AF_FLOWSPEC) {
|
||||||
route_vty_out_flowspec(vty, p, NULL,
|
route_vty_out_flowspec(vty, p, NULL,
|
||||||
json ?
|
json ?
|
||||||
@ -7301,9 +7296,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p,
|
|||||||
{
|
{
|
||||||
char buf[INET6_ADDRSTRLEN];
|
char buf[INET6_ADDRSTRLEN];
|
||||||
char buf1[BUFSIZ];
|
char buf1[BUFSIZ];
|
||||||
#if defined(HAVE_CUMULUS)
|
|
||||||
char buf2[EVPN_ROUTE_STRLEN];
|
char buf2[EVPN_ROUTE_STRLEN];
|
||||||
#endif
|
|
||||||
struct attr *attr;
|
struct attr *attr;
|
||||||
int sockunion_vty_out(struct vty *, union sockunion *);
|
int sockunion_vty_out(struct vty *, union sockunion *);
|
||||||
time_t tbuf;
|
time_t tbuf;
|
||||||
@ -7336,7 +7329,6 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p,
|
|||||||
json_nexthop_global = json_object_new_object();
|
json_nexthop_global = json_object_new_object();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_CUMULUS)
|
|
||||||
if (!json_paths && safi == SAFI_EVPN) {
|
if (!json_paths && safi == SAFI_EVPN) {
|
||||||
char tag_buf[30];
|
char tag_buf[30];
|
||||||
|
|
||||||
@ -7366,7 +7358,6 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
attr = binfo->attr;
|
attr = binfo->attr;
|
||||||
|
|
||||||
@ -8020,12 +8011,8 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p,
|
|||||||
bgp_damp_info_vty(vty, binfo, json_path);
|
bgp_damp_info_vty(vty, binfo, json_path);
|
||||||
|
|
||||||
/* Remote Label */
|
/* Remote Label */
|
||||||
#if defined(HAVE_CUMULUS)
|
|
||||||
if (binfo->extra && bgp_is_valid_label(&binfo->extra->label[0])
|
if (binfo->extra && bgp_is_valid_label(&binfo->extra->label[0])
|
||||||
&& safi != SAFI_EVPN)
|
&& safi != SAFI_EVPN)
|
||||||
#else
|
|
||||||
if (binfo->extra && bgp_is_valid_label(&binfo->extra->label[0]))
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
mpls_label_t label =
|
mpls_label_t label =
|
||||||
label_pton(&binfo->extra->label[0]);
|
label_pton(&binfo->extra->label[0]);
|
||||||
@ -8597,9 +8584,7 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
|
|||||||
struct listnode *node, *nnode;
|
struct listnode *node, *nnode;
|
||||||
char buf1[RD_ADDRSTRLEN];
|
char buf1[RD_ADDRSTRLEN];
|
||||||
char buf2[INET6_ADDRSTRLEN];
|
char buf2[INET6_ADDRSTRLEN];
|
||||||
#if defined(HAVE_CUMULUS)
|
|
||||||
char buf3[EVPN_ROUTE_STRLEN];
|
char buf3[EVPN_ROUTE_STRLEN];
|
||||||
#endif
|
|
||||||
char prefix_str[BUFSIZ];
|
char prefix_str[BUFSIZ];
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int best = 0;
|
int best = 0;
|
||||||
@ -8626,7 +8611,6 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
|
|||||||
json, "prefix",
|
json, "prefix",
|
||||||
prefix2str(p, prefix_str, sizeof(prefix_str)));
|
prefix2str(p, prefix_str, sizeof(prefix_str)));
|
||||||
} else {
|
} else {
|
||||||
#if defined(HAVE_CUMULUS)
|
|
||||||
if (safi == SAFI_EVPN)
|
if (safi == SAFI_EVPN)
|
||||||
vty_out(vty, "BGP routing table entry for %s%s%s\n",
|
vty_out(vty, "BGP routing table entry for %s%s%s\n",
|
||||||
prd ? prefix_rd2str(prd, buf1, sizeof(buf1))
|
prd ? prefix_rd2str(prd, buf1, sizeof(buf1))
|
||||||
@ -8644,29 +8628,10 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
|
|||||||
inet_ntop(p->family, &p->u.prefix, buf2,
|
inet_ntop(p->family, &p->u.prefix, buf2,
|
||||||
INET6_ADDRSTRLEN),
|
INET6_ADDRSTRLEN),
|
||||||
p->prefixlen);
|
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)
|
if (has_valid_label)
|
||||||
vty_out(vty, "Local label: %d\n", label);
|
vty_out(vty, "Local label: %d\n", label);
|
||||||
#if defined(HAVE_CUMULUS)
|
|
||||||
if (bgp_labeled_safi(safi) && safi != SAFI_EVPN)
|
if (bgp_labeled_safi(safi) && safi != SAFI_EVPN)
|
||||||
#else
|
|
||||||
if (bgp_labeled_safi(safi))
|
|
||||||
#endif
|
|
||||||
vty_out(vty, "not allocated\n");
|
vty_out(vty, "not allocated\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user