mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 16:57:43 +00:00
Use camelCase notation for all json keywords
This commit is contained in:
parent
6cbc1cafd9
commit
62d6dca0c2
@ -289,19 +289,19 @@ set_community_string (struct community *com)
|
||||
case COMMUNITY_NO_EXPORT:
|
||||
strcpy (pnt, "no-export");
|
||||
pnt += strlen ("no-export");
|
||||
json_string = json_object_new_string("no-export");
|
||||
json_string = json_object_new_string("noExport");
|
||||
json_object_array_add(json_community_list, json_string);
|
||||
break;
|
||||
case COMMUNITY_NO_ADVERTISE:
|
||||
strcpy (pnt, "no-advertise");
|
||||
pnt += strlen ("no-advertise");
|
||||
json_string = json_object_new_string("no-advertise");
|
||||
json_string = json_object_new_string("noAdvertise");
|
||||
json_object_array_add(json_community_list, json_string);
|
||||
break;
|
||||
case COMMUNITY_LOCAL_AS:
|
||||
strcpy (pnt, "local-AS");
|
||||
pnt += strlen ("local-AS");
|
||||
json_string = json_object_new_string("local-AS");
|
||||
json_string = json_object_new_string("localAs");
|
||||
json_object_array_add(json_community_list, json_string);
|
||||
break;
|
||||
default:
|
||||
|
@ -605,15 +605,15 @@ bgp_damp_info_vty (struct vty *vty, struct bgp_info *binfo,
|
||||
|
||||
if (json_path)
|
||||
{
|
||||
json_object_int_add(json_path, "dampening-penalty", penalty);
|
||||
json_object_int_add(json_path, "dampening-flap-count", bdi->flap);
|
||||
json_object_string_add(json_path, "dampening-flap-period",
|
||||
json_object_int_add(json_path, "dampeningPenalty", penalty);
|
||||
json_object_int_add(json_path, "dampeningFlapCount", bdi->flap);
|
||||
json_object_string_add(json_path, "dampeningFlapPeriod",
|
||||
peer_uptime (bdi->start_time, timebuf, BGP_UPTIME_LEN));
|
||||
|
||||
if (CHECK_FLAG (binfo->flags, BGP_INFO_DAMPED)
|
||||
&& ! CHECK_FLAG (binfo->flags, BGP_INFO_HISTORY))
|
||||
{
|
||||
json_object_string_add(json_path, "dampening-reuse-in",
|
||||
json_object_string_add(json_path, "dampeningReuseIn",
|
||||
bgp_get_reuse_time (penalty, timebuf, BGP_UPTIME_LEN));
|
||||
}
|
||||
}
|
||||
|
@ -6540,9 +6540,9 @@ route_vty_short_status_out (struct vty *vty, struct bgp_info *binfo,
|
||||
|
||||
/* Internal route. */
|
||||
if ((binfo->peer->as) && (binfo->peer->as == binfo->peer->local_as))
|
||||
json_object_string_add(json_path, "path-from", "internal");
|
||||
json_object_string_add(json_path, "pathFrom", "internal");
|
||||
else
|
||||
json_object_string_add(json_path, "path-from", "external");
|
||||
json_object_string_add(json_path, "pathFrom", "external");
|
||||
|
||||
return;
|
||||
}
|
||||
@ -7088,8 +7088,8 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
{
|
||||
if (json_paths)
|
||||
{
|
||||
json_object_int_add(json_path, "aggregator-as", attr->extra->aggregator_as);
|
||||
json_object_string_add(json_path, "aggregator-id", inet_ntoa (attr->extra->aggregator_addr));
|
||||
json_object_int_add(json_path, "aggregatorAs", attr->extra->aggregator_as);
|
||||
json_object_string_add(json_path, "aggregatorId", inet_ntoa (attr->extra->aggregator_addr));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -7102,7 +7102,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
if (CHECK_FLAG (binfo->peer->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT))
|
||||
{
|
||||
if (json_paths)
|
||||
json_object_boolean_true_add(json_path, "rxed-from-rr-client");
|
||||
json_object_boolean_true_add(json_path, "rxedFromRrClient");
|
||||
else
|
||||
vty_out (vty, ", (Received from a RR-client)");
|
||||
}
|
||||
@ -7110,7 +7110,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
if (CHECK_FLAG (binfo->peer->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT))
|
||||
{
|
||||
if (json_paths)
|
||||
json_object_boolean_true_add(json_path, "rxed-from-rs-client");
|
||||
json_object_boolean_true_add(json_path, "rxedFromRsClient");
|
||||
else
|
||||
vty_out (vty, ", (Received from a RS-client)");
|
||||
}
|
||||
@ -7118,14 +7118,14 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
if (CHECK_FLAG (binfo->flags, BGP_INFO_HISTORY))
|
||||
{
|
||||
if (json_paths)
|
||||
json_object_boolean_true_add(json_path, "dampening-history-entry");
|
||||
json_object_boolean_true_add(json_path, "dampeningHistoryEntry");
|
||||
else
|
||||
vty_out (vty, ", (history entry)");
|
||||
}
|
||||
else if (CHECK_FLAG (binfo->flags, BGP_INFO_DAMPED))
|
||||
{
|
||||
if (json_paths)
|
||||
json_object_boolean_true_add(json_path, "dampening-suppressed");
|
||||
json_object_boolean_true_add(json_path, "dampeningSuppressed");
|
||||
else
|
||||
vty_out (vty, ", (suppressed due to dampening)");
|
||||
}
|
||||
@ -7215,20 +7215,20 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
if (p->family == AF_INET && !BGP_ATTR_NEXTHOP_AFI_IP6(attr))
|
||||
{
|
||||
if (json_paths)
|
||||
json_object_string_add(json_peer, "peer-id", "0.0.0.0");
|
||||
json_object_string_add(json_peer, "peerId", "0.0.0.0");
|
||||
else
|
||||
vty_out (vty, " from 0.0.0.0 ");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (json_paths)
|
||||
json_object_string_add(json_peer, "peer-id", "::");
|
||||
json_object_string_add(json_peer, "peerId", "::");
|
||||
else
|
||||
vty_out (vty, " from :: ");
|
||||
}
|
||||
|
||||
if (json_paths)
|
||||
json_object_string_add(json_peer, "router-id", inet_ntoa(bgp->router_id));
|
||||
json_object_string_add(json_peer, "routerId", inet_ntoa(bgp->router_id));
|
||||
else
|
||||
vty_out (vty, "(%s)", inet_ntoa(bgp->router_id));
|
||||
}
|
||||
@ -7239,8 +7239,8 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
|
||||
if (json_paths)
|
||||
{
|
||||
json_object_string_add(json_peer, "peer-id", sockunion2str (&binfo->peer->su, buf, SU_ADDRSTRLEN));
|
||||
json_object_string_add(json_peer, "router-id", inet_ntop (AF_INET, &binfo->peer->remote_id, buf1, BUFSIZ));
|
||||
json_object_string_add(json_peer, "peerId", sockunion2str (&binfo->peer->su, buf, SU_ADDRSTRLEN));
|
||||
json_object_string_add(json_peer, "routerId", inet_ntop (AF_INET, &binfo->peer->remote_id, buf1, BUFSIZ));
|
||||
|
||||
if (binfo->peer->conf_if)
|
||||
json_object_string_add(json_peer, "interface", binfo->peer->conf_if);
|
||||
@ -7426,7 +7426,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE))
|
||||
{
|
||||
if (json_paths)
|
||||
json_object_boolean_true_add(json_path, "atomic-aggregate");
|
||||
json_object_boolean_true_add(json_path, "atomicAggregate");
|
||||
else
|
||||
vty_out (vty, ", atomic-aggregate");
|
||||
}
|
||||
@ -7478,7 +7478,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
{
|
||||
json_ext_community = json_object_new_object();
|
||||
json_object_string_add(json_ext_community, "string", attr->extra->ecommunity->str);
|
||||
json_object_object_add(json_path, "extended-community", json_ext_community);
|
||||
json_object_object_add(json_path, "extendedCommunity", json_ext_community);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -7495,7 +7495,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID))
|
||||
{
|
||||
if (json_paths)
|
||||
json_object_string_add(json_path, "originator-id", inet_ntoa (attr->extra->originator_id));
|
||||
json_object_string_add(json_path, "originatorId", inet_ntoa (attr->extra->originator_id));
|
||||
else
|
||||
vty_out (vty, " Originator: %s",
|
||||
inet_ntoa (attr->extra->originator_id));
|
||||
@ -7522,7 +7522,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
json_object_string_add(json_cluster_list, "string", attr->extra->cluster->str);
|
||||
*/
|
||||
json_object_object_add(json_cluster_list, "list", json_cluster_list_list);
|
||||
json_object_object_add(json_path, "cluster-list", json_cluster_list);
|
||||
json_object_object_add(json_path, "clusterList", json_cluster_list);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -7548,8 +7548,8 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
{
|
||||
if (json_paths)
|
||||
{
|
||||
json_object_int_add(json_path, "addpath-rx-id", binfo->addpath_rx_id);
|
||||
json_object_int_add(json_path, "addpath-tx-id", binfo->addpath_tx_id);
|
||||
json_object_int_add(json_path, "addpathRxId", binfo->addpath_rx_id);
|
||||
json_object_int_add(json_path, "addpathTxId", binfo->addpath_tx_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -7567,7 +7567,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
json_last_update = json_object_new_object();
|
||||
json_object_int_add(json_last_update, "epoch", tbuf);
|
||||
json_object_string_add(json_last_update, "string", ctime(&tbuf));
|
||||
json_object_object_add(json_path, "last-update", json_last_update);
|
||||
json_object_object_add(json_path, "lastUpdate", json_last_update);
|
||||
}
|
||||
else
|
||||
vty_out (vty, " Last update: %s", ctime(&tbuf));
|
||||
@ -7577,7 +7577,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
|
||||
json_last_update = json_object_new_object();
|
||||
json_object_int_add(json_last_update, "epoch", tbuf);
|
||||
json_object_string_add(json_last_update, "string", ctime(&binfo->uptime));
|
||||
json_object_object_add(json_path, "last-update", json_last_update);
|
||||
json_object_object_add(json_path, "lastUpdate", json_last_update);
|
||||
}
|
||||
else
|
||||
vty_out (vty, " Last update: %s", ctime(&binfo->uptime));
|
||||
@ -7661,8 +7661,8 @@ bgp_show_table (struct vty *vty, struct bgp_table *table, struct in_addr *router
|
||||
if (use_json)
|
||||
{
|
||||
json = json_object_new_object();
|
||||
json_object_int_add(json, "table-version", table->version);
|
||||
json_object_string_add(json, "router-id", inet_ntoa (*router_id));
|
||||
json_object_int_add(json, "tableVersion", table->version);
|
||||
json_object_string_add(json, "routerId", inet_ntoa (*router_id));
|
||||
json_routes = json_object_new_object();
|
||||
}
|
||||
|
||||
@ -8049,7 +8049,7 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp,
|
||||
{
|
||||
if (first)
|
||||
{
|
||||
json_object_object_add(json, "advertised-to", json_adv_to);
|
||||
json_object_object_add(json, "advertisedTo", json_adv_to);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -8422,7 +8422,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
/* Usage summary and header */
|
||||
if (use_json)
|
||||
{
|
||||
json_object_string_add(json, "router-id", inet_ntoa (bgp->router_id));
|
||||
json_object_string_add(json, "routerId", inet_ntoa (bgp->router_id));
|
||||
json_object_int_add(json, "as", bgp->as);
|
||||
}
|
||||
else
|
||||
@ -8436,27 +8436,27 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
{
|
||||
if (use_json)
|
||||
{
|
||||
json_object_int_add(json, "update-delay-limit", bgp->v_update_delay);
|
||||
json_object_int_add(json, "updateDelayLimit", bgp->v_update_delay);
|
||||
|
||||
if (bgp->v_update_delay != bgp->v_establish_wait)
|
||||
json_object_int_add(json, "update-delay-establish-wait", bgp->v_establish_wait);
|
||||
json_object_int_add(json, "updateDelayEstablishWait", bgp->v_establish_wait);
|
||||
|
||||
if (bgp_update_delay_active(bgp))
|
||||
{
|
||||
json_object_string_add(json, "update-delay-first-neighbor", bgp->update_delay_begin_time);
|
||||
json_object_boolean_true_add(json, "update-delay-in-progress");
|
||||
json_object_string_add(json, "updateDelayFirstNeighbor", bgp->update_delay_begin_time);
|
||||
json_object_boolean_true_add(json, "updateDelayInProgress");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bgp->update_delay_over)
|
||||
{
|
||||
json_object_string_add(json, "update-delay-first-neighbor",
|
||||
json_object_string_add(json, "updateDelayFirstNeighbor",
|
||||
bgp->update_delay_begin_time);
|
||||
json_object_string_add(json, "update-delay-bestpath-resumed",
|
||||
json_object_string_add(json, "updateDelayBestpathResumed",
|
||||
bgp->update_delay_end_time);
|
||||
json_object_string_add(json, "update-delay-zebra-update-resume",
|
||||
json_object_string_add(json, "updateDelayZebraUpdateResume",
|
||||
bgp->update_delay_zebra_resume_time);
|
||||
json_object_string_add(json, "update-delay-peer-update-resume",
|
||||
json_object_string_add(json, "updateDelayPeerUpdateResume",
|
||||
bgp->update_delay_peers_resume_time);
|
||||
}
|
||||
}
|
||||
@ -8495,34 +8495,34 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
if (use_json)
|
||||
{
|
||||
if (bgp_maxmed_onstartup_configured(bgp) && bgp->maxmed_active)
|
||||
json_object_boolean_true_add(json, "max-med-on-startup");
|
||||
json_object_boolean_true_add(json, "maxMedOnStartup");
|
||||
if (bgp->v_maxmed_admin)
|
||||
json_object_boolean_true_add(json, "max-med-administrative");
|
||||
json_object_boolean_true_add(json, "maxMedAdministrative");
|
||||
|
||||
json_object_int_add(json, "table-version", bgp_table_version(bgp->rib[afi][safi]));
|
||||
json_object_int_add(json, "tableVersion", bgp_table_version(bgp->rib[afi][safi]));
|
||||
|
||||
ents = bgp_table_count (bgp->rib[afi][safi]);
|
||||
json_object_int_add(json, "rib-count", ents);
|
||||
json_object_int_add(json, "rib-memory", ents * sizeof (struct bgp_node));
|
||||
json_object_int_add(json, "ribCount", ents);
|
||||
json_object_int_add(json, "ribMemory", ents * sizeof (struct bgp_node));
|
||||
|
||||
ents = listcount (bgp->peer);
|
||||
json_object_int_add(json, "peer-count", ents);
|
||||
json_object_int_add(json, "peer-memory", ents * sizeof (struct peer));
|
||||
json_object_int_add(json, "peerCount", ents);
|
||||
json_object_int_add(json, "peerMemory", ents * sizeof (struct peer));
|
||||
|
||||
if ((ents = listcount (bgp->rsclient)))
|
||||
{
|
||||
json_object_int_add(json, "rsclient-count", ents);
|
||||
json_object_int_add(json, "rsclient-memory", ents * sizeof (struct peer));
|
||||
json_object_int_add(json, "rsclientCount", ents);
|
||||
json_object_int_add(json, "rsclientMemory", ents * sizeof (struct peer));
|
||||
}
|
||||
|
||||
if ((ents = listcount (bgp->group)))
|
||||
{
|
||||
json_object_int_add(json, "peer-group-count", ents);
|
||||
json_object_int_add(json, "peer-group-memory", ents * sizeof (struct peer_group));
|
||||
json_object_int_add(json, "peerGroupCount", ents);
|
||||
json_object_int_add(json, "peerGroupMemory", ents * sizeof (struct peer_group));
|
||||
}
|
||||
|
||||
if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
|
||||
json_object_boolean_true_add(json, "dampening-enabled");
|
||||
json_object_boolean_true_add(json, "dampeningEnabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -8575,26 +8575,26 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
json_peer = json_object_new_object();
|
||||
|
||||
if (peer_dynamic_neighbor(peer))
|
||||
json_object_boolean_true_add(json_peer, "dynamic-peer");
|
||||
json_object_boolean_true_add(json_peer, "dynamicPeer");
|
||||
|
||||
json_object_int_add(json_peer, "remote-as", peer->as);
|
||||
json_object_int_add(json_peer, "remoteAs", peer->as);
|
||||
json_object_int_add(json_peer, "version", 4);
|
||||
json_object_int_add(json_peer, "msgrcvd",
|
||||
json_object_int_add(json_peer, "msgRcvd",
|
||||
peer->open_in + peer->update_in + peer->keepalive_in
|
||||
+ peer->notify_in + peer->refresh_in
|
||||
+ peer->dynamic_cap_in);
|
||||
json_object_int_add(json_peer, "msgsent",
|
||||
json_object_int_add(json_peer, "msgSent",
|
||||
peer->open_out + peer->update_out + peer->keepalive_out
|
||||
+ peer->notify_out + peer->refresh_out
|
||||
+ peer->dynamic_cap_out);
|
||||
|
||||
json_object_int_add(json_peer, "table-version", peer->version[afi][safi]);
|
||||
json_object_int_add(json_peer, "tableVersion", peer->version[afi][safi]);
|
||||
json_object_int_add(json_peer, "outq", peer->obuf->count);
|
||||
json_object_int_add(json_peer, "inq", 0);
|
||||
json_object_string_add(json_peer, "uptime",
|
||||
peer_uptime (peer->uptime, timebuf, BGP_UPTIME_LEN));
|
||||
json_object_int_add(json_peer, "prefix-received-count", peer->pcount[afi][safi]);
|
||||
json_object_int_add(json_peer, "prefix-advertised-count", bgp_adj_out_count(peer, afi, safi));
|
||||
json_object_int_add(json_peer, "prefixReceivedCount", peer->pcount[afi][safi]);
|
||||
json_object_int_add(json_peer, "prefixAdvertisedCount", bgp_adj_out_count(peer, afi, safi));
|
||||
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))
|
||||
json_object_string_add(json_peer, "state", "Idle (Admin)");
|
||||
@ -8604,11 +8604,11 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
json_object_string_add(json_peer, "state", LOOKUP(bgp_status_msg, peer->status));
|
||||
|
||||
if (peer->conf_if)
|
||||
json_object_string_add(json_peer, "id-type", "interface");
|
||||
json_object_string_add(json_peer, "idType", "interface");
|
||||
else if (peer->su.sa.sa_family == AF_INET)
|
||||
json_object_string_add(json_peer, "id-type", "ipv4");
|
||||
json_object_string_add(json_peer, "idType", "ipv4");
|
||||
else if (peer->su.sa.sa_family == AF_INET6)
|
||||
json_object_string_add(json_peer, "id-type", "ipv6");
|
||||
json_object_string_add(json_peer, "idType", "ipv6");
|
||||
|
||||
json_object_object_add(json_peers, peer->host, json_peer);
|
||||
}
|
||||
@ -8666,8 +8666,8 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
|
||||
{
|
||||
json_object_object_add(json, "peers", json_peers);
|
||||
|
||||
json_object_int_add(json, "total-peers", count);
|
||||
json_object_int_add(json, "dynamic-peers", dn_count);
|
||||
json_object_int_add(json, "totalPeers", count);
|
||||
json_object_int_add(json, "dynamicPeers", dn_count);
|
||||
|
||||
vty_out (vty, "%s%s", json_object_to_json_string(json), VTY_NEWLINE);
|
||||
json_object_free(json);
|
||||
|
Loading…
Reference in New Issue
Block a user