mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 16:04:49 +00:00
zebra:return empty dict when evpn is disabled
"show evpn json" returns nothing when evpn is disabled. Code has been fixed to return {} when evpn is disabled or no entry available. Before Fix:- ``` cumulus@r2:mgmt:~$ sudo vtysh -c "show evpn json" cumulus@r2:mgmt:~$ ``` After Fix:- ``` cumulus@r1:mgmt:~$ sudo vtysh -c "show evpn json" { } cumulus@r1:mgmt:~$ ``` Ticket:#3417955 Issue:3417955 Testing: UT done Signed-off-by: Chirag Shah <chirag@nvidia.com> Signed-off-by: Sindhu Parvathi Gopinathan <sgopinathan@nvidia.com>
This commit is contained in:
parent
92c4494ce5
commit
61f3a6c353
@ -2582,19 +2582,18 @@ void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni,
|
|||||||
struct zebra_mac *zrmac = NULL;
|
struct zebra_mac *zrmac = NULL;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled()) {
|
|
||||||
if (use_json)
|
|
||||||
vty_out(vty, "{}\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zl3vni = zl3vni_lookup(l3vni);
|
zl3vni = zl3vni_lookup(l3vni);
|
||||||
if (!zl3vni) {
|
if (!zl3vni) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
vty_out(vty, "{}\n");
|
vty_json(vty, json);
|
||||||
else
|
else
|
||||||
vty_out(vty, "%% L3-VNI %u doesn't exist\n", l3vni);
|
vty_out(vty, "%% L3-VNI %u doesn't exist\n", l3vni);
|
||||||
return;
|
return;
|
||||||
@ -2603,7 +2602,7 @@ void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni,
|
|||||||
zrmac = zl3vni_rmac_lookup(zl3vni, rmac);
|
zrmac = zl3vni_rmac_lookup(zl3vni, rmac);
|
||||||
if (!zrmac) {
|
if (!zrmac) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
vty_out(vty, "{}\n");
|
vty_json(vty, json);
|
||||||
else
|
else
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
"%% Requested RMAC doesn't exist in L3-VNI %u\n",
|
"%% Requested RMAC doesn't exist in L3-VNI %u\n",
|
||||||
@ -2624,13 +2623,18 @@ void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
|
|||||||
struct rmac_walk_ctx wctx;
|
struct rmac_walk_ctx wctx;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
if (use_json)
|
||||||
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zl3vni = zl3vni_lookup(l3vni);
|
zl3vni = zl3vni_lookup(l3vni);
|
||||||
if (!zl3vni) {
|
if (!zl3vni) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
vty_out(vty, "{}\n");
|
vty_json(vty, json);
|
||||||
else
|
else
|
||||||
vty_out(vty, "%% L3-VNI %u does not exist\n", l3vni);
|
vty_out(vty, "%% L3-VNI %u does not exist\n", l3vni);
|
||||||
return;
|
return;
|
||||||
@ -2639,9 +2643,6 @@ void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
|
|||||||
if (!num_rmacs)
|
if (!num_rmacs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (use_json)
|
|
||||||
json = json_object_new_object();
|
|
||||||
|
|
||||||
memset(&wctx, 0, sizeof(wctx));
|
memset(&wctx, 0, sizeof(wctx));
|
||||||
wctx.vty = vty;
|
wctx.vty = vty;
|
||||||
wctx.json = json;
|
wctx.json = json;
|
||||||
@ -2663,15 +2664,14 @@ void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, bool use_json)
|
|||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
void *args[2];
|
void *args[2];
|
||||||
|
|
||||||
if (!is_evpn_enabled()) {
|
|
||||||
if (use_json)
|
|
||||||
vty_out(vty, "{}\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
args[0] = vty;
|
args[0] = vty;
|
||||||
args[1] = json;
|
args[1] = json;
|
||||||
hash_iterate(zrouter.l3vni_table,
|
hash_iterate(zrouter.l3vni_table,
|
||||||
@ -2690,15 +2690,14 @@ void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
|
|||||||
struct zebra_neigh *n = NULL;
|
struct zebra_neigh *n = NULL;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled()) {
|
|
||||||
if (use_json)
|
|
||||||
vty_out(vty, "{}\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* If vni=0 passed, assume svd lookup */
|
/* If vni=0 passed, assume svd lookup */
|
||||||
if (!l3vni)
|
if (!l3vni)
|
||||||
n = svd_nh_lookup(ip);
|
n = svd_nh_lookup(ip);
|
||||||
@ -2799,15 +2798,14 @@ void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, bool use_json)
|
|||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
void *args[2];
|
void *args[2];
|
||||||
|
|
||||||
if (!is_evpn_enabled()) {
|
|
||||||
if (use_json)
|
|
||||||
vty_out(vty, "{}\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
args[0] = vty;
|
args[0] = vty;
|
||||||
args[1] = json;
|
args[1] = json;
|
||||||
hash_iterate(zrouter.l3vni_table,
|
hash_iterate(zrouter.l3vni_table,
|
||||||
@ -2828,24 +2826,23 @@ void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, bool use_json)
|
|||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
struct zebra_l3vni *zl3vni = NULL;
|
struct zebra_l3vni *zl3vni = NULL;
|
||||||
|
|
||||||
|
if (use_json)
|
||||||
|
json = json_object_new_object();
|
||||||
|
|
||||||
if (!is_evpn_enabled()) {
|
if (!is_evpn_enabled()) {
|
||||||
if (use_json)
|
vty_json(vty, json);
|
||||||
vty_out(vty, "{}\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
zl3vni = zl3vni_lookup(vni);
|
zl3vni = zl3vni_lookup(vni);
|
||||||
if (!zl3vni) {
|
if (!zl3vni) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
vty_out(vty, "{}\n");
|
vty_json(vty, json);
|
||||||
else
|
else
|
||||||
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_json)
|
|
||||||
json = json_object_new_object();
|
|
||||||
|
|
||||||
args[0] = vty;
|
args[0] = vty;
|
||||||
args[1] = json;
|
args[1] = json;
|
||||||
zl3vni_print(zl3vni, (void *)args);
|
zl3vni_print(zl3vni, (void *)args);
|
||||||
@ -2900,12 +2897,18 @@ void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
struct neigh_walk_ctx wctx;
|
struct neigh_walk_ctx wctx;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
if (use_json)
|
||||||
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zevpn = zebra_evpn_lookup(vni);
|
zevpn = zebra_evpn_lookup(vni);
|
||||||
if (!zevpn) {
|
if (!zevpn) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
vty_out(vty, "{}\n");
|
vty_json(vty, json);
|
||||||
else
|
else
|
||||||
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
||||||
return;
|
return;
|
||||||
@ -2914,9 +2917,6 @@ void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
if (!num_neigh)
|
if (!num_neigh)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (use_json)
|
|
||||||
json = json_object_new_object();
|
|
||||||
|
|
||||||
/* Since we have IPv6 addresses to deal with which can vary widely in
|
/* Since we have IPv6 addresses to deal with which can vary widely in
|
||||||
* size, we try to be a bit more elegant in display by first computing
|
* size, we try to be a bit more elegant in display by first computing
|
||||||
* the maximum width.
|
* the maximum width.
|
||||||
@ -2951,12 +2951,14 @@ void zebra_vxlan_print_neigh_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
void *args[3];
|
void *args[3];
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
args[0] = vty;
|
args[0] = vty;
|
||||||
args[1] = json;
|
args[1] = json;
|
||||||
args[2] = (void *)(ptrdiff_t)print_dup;
|
args[2] = (void *)(ptrdiff_t)print_dup;
|
||||||
@ -2979,12 +2981,14 @@ void zebra_vxlan_print_neigh_all_vni_detail(struct vty *vty,
|
|||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
void *args[3];
|
void *args[3];
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
args[0] = vty;
|
args[0] = vty;
|
||||||
args[1] = json;
|
args[1] = json;
|
||||||
args[2] = (void *)(ptrdiff_t)print_dup;
|
args[2] = (void *)(ptrdiff_t)print_dup;
|
||||||
@ -3008,12 +3012,18 @@ void zebra_vxlan_print_specific_neigh_vni(struct vty *vty,
|
|||||||
struct zebra_neigh *n;
|
struct zebra_neigh *n;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
if (use_json)
|
||||||
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zevpn = zebra_evpn_lookup(vni);
|
zevpn = zebra_evpn_lookup(vni);
|
||||||
if (!zevpn) {
|
if (!zevpn) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
vty_out(vty, "{}\n");
|
vty_json(vty, json);
|
||||||
else
|
else
|
||||||
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
||||||
return;
|
return;
|
||||||
@ -3026,8 +3036,6 @@ void zebra_vxlan_print_specific_neigh_vni(struct vty *vty,
|
|||||||
vni);
|
vni);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (use_json)
|
|
||||||
json = json_object_new_object();
|
|
||||||
|
|
||||||
zebra_evpn_print_neigh(n, vty, json);
|
zebra_evpn_print_neigh(n, vty, json);
|
||||||
|
|
||||||
@ -3048,12 +3056,18 @@ void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
struct neigh_walk_ctx wctx;
|
struct neigh_walk_ctx wctx;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
if (use_json)
|
||||||
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zevpn = zebra_evpn_lookup(vni);
|
zevpn = zebra_evpn_lookup(vni);
|
||||||
if (!zevpn) {
|
if (!zevpn) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
vty_out(vty, "{}\n");
|
vty_json(vty, json);
|
||||||
else
|
else
|
||||||
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
||||||
return;
|
return;
|
||||||
@ -3062,9 +3076,6 @@ void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
if (!num_neigh)
|
if (!num_neigh)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (use_json)
|
|
||||||
json = json_object_new_object();
|
|
||||||
|
|
||||||
memset(&wctx, 0, sizeof(wctx));
|
memset(&wctx, 0, sizeof(wctx));
|
||||||
wctx.zevpn = zevpn;
|
wctx.zevpn = zevpn;
|
||||||
wctx.vty = vty;
|
wctx.vty = vty;
|
||||||
@ -3094,12 +3105,20 @@ void zebra_vxlan_print_neigh_vni_dad(struct vty *vty,
|
|||||||
struct neigh_walk_ctx wctx;
|
struct neigh_walk_ctx wctx;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
if (use_json)
|
||||||
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zevpn = zebra_evpn_lookup(vni);
|
zevpn = zebra_evpn_lookup(vni);
|
||||||
if (!zevpn) {
|
if (!zevpn) {
|
||||||
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
if (use_json)
|
||||||
|
vty_json(vty, json);
|
||||||
|
else
|
||||||
|
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3111,9 +3130,6 @@ void zebra_vxlan_print_neigh_vni_dad(struct vty *vty,
|
|||||||
if (!num_neigh)
|
if (!num_neigh)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (use_json)
|
|
||||||
json = json_object_new_object();
|
|
||||||
|
|
||||||
/* Since we have IPv6 addresses to deal with which can vary widely in
|
/* Since we have IPv6 addresses to deal with which can vary widely in
|
||||||
* size, we try to be a bit more elegant in display by first computing
|
* size, we try to be a bit more elegant in display by first computing
|
||||||
* the maximum width.
|
* the maximum width.
|
||||||
@ -3155,8 +3171,12 @@ void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
json_object *json_mac = NULL;
|
json_object *json_mac = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
if (!is_evpn_enabled()) {
|
||||||
|
if (use_json)
|
||||||
|
vty_out(vty, "{}\n");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zevpn = zebra_evpn_lookup(vni);
|
zevpn = zebra_evpn_lookup(vni);
|
||||||
if (!zevpn) {
|
if (!zevpn) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
@ -3218,14 +3238,14 @@ void zebra_vxlan_print_macs_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
struct mac_walk_ctx wctx;
|
struct mac_walk_ctx wctx;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled()) {
|
|
||||||
if (use_json)
|
|
||||||
vty_out(vty, "{}\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
memset(&wctx, 0, sizeof(wctx));
|
memset(&wctx, 0, sizeof(wctx));
|
||||||
wctx.vty = vty;
|
wctx.vty = vty;
|
||||||
wctx.json = json;
|
wctx.json = json;
|
||||||
@ -3246,14 +3266,14 @@ void zebra_vxlan_print_macs_all_vni_detail(struct vty *vty,
|
|||||||
struct mac_walk_ctx wctx;
|
struct mac_walk_ctx wctx;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled()) {
|
|
||||||
if (use_json)
|
|
||||||
vty_out(vty, "{}\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
memset(&wctx, 0, sizeof(wctx));
|
memset(&wctx, 0, sizeof(wctx));
|
||||||
wctx.vty = vty;
|
wctx.vty = vty;
|
||||||
wctx.json = json;
|
wctx.json = json;
|
||||||
@ -3275,12 +3295,14 @@ void zebra_vxlan_print_macs_all_vni_vtep(struct vty *vty,
|
|||||||
struct mac_walk_ctx wctx;
|
struct mac_walk_ctx wctx;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
memset(&wctx, 0, sizeof(wctx));
|
memset(&wctx, 0, sizeof(wctx));
|
||||||
wctx.vty = vty;
|
wctx.vty = vty;
|
||||||
wctx.flags = SHOW_REMOTE_MAC_FROM_VTEP;
|
wctx.flags = SHOW_REMOTE_MAC_FROM_VTEP;
|
||||||
@ -3303,13 +3325,18 @@ void zebra_vxlan_print_specific_mac_vni(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
struct zebra_mac *mac;
|
struct zebra_mac *mac;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
if (use_json)
|
||||||
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zevpn = zebra_evpn_lookup(vni);
|
zevpn = zebra_evpn_lookup(vni);
|
||||||
if (!zevpn) {
|
if (!zevpn) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
vty_out(vty, "{}\n");
|
vty_json(vty, json);
|
||||||
else
|
else
|
||||||
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
vty_out(vty, "%% VNI %u does not exist\n", vni);
|
||||||
return;
|
return;
|
||||||
@ -3317,7 +3344,7 @@ void zebra_vxlan_print_specific_mac_vni(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
mac = zebra_evpn_mac_lookup(zevpn, macaddr);
|
mac = zebra_evpn_mac_lookup(zevpn, macaddr);
|
||||||
if (!mac) {
|
if (!mac) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
vty_out(vty, "{}\n");
|
vty_json(vty, json);
|
||||||
else
|
else
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
"%% Requested MAC does not exist in VNI %u\n",
|
"%% Requested MAC does not exist in VNI %u\n",
|
||||||
@ -3325,10 +3352,8 @@ void zebra_vxlan_print_specific_mac_vni(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_json)
|
|
||||||
json = json_object_new_object();
|
|
||||||
|
|
||||||
zebra_evpn_print_mac(mac, vty, json);
|
zebra_evpn_print_mac(mac, vty, json);
|
||||||
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
vty_json(vty, json);
|
vty_json(vty, json);
|
||||||
}
|
}
|
||||||
@ -3693,8 +3718,11 @@ void zebra_vxlan_print_macs_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
json_object *json_mac = NULL;
|
json_object *json_mac = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zevpn = zebra_evpn_lookup(vni);
|
zevpn = zebra_evpn_lookup(vni);
|
||||||
if (!zevpn) {
|
if (!zevpn) {
|
||||||
if (use_json)
|
if (use_json)
|
||||||
@ -3745,12 +3773,14 @@ void zebra_vxlan_print_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni,
|
|||||||
struct zebra_l3vni *zl3vni = NULL;
|
struct zebra_l3vni *zl3vni = NULL;
|
||||||
struct zebra_evpn *zevpn = NULL;
|
struct zebra_evpn *zevpn = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
args[0] = vty;
|
args[0] = vty;
|
||||||
args[1] = json;
|
args[1] = json;
|
||||||
|
|
||||||
@ -3787,8 +3817,13 @@ void zebra_vxlan_print_evpn(struct vty *vty, bool uj)
|
|||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
struct zebra_vrf *zvrf = NULL;
|
struct zebra_vrf *zvrf = NULL;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
if (uj)
|
||||||
|
json = json_object_new_object();
|
||||||
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zvrf = zebra_vrf_get_evpn();
|
zvrf = zebra_vrf_get_evpn();
|
||||||
|
|
||||||
@ -3797,7 +3832,6 @@ void zebra_vxlan_print_evpn(struct vty *vty, bool uj)
|
|||||||
num_vnis = num_l2vnis + num_l3vnis;
|
num_vnis = num_l2vnis + num_l3vnis;
|
||||||
|
|
||||||
if (uj) {
|
if (uj) {
|
||||||
json = json_object_new_object();
|
|
||||||
json_object_string_add(json, "advertiseGatewayMacip",
|
json_object_string_add(json, "advertiseGatewayMacip",
|
||||||
zvrf->advertise_gw_macip ? "Yes" : "No");
|
zvrf->advertise_gw_macip ? "Yes" : "No");
|
||||||
json_object_string_add(json, "advertiseSviMacip",
|
json_object_string_add(json, "advertiseSviMacip",
|
||||||
@ -3860,12 +3894,15 @@ void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
void *args[2];
|
void *args[2];
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (use_json)
|
if (use_json)
|
||||||
json = json_object_new_object();
|
json = json_object_new_object();
|
||||||
else
|
|
||||||
|
if (!is_evpn_enabled()) {
|
||||||
|
vty_json(vty, json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!use_json)
|
||||||
vty_out(vty, "%-10s %-4s %-21s %-8s %-8s %-15s %-37s\n", "VNI",
|
vty_out(vty, "%-10s %-4s %-21s %-8s %-8s %-15s %-37s\n", "VNI",
|
||||||
"Type", "VxLAN IF", "# MACs", "# ARPs",
|
"Type", "VxLAN IF", "# MACs", "# ARPs",
|
||||||
"# Remote VTEPs", "Tenant VRF");
|
"# Remote VTEPs", "Tenant VRF");
|
||||||
@ -3943,8 +3980,11 @@ void zebra_vxlan_print_vnis_detail(struct vty *vty, struct zebra_vrf *zvrf,
|
|||||||
struct zebra_ns *zns = NULL;
|
struct zebra_ns *zns = NULL;
|
||||||
struct zebra_evpn_show zes;
|
struct zebra_evpn_show zes;
|
||||||
|
|
||||||
if (!is_evpn_enabled())
|
if (!is_evpn_enabled()) {
|
||||||
|
if (use_json)
|
||||||
|
vty_out(vty, "{}\n");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zns = zebra_ns_lookup(NS_DEFAULT);
|
zns = zebra_ns_lookup(NS_DEFAULT);
|
||||||
if (!zns)
|
if (!zns)
|
||||||
|
Loading…
Reference in New Issue
Block a user