diff options
| author | fmihoub6WIND <farid.mihoub@yandex.com> | 2022-12-02 11:10:19 +0100 | 
|---|---|---|
| committer | Farid Mihoub <farid.mihoub@6wind.com> | 2023-09-29 08:24:18 +0200 | 
| commit | 2b8e22f264cc0529847ad640e8df90d62e751ee4 (patch) | |
| tree | 87fb4147451963b3b4381e35c911a30993f68c78 /zebra/label_manager.c | |
| parent | 3518fe70cbee5c64004b91ecf89648da58863eaf (diff) | |
zebra: dump label table information
Add the new command "show debugging labeltable" to show allocated label
chunks in the label table managed with label_manager.c
Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/label_manager.c')
| -rw-r--r-- | zebra/label_manager.c | 20 | 
1 files changed, 20 insertions, 0 deletions
diff --git a/zebra/label_manager.c b/zebra/label_manager.c index c77470a701..bd0b53738c 100644 --- a/zebra/label_manager.c +++ b/zebra/label_manager.c @@ -28,6 +28,8 @@  #include "zebra/zapi_msg.h"  #include "zebra/debug.h" +#include "zebra/label_manager_clippy.c" +  #define CONNECTION_DELAY 5  struct label_manager lbl_mgr; @@ -145,6 +147,22 @@ void lm_hooks_unregister(void)  	hook_unregister(lm_release_chunk, label_manager_release_label_chunk);  } +DEFPY(show_label_table, show_label_table_cmd, "show debugging label-table", +      SHOW_STR +      DEBUG_STR +      "Display allocated label chunks\n") +{ +	struct label_manager_chunk *lmc; +	struct listnode *node; + +	for (ALL_LIST_ELEMENTS_RO(lbl_mgr.lc_list, node, lmc)) { +		vty_out(vty, "Proto %s: [%u/%u]\n", +			zebra_route_string(lmc->proto), lmc->start, lmc->end); +	} + +	return CMD_SUCCESS; +} +  /**   * Init label manager (or proxy to an external one)   */ @@ -159,6 +177,8 @@ void label_manager_init(void)  	/* notify any external module that we are done */  	hook_call(lm_cbs_inited); + +	install_element(VIEW_NODE, &show_label_table_cmd);  }  /* alloc and fill a label chunk */  | 
