summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_evpn_vty.c
diff options
context:
space:
mode:
authorTuetuopay <tuetuopay@me.com>2019-03-06 19:15:10 +0100
committerTuetuopay <tuetuopay@me.com>2019-03-19 11:56:25 +0100
commit530db8dc0398fabe8a88a2c614e14a1f3ccc1ba4 (patch)
tree08202409fabec39e2fd51c621118e1f462e51976 /bgpd/bgp_evpn_vty.c
parentzebra: Store the EVPN VRF in the default VRF (diff)
downloadfrr-530db8dc0398fabe8a88a2c614e14a1f3ccc1ba4.tar.xz
frr-530db8dc0398fabe8a88a2c614e14a1f3ccc1ba4.zip
bgpd, zebra: Scope EVPN commands to EVPN VRF
If the EVPN VRF is not the default one (i.e. with advertise-all-vni), this allows showing its information with `show bgp l2evpn evpn ...` commands. They do not require adding `vrf VRFNAME` since we only support a single EVPN VRF. The same is true for zebra-specific commands (e.g. `show evpn ...`). Configuration commands are not restricted to the default VRF but to the EVPN one, that is to the one bearing `advertise-all-vni`. Signed-off-by: Tuetuopay <tuetuopay@me.com> Sponsored-by: Scaleway
Diffstat (limited to 'bgpd/bgp_evpn_vty.c')
-rw-r--r--bgpd/bgp_evpn_vty.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index 9ac1af046..7f74ad48f 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -1006,7 +1006,7 @@ static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
json_object *json_scode = NULL;
json_object *json_ocode = NULL;
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (bgp == NULL) {
if (!use_json)
vty_out(vty, "No BGP process is configured\n");
@@ -2917,9 +2917,9 @@ DEFUN (bgp_evpn_advertise_default_gw,
if (!bgp)
return CMD_WARNING;
- if (bgp->vrf_id != VRF_DEFAULT) {
+ if (!bgp->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under the EVPN VRF\n");
return CMD_WARNING;
}
@@ -2939,9 +2939,9 @@ DEFUN (no_bgp_evpn_advertise_default_gw,
if (!bgp)
return CMD_WARNING;
- if (bgp->vrf_id != VRF_DEFAULT) {
+ if (!bgp->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under the EVPN VRF\n");
return CMD_WARNING;
}
@@ -3066,9 +3066,9 @@ DEFPY (dup_addr_detection,
if (!bgp_vrf)
return CMD_WARNING;
- if (bgp_vrf->vrf_id != VRF_DEFAULT) {
+ if (!bgp_vrf->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under the EVPN VRF\n");
return CMD_WARNING;
}
@@ -3098,9 +3098,9 @@ DEFPY (dup_addr_detection_auto_recovery,
if (!bgp_vrf)
return CMD_WARNING;
- if (bgp_vrf->vrf_id != VRF_DEFAULT) {
+ if (!bgp_vrf->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under the EVPN VRF\n");
return CMD_WARNING;
}
@@ -3133,9 +3133,9 @@ DEFPY (no_dup_addr_detection,
if (!bgp_vrf)
return CMD_WARNING;
- if (bgp_vrf->vrf_id != VRF_DEFAULT) {
+ if (!bgp_vrf->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under the EVPN VRF\n");
return CMD_WARNING;
}
@@ -3205,9 +3205,9 @@ DEFPY(bgp_evpn_advertise_svi_ip,
if (!bgp)
return CMD_WARNING;
- if (bgp->vrf_id != VRF_DEFAULT) {
+ if (!bgp->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under EVPN VRF\n");
return CMD_WARNING;
}
@@ -3464,7 +3464,7 @@ DEFUN(show_bgp_l2vpn_evpn_vni,
uj = use_json(argc, argv);
- bgp_def = bgp_get_default();
+ bgp_def = bgp_get_evpn();
if (!bgp_def)
return CMD_WARNING;
@@ -3559,7 +3559,7 @@ DEFUN(show_bgp_l2vpn_evpn_es,
memset(&esi, 0, sizeof(esi));
uj = use_json(argc, argv);
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp)
return CMD_WARNING;
@@ -3642,7 +3642,7 @@ DEFUN(show_bgp_l2vpn_evpn_route,
uj = use_json(argc, argv);
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp)
return CMD_WARNING;
@@ -3703,7 +3703,7 @@ DEFUN(show_bgp_l2vpn_evpn_route_rd,
bool uj = false;
json_object *json = NULL;
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp)
return CMD_WARNING;
@@ -3779,7 +3779,7 @@ DEFUN(show_bgp_l2vpn_evpn_route_rd_macip,
memset(&mac, 0, sizeof(struct ethaddr));
memset(&ip, 0, sizeof(struct ipaddr));
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp)
return CMD_WARNING;
@@ -3843,7 +3843,7 @@ DEFUN(show_bgp_l2vpn_evpn_route_esi,
json_object *json = NULL;
memset(&esi, 0, sizeof(esi));
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp)
return CMD_WARNING;
@@ -3896,7 +3896,7 @@ DEFUN(show_bgp_l2vpn_evpn_route_vni, show_bgp_l2vpn_evpn_route_vni_cmd,
bool uj = false;
json_object *json = NULL;
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp)
return CMD_WARNING;
@@ -3968,7 +3968,7 @@ DEFUN(show_bgp_l2vpn_evpn_route_vni_macip,
bool uj = false;
json_object *json = NULL;
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp)
return CMD_WARNING;
@@ -4036,7 +4036,7 @@ DEFUN(show_bgp_l2vpn_evpn_route_vni_multicast,
bool uj = false;
json_object *json = NULL;
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp)
return CMD_WARNING;
@@ -4092,7 +4092,7 @@ DEFUN(show_bgp_l2vpn_evpn_route_vni_all,
bool uj = false;
json_object *json = NULL;
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp)
return CMD_WARNING;
@@ -4141,7 +4141,7 @@ DEFUN(show_bgp_l2vpn_evpn_vrf_import_rt,
struct bgp *bgp_def = NULL;
json_object *json = NULL;
- bgp_def = bgp_get_default();
+ bgp_def = bgp_get_evpn();
if (!bgp_def)
return CMD_WARNING;
@@ -4177,7 +4177,7 @@ DEFUN(show_bgp_l2vpn_evpn_import_rt,
bool uj = false;
json_object *json = NULL;
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp)
return CMD_WARNING;
@@ -4208,9 +4208,9 @@ DEFUN(test_adv_evpn_type4_route,
struct bgp *bgp;
struct ipaddr vtep_ip;
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp) {
- vty_out(vty, "%%Default BGP instance not yet created\n");
+ vty_out(vty, "%%EVPN BGP instance not yet created\n");
return CMD_WARNING;
}
@@ -4242,9 +4242,9 @@ DEFUN(test_withdraw_evpn_type4_route,
struct bgp *bgp;
struct ipaddr vtep_ip;
- bgp = bgp_get_default();
+ bgp = bgp_get_evpn();
if (!bgp) {
- vty_out(vty, "%%Default BGP instance not yet created\n");
+ vty_out(vty, "%%EVPN BGP instance not yet created\n");
return CMD_WARNING;
}
@@ -4522,9 +4522,9 @@ DEFUN (bgp_evpn_vni_rd,
if (!bgp)
return CMD_WARNING;
- if (bgp->vrf_id != VRF_DEFAULT) {
+ if (!bgp->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under EVPN VRF\n");
return CMD_WARNING;
}
@@ -4558,9 +4558,9 @@ DEFUN (no_bgp_evpn_vni_rd,
if (!bgp)
return CMD_WARNING;
- if (bgp->vrf_id != VRF_DEFAULT) {
+ if (!bgp->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under EVPN VRF\n");
return CMD_WARNING;
}
@@ -4598,9 +4598,9 @@ DEFUN (no_bgp_evpn_vni_rd_without_val,
if (!bgp)
return CMD_WARNING;
- if (bgp->vrf_id != VRF_DEFAULT) {
+ if (!bgp->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under EVPN VRF\n");
return CMD_WARNING;
}
@@ -4927,9 +4927,9 @@ DEFUN (bgp_evpn_vni_rt,
if (!bgp)
return CMD_WARNING;
- if (bgp->vrf_id != VRF_DEFAULT) {
+ if (!bgp->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under EVPN VRF\n");
return CMD_WARNING;
}
@@ -4995,9 +4995,9 @@ DEFUN (no_bgp_evpn_vni_rt,
if (!bgp)
return CMD_WARNING;
- if (bgp->vrf_id != VRF_DEFAULT) {
+ if (!bgp->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under EVPN VRF\n");
return CMD_WARNING;
}
@@ -5094,9 +5094,9 @@ DEFUN (no_bgp_evpn_vni_rt_without_val,
if (!bgp)
return CMD_WARNING;
- if (bgp->vrf_id != VRF_DEFAULT) {
+ if (!bgp->advertise_all_vni) {
vty_out(vty,
- "This command is only supported under Default VRF\n");
+ "This command is only supported under EVPN VRF\n");
return CMD_WARNING;
}