if (use_json)
{
json_object_object_add(json_neigh, "addressFamilyInfo", json_hold);
- json_object_int_add(json, "connectionsEstablished", p->established);
- json_object_int_add(json, "connectionsDropped", p->dropped);
+ json_object_int_add(json_neigh, "connectionsEstablished", p->established);
+ json_object_int_add(json_neigh, "connectionsDropped", p->dropped);
}
else
vty_out (vty, " Connections established %d; dropped %d%s", p->established, p->dropped,
if (! p->last_reset)
{
if (use_json)
- json_object_string_add(json, "lastReset", "never");
+ json_object_string_add(json_neigh, "lastReset", "never");
else
vty_out (vty, " Last reset never%s", VTY_NEWLINE);
}
uptime = bgp_clock();
uptime -= p->resettime;
tm = gmtime(&uptime);
- json_object_int_add(json, "lastResetTimerMsecs", (tm->tm_sec * 1000) + (tm->tm_min * 60000) + (tm->tm_hour * 3600000));
- json_object_string_add(json, "lastResetDueTo", peer_down_str[(int) p->last_reset]);
+ json_object_int_add(json_neigh, "lastResetTimerMsecs", (tm->tm_sec * 1000) + (tm->tm_min * 60000) + (tm->tm_hour * 3600000));
+ json_object_string_add(json_neigh, "lastResetDueTo", peer_down_str[(int) p->last_reset]);
if (p->last_reset_cause_size)
{
char errorcodesubcode_hexstr[5];
sprintf(errorcodesubcode_hexstr, "%02X%02X", p->notify.code, p->notify.subcode);
- json_object_string_add(json, "lastErrorCodeSubcode", errorcodesubcode_hexstr);
+ json_object_string_add(json_neigh, "lastErrorCodeSubcode", errorcodesubcode_hexstr);
}
}
else
if (CHECK_FLAG (p->sflags, PEER_STATUS_PREFIX_OVERFLOW))
{
if (use_json)
- json_object_boolean_true_add(json, "prefixesConfigExceedMax");
+ json_object_boolean_true_add(json_neigh, "prefixesConfigExceedMax");
else
vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE);
{
if (use_json)
{
- json_object_boolean_true_add(json, "reducePrefixNumFrom");
- json_object_int_add(json, "restartInTimerMsec", thread_timer_remain_second (p->t_pmax_restart) * 1000);
+ json_object_boolean_true_add(json_neigh, "reducePrefixNumFrom");
+ json_object_int_add(json_neigh, "restartInTimerMsec", thread_timer_remain_second (p->t_pmax_restart) * 1000);
}
else
vty_out (vty, " Reduce the no. of prefix from %s, will restart in %ld seconds%s",
else
{
if (use_json)
- json_object_boolean_true_add(json, "reducePrefixNumAndClearIpBgp");
+ json_object_boolean_true_add(json_neigh, "reducePrefixNumAndClearIpBgp");
else
vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
p->host, VTY_NEWLINE);