zevpn = (struct zebra_evpn *)bucket->data;
if (!zevpn) {
if (json)
- vty_out(vty, "{}\n");
+ vty_json_empty(vty, json);
return;
}
num_neigh = hashcount(zevpn->neigh_table);
zevpn = (struct zebra_evpn *)bucket->data;
if (!zevpn) {
if (json)
- vty_out(vty, "{}\n");
+ vty_json_empty(vty, json);
return;
}
wctx->zevpn = zevpn;
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
zl3vni = zl3vni_lookup(l3vni);
if (!zl3vni) {
if (use_json)
- vty_json(vty, json);
+ vty_json_empty(vty, json);
else
vty_out(vty, "%% L3-VNI %u doesn't exist\n", l3vni);
return;
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
zl3vni = zl3vni_lookup(l3vni);
if (!zl3vni) {
if (use_json)
- vty_json(vty, json);
+ vty_json_empty(vty, json);
else
vty_out(vty, "%% L3-VNI %u does not exist\n", l3vni);
return;
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
zl3vni = zl3vni_lookup(l3vni);
if (!zl3vni) {
if (use_json)
- vty_out(vty, "{}\n");
+ vty_json(vty, json);
else
vty_out(vty, "%% L3-VNI %u does not exist\n",
l3vni);
if (!n) {
if (use_json)
- vty_out(vty, "{}\n");
+ vty_json_empty(vty, json);
else
vty_out(vty,
"%% Requested next-hop not present for L3-VNI %u\n",
struct nh_walk_ctx wctx;
json_object *json = NULL;
- num_nh = hashcount(nh_table);
- if (!num_nh)
- return;
-
if (use_json)
json = json_object_new_object();
+ num_nh = hashcount(nh_table);
+ if (!num_nh) {
+ if (use_json)
+ vty_json_empty(vty, json);
+ return;
+ }
+
wctx.vty = vty;
wctx.json = json;
if (!use_json) {
if (!is_evpn_enabled()) {
if (use_json)
- vty_out(vty, "{}\n");
+ vty_json_empty(vty, NULL);
return;
}
zl3vni = zl3vni_lookup(l3vni);
if (!zl3vni) {
if (use_json)
- vty_out(vty, "{}\n");
+ vty_json_empty(vty, NULL);
else
vty_out(vty, "%% L3-VNI %u does not exist\n", l3vni);
return;
{
if (!is_evpn_enabled()) {
if (use_json)
- vty_out(vty, "{}\n");
+ vty_json_empty(vty, NULL);
return;
}
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
zl3vni = zl3vni_lookup(vni);
if (!zl3vni) {
if (use_json)
- vty_json(vty, json);
+ vty_json_empty(vty, json);
else
vty_out(vty, "%% VNI %u does not exist\n", vni);
return;
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
zevpn = zebra_evpn_lookup(vni);
if (!zevpn) {
if (use_json)
- vty_json(vty, json);
+ vty_json_empty(vty, json);
else
vty_out(vty, "%% VNI %u does not exist\n", vni);
return;
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
zevpn = zebra_evpn_lookup(vni);
if (!zevpn) {
if (use_json)
- vty_json(vty, json);
+ vty_json_empty(vty, json);
else
vty_out(vty, "%% VNI %u does not exist\n", vni);
return;
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
zevpn = zebra_evpn_lookup(vni);
if (!zevpn) {
if (use_json)
- vty_json(vty, json);
+ vty_json_empty(vty, json);
else
vty_out(vty, "%% VNI %u does not exist\n", vni);
return;
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
zevpn = zebra_evpn_lookup(vni);
if (!zevpn) {
if (use_json)
- vty_json(vty, json);
+ vty_json_empty(vty, json);
else
vty_out(vty, "%% VNI %u does not exist\n", vni);
return;
if (!is_evpn_enabled()) {
if (use_json)
- vty_out(vty, "{}\n");
+ vty_json_empty(vty, NULL);
return;
}
zevpn = zebra_evpn_lookup(vni);
if (!zevpn) {
if (use_json)
- vty_out(vty, "{}\n");
+ vty_json_empty(vty, NULL);
else
vty_out(vty, "%% VNI %u does not exist\n", vni);
return;
}
num_macs = num_valid_macs(zevpn);
- if (!num_macs)
+ if (!num_macs) {
+ if (use_json)
+ vty_json_empty(vty, NULL);
return;
+ }
if (use_json) {
json = json_object_new_object();
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
json_object *json = NULL;
json_object *json_mac = NULL;
- if (!is_evpn_enabled())
+ if (!is_evpn_enabled()) {
+ if (use_json)
+ vty_json_empty(vty, NULL);
return;
+ }
zevpn = zebra_evpn_lookup(vni);
if (!zevpn) {
- vty_out(vty, "%% VNI %u does not exist\n", vni);
+ if (use_json)
+ vty_json_empty(vty, NULL);
+ else
+ vty_out(vty, "%% VNI %u does not exist\n", vni);
return;
}
num_macs = num_valid_macs(zevpn);
- if (!num_macs)
+ if (!num_macs) {
+ if (use_json)
+ vty_json_empty(vty, NULL);
return;
+ }
num_macs = num_dup_detected_macs(zevpn);
- if (!num_macs)
+ if (!num_macs) {
+ if (use_json)
+ vty_json_empty(vty, NULL);
return;
+ }
if (use_json) {
json = json_object_new_object();
json_object *json_mac = NULL;
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, NULL);
return;
}
zevpn = zebra_evpn_lookup(vni);
if (!zevpn) {
if (use_json)
- vty_out(vty, "{}\n");
+ vty_json_empty(vty, NULL);
else
vty_out(vty, "%% VNI %u does not exist\n", vni);
return;
}
num_macs = num_valid_macs(zevpn);
- if (!num_macs)
+ if (!num_macs) {
+ if (use_json)
+ vty_json_empty(vty, NULL);
return;
+ }
if (use_json) {
json = json_object_new_object();
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (uj)
+ vty_json(vty, json);
return;
}
json = json_object_new_object();
if (!is_evpn_enabled()) {
- vty_json(vty, json);
+ if (use_json)
+ vty_json_empty(vty, json);
return;
}
if (!is_evpn_enabled()) {
if (use_json)
- vty_out(vty, "{}\n");
+ vty_json_empty(vty, NULL);
return;
}