*: Remove redundand braces for single statement blocks

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
Donatas Abraitis 2021-11-26 00:02:37 +02:00
parent 75eeda9323
commit c48349e346
23 changed files with 135 additions and 231 deletions

View File

@ -2451,9 +2451,8 @@ void bgp_evpn_es_show(struct vty *vty, bool uj, bool detail)
}
/* print the array of json-ESs */
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
/* Display specific ES */
@ -2473,9 +2472,8 @@ void bgp_evpn_es_show_esi(struct vty *vty, esi_t *esi, bool uj)
vty_out(vty, "ESI not found\n");
}
if (uj) {
if (uj)
vty_json(vty, json);
}
}
/*****************************************************************************/
@ -3026,9 +3024,8 @@ void bgp_evpn_es_vrf_show(struct vty *vty, bool uj, struct bgp_evpn_es *es)
}
/* print the array of json-ESs */
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
/* Display specific ES VRF */
@ -3877,9 +3874,8 @@ void bgp_evpn_es_evi_show(struct vty *vty, bool uj, bool detail)
(void (*)(struct hash_bucket *,
void *))bgp_evpn_es_evi_show_one_vni_hash_cb,
&wctx);
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
/* Display specific ES EVI */
@ -3913,9 +3909,8 @@ void bgp_evpn_es_evi_show_vni(struct vty *vty, vni_t vni,
vty_out(vty, "VNI not found\n");
}
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
/*****************************************************************************
@ -4643,9 +4638,8 @@ void bgp_evpn_nh_show(struct vty *vty, bool uj)
}
/* print the array of json-ESs */
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
/*****************************************************************************/

View File

