.. clicmd:: show ip ospf route [detail] [json]
Show the OSPF routing table, as determined by the most recent SPF
- calculation. If detail is specified, each routing item's
- advertiser will be show up.
+ calculation. When detail option is used, it shows more information
+ to the CLI like advertising router ID for each route, etc.
.. clicmd:: show ip ospf [vrf <NAME|all>] border-routers [json]
new->paths = list_new();
new->paths->del = (void (*)(void *))ospf_path_free;
+ new->u.std.transit = false;
return new;
}
or->cost = v->distance;
or->type = OSPF_DESTINATION_NETWORK;
or->u.std.origin = (struct lsa_header *)lsa;
+ or->u.std.transit = true;
ospf_route_copy_nexthops_from_vertex(area, or, v);
if (json) {
json_object_string_add(json_route, "routeType",
"N");
+ json_object_boolean_add(json_route, "transit",
+ or->u.std.transit);
json_object_int_add(json_route, "cost",
or->cost);
json_object_string_addf(json_route, "area",
"%pI4",
&or->u.std.area_id);
} else {
- vty_out(vty, "N %-18s [%d] area: %pI4\n",
- buf1, or->cost,
- &or->u.std.area_id);
+ vty_out(vty, "N %s %-18s [%d] area: %pI4\n",
+ or->u.std.transit && detail ? "T" : " ",
+ buf1, or->cost, &or->u.std.area_id);
}
break;
default:
ospf->vrf_id));
json_object_string_addf(
json_nexthop,
- "adv", "%pI4",
+ "advertisedRouter",
+ "%pI4",
&path->adv_router);
} else {
vty_out(vty,
path->ifindex,
ospf->vrf_id));
json_object_string_addf(
- json_nexthop, "adv",
+ json_nexthop,
+ "advertisedRouter",
"%pI4",
&path->adv_router);
} else {
return CMD_SUCCESS;
}
+ if (detail && json == NULL) {
+ vty_out(vty, "Codes: N - network T - transitive\n");
+ vty_out(vty, " IA - inter-area E - external route\n");
+ vty_out(vty, " D - destination R - router\n\n");
+ }
+
/* Show Network routes. */
show_ip_ospf_route_network(vty, ospf, ospf->new_table, json_vrf,
detail);