diff options
Diffstat (limited to 'ospfd/ospf_vty.c')
| -rw-r--r-- | ospfd/ospf_vty.c | 63 |
1 files changed, 59 insertions, 4 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 780521bfe4..da90435c5b 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -10185,10 +10185,17 @@ static int ospf_show_gr_helper_details(struct vty *vty, struct ospf *ospf, json_object_int_add(json_vrf, "supportedGracePeriod", ospf->supported_grace_time); - if (ospf->last_exit_reason != OSPF_GR_HELPER_EXIT_NONE) +#if CONFDATE > 20230131 +CPP_NOTICE("Remove JSON object commands with keys starting with capital") +#endif + if (ospf->last_exit_reason != OSPF_GR_HELPER_EXIT_NONE) { json_object_string_add( json_vrf, "LastExitReason", ospf_exit_reason2str(ospf->last_exit_reason)); + json_object_string_add( + json_vrf, "lastExitReason", + ospf_exit_reason2str(ospf->last_exit_reason)); + } if (ospf->active_restarter_cnt) json_object_int_add(json_vrf, "activeRestarterCnt", @@ -10211,12 +10218,17 @@ static int ospf_show_gr_helper_details(struct vty *vty, struct ospf *ospf, if (uj) { json_object_object_get_ex(json_vrf, "Neighbors", &json_neighbors); + json_object_object_get_ex(json_vrf, "neighbors", + &json_neighbors); if (!json_neighbors) { json_neighbors = json_object_new_object(); json_object_object_add(json_vrf, "Neighbors", json_neighbors); + json_object_object_add(json_vrf, + "neighbors", + json_neighbors); } } @@ -10514,6 +10526,9 @@ static void config_write_stub_router(struct vty *vty, struct ospf *ospf) return; } +#if CONFDATE > 20230131 +CPP_NOTICE("Remove JSON object commands with keys containing whitespaces") +#endif static void show_ip_ospf_route_network(struct vty *vty, struct ospf *ospf, struct route_table *rt, json_object *json) @@ -10621,6 +10636,12 @@ static void show_ip_ospf_route_network(struct vty *vty, struct ospf *ospf, ifindex2ifname( path->ifindex, ospf->vrf_id)); + json_object_string_add( + json_nexthop, + "directlyAttachedTo", + ifindex2ifname( + path->ifindex, + ospf->vrf_id)); } else { vty_out(vty, "%24s directly attached to %s\n", @@ -10706,9 +10727,12 @@ static void show_ip_ospf_route_router(struct vty *vty, struct ospf *ospf, json_object_string_addf(json_route, "area", "%pI4", &or->u.std.area_id); - if (or->path_type == OSPF_PATH_INTER_AREA) + if (or->path_type == OSPF_PATH_INTER_AREA) { json_object_boolean_true_add(json_route, "IA"); + json_object_boolean_true_add(json_route, + "ia"); + } if (or->u.std.flags & ROUTER_LSA_BORDER) json_object_string_add(json_route, "routerType", @@ -10760,6 +10784,12 @@ static void show_ip_ospf_route_router(struct vty *vty, struct ospf *ospf, ifindex2ifname( path->ifindex, ospf->vrf_id)); + json_object_string_add( + json_nexthop, + "directlyAttachedTo", + ifindex2ifname( + path->ifindex, + ospf->vrf_id)); } else { vty_out(vty, "%24s directly attached to %s\n", @@ -10886,6 +10916,12 @@ static void show_ip_ospf_route_external(struct vty *vty, struct ospf *ospf, ifindex2ifname( path->ifindex, ospf->vrf_id)); + json_object_string_add( + json_nexthop, + "directlyAttachedTo", + ifindex2ifname( + path->ifindex, + ospf->vrf_id)); } else { vty_out(vty, "%24s directly attached to %s\n", @@ -11408,12 +11444,15 @@ static int ospf_show_summary_address(struct vty *vty, struct ospf *ospf, ospf_show_vrf_name(ospf, vty, json_vrf, use_vrf); - if (!uj) + if (!uj) { vty_out(vty, "aggregation delay interval :%u(in seconds)\n\n", ospf->aggr_delay_interval); - else + } else { json_object_int_add(json_vrf, "aggregation delay interval", ospf->aggr_delay_interval); + json_object_int_add(json_vrf, "aggregationDelayInterval", + ospf->aggr_delay_interval); + } for (rn = route_top(ospf->rt_aggr_tbl); rn; rn = route_next(rn)) if (rn->info) { @@ -11432,21 +11471,37 @@ static int ospf_show_summary_address(struct vty *vty, struct ospf *ospf, json_object_string_add(json_aggr, "Summary address", buf); + json_object_string_add(json_aggr, + "summaryAddress", buf); json_object_string_add( json_aggr, "Metric-type", (mtype == EXTERNAL_METRIC_TYPE_1) ? "E1" : "E2"); + json_object_string_add( + json_aggr, "metricType", + (mtype == EXTERNAL_METRIC_TYPE_1) + ? "E1" + : "E2"); +#if CONFDATE > 20230131 +CPP_NOTICE("Remove JSON object commands with keys starting with capital") +#endif json_object_int_add(json_aggr, "Metric", mval); + json_object_int_add(json_aggr, "metric", mval); json_object_int_add(json_aggr, "Tag", aggr->tag); + json_object_int_add(json_aggr, "tag", + aggr->tag); json_object_int_add( json_aggr, "External route count", OSPF_EXTERNAL_RT_COUNT(aggr)); + json_object_int_add( + json_aggr, "externalRouteCount", + OSPF_EXTERNAL_RT_COUNT(aggr)); if (OSPF_EXTERNAL_RT_COUNT(aggr) && detail) { hash_walk( |