@ -4387,9 +4387,8 @@ DEFUN(show_bgp_l2vpn_evpn_vni,
evpn_show_vni(vty, bgp_evpn, vni, json);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -4667,9 +4666,8 @@ DEFUN(show_bgp_l2vpn_evpn_route,
evpn_show_all_routes(vty, bgp, type, json, detail);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -4729,9 +4727,8 @@ DEFUN(show_bgp_l2vpn_evpn_route_rd,
else
evpn_show_route_rd(vty, bgp, &prd, type, json);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -4813,9 +4810,8 @@ DEFUN(show_bgp_l2vpn_evpn_route_rd_macip,
else
evpn_show_route_rd_macip(vty, bgp, &prd, &mac, &ip, json);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -4855,9 +4851,8 @@ DEFUN(show_bgp_l2vpn_evpn_route_esi,
evpn_show_routes_esi(vty, bgp, &esi, json);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -4923,9 +4918,8 @@ DEFUN(show_bgp_l2vpn_evpn_route_vni, show_bgp_l2vpn_evpn_route_vni_cmd,
evpn_show_routes_vni(vty, bgp, vni, type, vtep_ip, json);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -4991,9 +4985,8 @@ DEFUN(show_bgp_l2vpn_evpn_route_vni_macip,
evpn_show_route_vni_macip(vty, bgp, vni, &mac, &ip, json);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -5047,9 +5040,8 @@ DEFUN(show_bgp_l2vpn_evpn_route_vni_multicast,
evpn_show_route_vni_multicast(vty, bgp, vni, orig_ip, json);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -5108,9 +5100,8 @@ DEFUN(show_bgp_l2vpn_evpn_route_vni_all,
evpn_show_routes_vni_all(vty, bgp, vtep_ip, json, da);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -5142,9 +5133,8 @@ DEFPY_HIDDEN(
if (uj)
json = json_object_new_object();
bgp_evpn_show_routes_mac_ip_evi_es(vty, esi_p, json, !!detail);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -5176,9 +5166,8 @@ DEFPY_HIDDEN(
if (uj)
json = json_object_new_object();
bgp_evpn_show_routes_mac_ip_global_es(vty, esi_p, json, !!detail);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -5210,9 +5199,8 @@ DEFUN(show_bgp_l2vpn_evpn_vrf_import_rt,
evpn_show_vrf_import_rts(vty, bgp_evpn, json);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -5244,9 +5232,8 @@ DEFUN(show_bgp_l2vpn_evpn_import_rt,
evpn_show_import_rts(vty, bgp, json);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -5828,9 +5815,8 @@ DEFUN (show_bgp_vrf_l3vni_info,
prefix_rd2str(&bgp->vrf_prd, buf1, RD_ADDRSTRLEN));
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -672,9 +672,8 @@ DEFUN (show_as_path_access_list,
if (aslist)
as_list_show(vty, aslist, json);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -704,9 +703,8 @@ DEFUN (show_as_path_access_list_all,
as_list_show_all(vty, json);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -735,9 +735,8 @@ DEFUN(show_bgp_labelpool_ledger, show_bgp_labelpool_ledger_cmd,
break;
}
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -827,9 +826,8 @@ DEFUN(show_bgp_labelpool_inuse, show_bgp_labelpool_inuse_cmd,
break;
}
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -902,9 +900,8 @@ DEFUN(show_bgp_labelpool_requests, show_bgp_labelpool_requests_cmd,
break;
}
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -950,9 +947,8 @@ DEFUN(show_bgp_labelpool_chunks, show_bgp_labelpool_chunks_cmd,
vty_out(vty, "%-10u %-10u\n", chunk->first,
chunk->last);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -14946,9 +14946,8 @@ DEFUN (show_ip_bgp_route_leak,
vrf = NULL;
}
/* ["BGP_AFI_CMD_STR" ["BGP_SAFI_CMD_STR"]] */
if (argv_find_and_parse_afi(argv, argc, &idx, &afi)) {
if (argv_find_and_parse_afi(argv, argc, &idx, &afi))
argv_find_and_parse_safi(argv, argc, &idx, &safi);
}
if (!((afi == AFI_IP || afi == AFI_IP6) && safi == SAFI_UNICAST)) {
vty_out(vty,
@ -15380,11 +15379,10 @@ static int bgp_show_peer_group_vty(struct vty *vty, const char *name,
bgp = name ? bgp_lookup_by_name(name) : bgp_get_default();
if (!bgp) {
if (uj) {
if (uj)
vty_json(vty, json);
} else {
else
vty_out(vty, "%% BGP instance not found\n");
}
return CMD_WARNING;
}
@ -15404,9 +15402,8 @@ static int bgp_show_peer_group_vty(struct vty *vty, const char *name,
if (group_name && !found && !uj)
vty_out(vty, "%% No such peer-group\n");
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -1045,9 +1045,8 @@ static int ipv6_ospf6_spf_tree_common(struct vty *vty, struct ospf6 *ospf6,
}
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -1188,9 +1188,8 @@ DEFPY(show_ipv6_ospf6_gr_helper,
show_ospf6_gr_helper_details(vty, ospf6, json, uj, detail);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -1507,9 +1507,8 @@ static int ospf6_interface_show_traffic_common(struct vty *vty, int argc,
ospf6_interface_show_traffic(vty, ifp, display_once, json, uj, vrf_id);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -1145,9 +1145,8 @@ static int ospf6_neighbor_show_common(struct vty *vty, int argc,
(*showfunc)(vty, on, json, uj);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -1610,9 +1610,8 @@ int ospf6_route_table_show(struct vty *vty, int argc_start, int argc,
/* Give summary of this route table */
if (summary) {
ospf6_route_show_table_summary(vty, table, json, use_json);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -1626,9 +1625,8 @@ int ospf6_route_table_show(struct vty *vty, int argc_start, int argc,
ospf6_route_show_table_prefix(vty, &prefix, table, json,
use_json);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -1641,9 +1639,8 @@ int ospf6_route_table_show(struct vty *vty, int argc_start, int argc,
else
ospf6_route_show_table(vty, detail, table, json, use_json);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -2096,9 +2096,8 @@ DEFPY (show_ipv6_ospf6_external_aggregator,
static void ospf6_stub_router_config_write(struct vty *vty, struct ospf6 *ospf6)
{
if (CHECK_FLAG(ospf6->flag, OSPF6_STUB_ROUTER)) {
if (CHECK_FLAG(ospf6->flag, OSPF6_STUB_ROUTER))
vty_out(vty, " stub-router administrative\n");
}
return;
}

View File

@ -383,9 +383,9 @@ static void ospf6_lsdb_type_show_wrapper(struct vty *vty,
assert(0);
break;
}
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "\n");
}

View File

@ -1031,26 +1031,25 @@ DEFPY (show_ip_ospf_mpls_ldp_interface,
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
if (!CHECK_FLAG(ospf->ldp_sync_cmd.flags, LDP_SYNC_FLAG_ENABLE)) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "LDP-sync is disabled\n");
return CMD_SUCCESS;
}
ret = show_ip_ospf_mpls_ldp_interface_common(vty, ospf, intf_name,
json, uj);
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}

View File

@ -3024,9 +3024,8 @@ DEFUN (show_ip_opsf_srdb,
if (argv_find(argv, argc, "self-originate", &idx)) {
srn = OspfSR.self;
show_sr_node(vty, json_node_array, srn);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -3040,9 +3039,8 @@ DEFUN (show_ip_opsf_srdb,
srn = (struct sr_node *)hash_lookup(OspfSR.neighbors,
(void *)&rid);
show_sr_node(vty, json_node_array, srn);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -4432,9 +4432,8 @@ DEFUN (show_ip_ospf_mpls_te_db,
ls_show_ted(OspfMplsTE.ted, vty, json, verbose);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -3386,17 +3386,17 @@ DEFUN (show_ip_ospf,
ret = show_ip_ospf_common(vty, ospf, json,
use_vrf);
}
if (uj) {
if (uj)
vty_json(vty, json);
} else if (!ospf_output)
else if (!ospf_output)
vty_out(vty, "%% OSPF instance not found\n");
return ret;
}
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if ((ospf == NULL) || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@ -3405,9 +3405,9 @@ DEFUN (show_ip_ospf,
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
/* Display default ospf (instance 0) info */
if (ospf == NULL || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@ -3457,9 +3457,8 @@ DEFUN (show_ip_ospf_instance,
ret = show_ip_ospf_common(vty, ospf, json, 0);
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -4119,18 +4118,18 @@ DEFUN (show_ip_ospf_interface,
uj);
}
if (uj) {
if (uj)
vty_json(vty, json);
} else if (!ospf)
else if (!ospf)
vty_out(vty, "%% OSPF instance not found\n");
return ret;
}
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if (ospf == NULL || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@ -4142,9 +4141,9 @@ DEFUN (show_ip_ospf_interface,
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@ -4153,9 +4152,8 @@ DEFUN (show_ip_ospf_interface,
use_vrf, json, uj);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -4196,9 +4194,8 @@ DEFUN (show_ip_ospf_instance_interface,
ret = show_ip_ospf_interface_common(vty, ospf, intf_name, 0, json, uj);
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -4249,9 +4246,8 @@ DEFUN (show_ip_ospf_interface_traffic,
display_once = 1;
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -4276,9 +4272,8 @@ DEFUN (show_ip_ospf_interface_traffic,
vty, ospf, intf_name, json, display_once, use_vrf, uj);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -4531,9 +4526,9 @@ DEFUN (show_ip_ospf_neighbor,
vty, ospf, json, uj, use_vrf);
}
if (uj) {
if (uj)
vty_json(vty, json);
} else if (!ospf)
else if (!ospf)
vty_out(vty, "OSPF instance not found\n");
return ret;
@ -4541,9 +4536,9 @@ DEFUN (show_ip_ospf_neighbor,
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if (ospf == NULL || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@ -4552,9 +4547,9 @@ DEFUN (show_ip_ospf_neighbor,
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@ -4609,9 +4604,8 @@ DEFUN (show_ip_ospf_instance_neighbor,
ret = show_ip_ospf_neighbor_common(vty, ospf, json, uj, 0);
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -4745,9 +4739,8 @@ DEFUN (show_ip_ospf_neighbor_all,
vty, ospf, json, uj, use_vrf);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -4814,9 +4807,8 @@ DEFUN (show_ip_ospf_instance_neighbor_all,
ret = show_ip_ospf_neighbor_all_common(vty, ospf, json, uj, 0);
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -4861,9 +4853,9 @@ static int show_ip_ospf_neighbor_int_common(struct vty *vty, struct ospf *ospf,
show_ip_ospf_neighbor_sub(vty, oi, json, use_json);
}
if (use_json) {
if (use_json)
vty_json(vty, json);
} else
else
vty_out(vty, "\n");
return CMD_SUCCESS;
@ -5363,9 +5355,9 @@ static int show_ip_ospf_neighbor_id_common(struct vty *vty, struct ospf *ospf,
}
}
if (use_json) {
if (use_json)
vty_json(vty, json);
} else
else
vty_out(vty, "\n");
return CMD_SUCCESS;
@ -5516,9 +5508,8 @@ DEFUN (show_ip_ospf_neighbor_detail,
ret = show_ip_ospf_neighbor_detail_common(
vty, ospf, json, uj, use_vrf);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -5585,9 +5576,8 @@ DEFUN (show_ip_ospf_instance_neighbor_detail,
ret = show_ip_ospf_neighbor_detail_common(vty, ospf, json, uj, 0);
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -5700,9 +5690,8 @@ DEFUN (show_ip_ospf_neighbor_detail_all,
vty, ospf, json, uj, use_vrf);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -5770,9 +5759,8 @@ DEFUN (show_ip_ospf_instance_neighbor_detail_all,
ret = show_ip_ospf_neighbor_detail_all_common(vty, ospf, json, uj, 0);
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -5828,9 +5816,9 @@ static int show_ip_ospf_neighbor_int_detail_common(struct vty *vty,
}
}
if (use_json) {
if (use_json)
vty_json(vty, json);
} else
else
vty_out(vty, "\n");
return CMD_SUCCESS;
@ -7139,9 +7127,8 @@ DEFUN (show_ip_ospf_instance_database_max,
show_ip_ospf_database_common(vty, ospf, 1, argc, argv, 0, json, uj);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -7353,9 +7340,8 @@ DEFUN (show_ip_ospf_instance_database_type_adv_router,
show_ip_ospf_database_type_adv_router_common(vty, ospf, 1, argc, argv,
0, json, uj);
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -10573,9 +10559,9 @@ DEFUN (show_ip_ospf_route,
}
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if (ospf == NULL || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@ -10584,9 +10570,9 @@ DEFUN (show_ip_ospf_route,
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@ -10977,9 +10963,8 @@ DEFUN (show_ip_ospf_external_aggregator,
vty, ospf, use_vrf, json, uj, detail);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return ret;
}
@ -10987,9 +10972,9 @@ DEFUN (show_ip_ospf_external_aggregator,
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if (ospf == NULL || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@ -11000,9 +10985,9 @@ DEFUN (show_ip_ospf_external_aggregator,
/* Default Vrf */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
if (uj) {
if (uj)
vty_json(vty, json);
} else
else
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
@ -11011,9 +10996,8 @@ DEFUN (show_ip_ospf_external_aggregator,
ospf_show_summary_address(vty, ospf, use_vrf, json, uj, detail);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -471,9 +471,8 @@ DEFPY (show_pahtd_ted_db,
}
/* Show the complete TED */
ls_show_ted(ted_state_g.ted, vty, json, !st_json);
if (st_json) {
if (st_json)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -1037,9 +1037,8 @@ DEFPY (show_pbr_map,
vty_show_pbr_map(vty, pbrm, detail);
}
if (j) {
if (j)
vty_json(vty, j);
}
return CMD_SUCCESS;
}
@ -1135,9 +1134,8 @@ DEFPY (show_pbr_interface,
}
}
if (j) {
if (j)
vty_json(vty, j);
}
return CMD_SUCCESS;
}

View File

@ -1065,9 +1065,8 @@ DEFUN (show_sharp_ted,
ls_show_ted(sg.ted, vty, json, verbose);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -2348,9 +2348,8 @@ DEFPY(show_interface, show_interface_cmd,
}
}
if (json) {
if (json)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -2392,9 +2391,8 @@ DEFPY (show_interface_vrf_all,
}
}
if (json) {
if (json)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -2442,9 +2440,8 @@ DEFPY (show_interface_name_vrf,
else
if_dump_vty(vty, ifp);
if (json) {
if (json)
vty_json(vty, json);
}
return CMD_SUCCESS;
}
@ -2504,9 +2501,8 @@ DEFPY (show_interface_name_vrf_all,
else
if_dump_vty(vty, ifp);
if (json) {
if (json)
vty_json(vty, json);
}
return CMD_SUCCESS;
}

View File

@ -418,9 +418,8 @@ void zebra_evpn_es_evi_show(struct vty *vty, bool uj, int detail)
hash_iterate(zvrf->evpn_table, zebra_evpn_es_evi_show_one_evpn_hash_cb,
&wctx);
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
void zebra_evpn_es_evi_show_vni(struct vty *vty, bool uj, vni_t vni, int detail)
@ -443,9 +442,8 @@ void zebra_evpn_es_evi_show_vni(struct vty *vty, bool uj, vni_t vni, int detail)
vty_out(vty, "VNI %d doesn't exist\n", vni);
}
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
/* Initialize the ES tables maintained per-L2_VNI */
@ -992,9 +990,8 @@ void zebra_evpn_acc_vl_show(struct vty *vty, bool uj)
hash_iterate(zmh_info->evpn_vlan_table, zebra_evpn_acc_vl_show_hash,
&wctx);
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
void zebra_evpn_acc_vl_show_detail(struct vty *vty, bool uj)
@ -1012,9 +1009,8 @@ void zebra_evpn_acc_vl_show_detail(struct vty *vty, bool uj)
hash_iterate(zmh_info->evpn_vlan_table, zebra_evpn_acc_vl_show_hash,
&wctx);
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
void zebra_evpn_acc_vl_show_vid(struct vty *vty, bool uj, vlanid_t vid)
@ -1033,9 +1029,8 @@ void zebra_evpn_acc_vl_show_vid(struct vty *vty, bool uj, vlanid_t vid)
vty_out(vty, "VLAN %u not present\n", vid);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
}
/* Initialize VLAN member bitmap on an interface. Although VLAN membership
@ -1348,9 +1343,8 @@ void zebra_evpn_l2_nh_show(struct vty *vty, bool uj)
hash_iterate(zmh_info->nh_ip_table, zebra_evpn_l2_nh_show_cb, &wctx);
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
static struct zebra_evpn_l2_nh *zebra_evpn_l2_nh_find(struct in_addr vtep_ip)
@ -3199,9 +3193,8 @@ void zebra_evpn_es_show(struct vty *vty, bool uj)
RB_FOREACH(es, zebra_es_rb_head, &zmh_info->es_rb_tree)
zebra_evpn_es_show_entry(vty, es, json_array);
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
void zebra_evpn_es_show_detail(struct vty *vty, bool uj)
@ -3222,9 +3215,8 @@ void zebra_evpn_es_show_detail(struct vty *vty, bool uj)
json_object_array_add(json_array, json);
}
if (uj) {
if (uj)
vty_json(vty, json_array);
}
}
void zebra_evpn_es_show_esi(struct vty *vty, bool uj, esi_t *esi)
@ -3247,9 +3239,8 @@ void zebra_evpn_es_show_esi(struct vty *vty, bool uj, esi_t *esi)
}
}
if (uj) {
if (uj)
vty_json(vty, json);
}
}
int zebra_evpn_mh_if_write(struct vty *vty, struct interface *ifp)

View File

@ -1237,9 +1237,8 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
}
}
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
static void do_show_ip_route_all(struct vty *vty, struct zebra_vrf *zvrf,

View File

@ -2315,9 +2315,8 @@ void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni,
zl3vni_print_rmac(zrmac, vty, json);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
@ -2357,9 +2356,8 @@ void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
hash_iterate(zl3vni->rmac_table, zl3vni_print_rmac_hash, &wctx);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, bool use_json)
@ -2383,9 +2381,8 @@ void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, bool use_json)
void *))zl3vni_print_rmac_hash_all_vni,
args);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
@ -2426,9 +2423,8 @@ void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
zl3vni_print_nh(n, vty, json);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
@ -2468,9 +2464,8 @@ void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
hash_iterate(zl3vni->nh_table, zl3vni_print_nh_hash, &wctx);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, bool use_json)
@ -2494,9 +2489,8 @@ void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, bool use_json)
void *))zl3vni_print_nh_hash_all_vni,
args);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/*
@ -2530,9 +2524,8 @@ void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, bool use_json)
args[1] = json;
zl3vni_print(zl3vni, (void *)args);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
void zebra_vxlan_print_vrf_vni(struct vty *vty, struct zebra_vrf *zvrf,
@ -2619,9 +2612,8 @@ void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf,
json_object_int_add(json, "numArpNd", num_neigh);
hash_iterate(zevpn->neigh_table, zebra_evpn_print_neigh_hash, &wctx);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/*
@ -2647,9 +2639,8 @@ void zebra_vxlan_print_neigh_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
(void (*)(struct hash_bucket *,
void *))zevpn_print_neigh_hash_all_evpn,
args);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/*
@ -2676,9 +2667,8 @@ void zebra_vxlan_print_neigh_all_vni_detail(struct vty *vty,
(void (*)(struct hash_bucket *,
void *))zevpn_print_neigh_hash_all_evpn_detail,
args);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/*
@ -2715,9 +2705,8 @@ void zebra_vxlan_print_specific_neigh_vni(struct vty *vty,
zebra_evpn_print_neigh(n, vty, json);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/*
@ -2761,9 +2750,8 @@ void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
&wctx);
hash_iterate(zevpn->neigh_table, zebra_evpn_print_neigh_hash, &wctx);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/*
@ -2825,9 +2813,8 @@ void zebra_vxlan_print_neigh_vni_dad(struct vty *vty,
hash_iterate(zevpn->neigh_table, zebra_evpn_print_dad_neigh_hash,
&wctx);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/*
@ -2908,9 +2895,8 @@ void zebra_vxlan_print_macs_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
wctx.print_dup = print_dup;
hash_iterate(zvrf->evpn_table, zevpn_print_mac_hash_all_evpn, &wctx);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/*
@ -2938,9 +2924,8 @@ void zebra_vxlan_print_macs_all_vni_detail(struct vty *vty,
hash_iterate(zvrf->evpn_table, zevpn_print_mac_hash_all_evpn_detail,
&wctx);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/*
@ -2966,9 +2951,8 @@ void zebra_vxlan_print_macs_all_vni_vtep(struct vty *vty,
wctx.json = json;
hash_iterate(zvrf->evpn_table, zevpn_print_mac_hash_all_evpn, &wctx);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/*
@ -3008,9 +2992,8 @@ void zebra_vxlan_print_specific_mac_vni(struct vty *vty, struct zebra_vrf *zvrf,
json = json_object_new_object();
zebra_evpn_print_mac(mac, vty, json);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
/* Print Duplicate MACs per VNI */
@ -3453,9 +3436,8 @@ void zebra_vxlan_print_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni,
*/
if (json_array)
json_object_array_add(json_array, json);
else {
else
vty_json(vty, json);
}
}
}
@ -3522,9 +3504,8 @@ void zebra_vxlan_print_evpn(struct vty *vty, bool uj)
zebra_evpn_mh_print(vty);
}
if (uj) {
if (uj)
vty_json(vty, json);
}
}
/*
@ -3560,9 +3541,8 @@ void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf,
(void (*)(struct hash_bucket *, void *))zl3vni_print_hash,
args);
if (use_json) {
if (use_json)
vty_json(vty, json);
}
}
void zebra_vxlan_dup_addr_detection(ZAPI_HANDLER_ARGS)
@ -3647,9 +3627,8 @@ void zebra_vxlan_print_vnis_detail(struct vty *vty, struct zebra_vrf *zvrf,
void *))zl3vni_print_hash_detail,
&zes);
if (use_json) {
if (use_json)
vty_json(vty, json_array);
}
}
/*