mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 05:34:41 +00:00
zebra: dump the dynamic-block bounds on vty command
The 'show debugging label-table' needs to dump dynamic block information. Display the lower and upper values for the dynamic block. > # show debugging label-table json > { > "dynamicBlock":{ > "lowerBound":16, > "upperBound":1048575 > }, > [..] > # show debugging label-table > Dynamic block: lower-bound 16, upper-bound 1048575 > [..] Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
0bd8a16082
commit
c6498ace44
@ -183,10 +183,21 @@ DEFPY(show_label_table, show_label_table_cmd, "show debugging label-table [json$
|
|||||||
{
|
{
|
||||||
struct label_manager_chunk *lmc;
|
struct label_manager_chunk *lmc;
|
||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
json_object *json_array = NULL;
|
json_object *json_array = NULL, *json_global = NULL, *json_dyn_block;
|
||||||
|
|
||||||
if (uj)
|
if (uj) {
|
||||||
json_array = json_object_new_array();
|
json_array = json_object_new_array();
|
||||||
|
json_global = json_object_new_object();
|
||||||
|
json_dyn_block = json_object_new_object();
|
||||||
|
json_object_int_add(json_dyn_block, "lowerBound",
|
||||||
|
lbl_mgr.dynamic_block_start);
|
||||||
|
json_object_int_add(json_dyn_block, "upperBound",
|
||||||
|
lbl_mgr.dynamic_block_end);
|
||||||
|
json_object_object_add(json_global, "dynamicBlock",
|
||||||
|
json_dyn_block);
|
||||||
|
} else
|
||||||
|
vty_out(vty, "Dynamic block: lower-bound %u, upper-bound %u\n",
|
||||||
|
lbl_mgr.dynamic_block_start, lbl_mgr.dynamic_block_end);
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(lbl_mgr.lc_list, node, lmc)) {
|
for (ALL_LIST_ELEMENTS_RO(lbl_mgr.lc_list, node, lmc)) {
|
||||||
if (uj) {
|
if (uj) {
|
||||||
@ -196,8 +207,10 @@ DEFPY(show_label_table, show_label_table_cmd, "show debugging label-table [json$
|
|||||||
vty_out(vty, "Proto %s: [%u/%u]\n",
|
vty_out(vty, "Proto %s: [%u/%u]\n",
|
||||||
zebra_route_string(lmc->proto), lmc->start, lmc->end);
|
zebra_route_string(lmc->proto), lmc->start, lmc->end);
|
||||||
}
|
}
|
||||||
if (uj)
|
if (uj) {
|
||||||
vty_json(vty, json_array);
|
json_object_object_add(json_global, "chunks", json_array);
|
||||||
|
vty_json(vty, json_global);
|
||||||
|
}
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user