diff options
Diffstat (limited to 'lib/debug.c')
| -rw-r--r-- | lib/debug.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/debug.c b/lib/debug.c index 5f9109b3f1..9c283176a6 100644 --- a/lib/debug.c +++ b/lib/debug.c @@ -38,6 +38,25 @@ DEFUN_NOSH (debug_all, /* ------------------------------------------------------------------------- */ +static int config_write_debug(struct vty *vty) +{ + struct debug *debug; + + frr_each (debug_list, &debug_head, debug) { + if (DEBUG_MODE_CHECK(debug, DEBUG_MODE_CONF)) + vty_out(vty, "%s\n", debug->conf); + } + + return 0; +} + +static struct cmd_node debug_node = { + .name = "debug", + .node = LIB_DEBUG_NODE, + .prompt = "", + .config_write = config_write_debug, +}; + void debug_install(struct debug *debug) { debug_list_add_tail(&debug_head, debug); @@ -47,6 +66,8 @@ void debug_init(void) { debug_list_init(&debug_head); + install_node(&debug_node); + install_element(ENABLE_NODE, &debug_all_cmd); install_element(CONFIG_NODE, &debug_all_cmd); } |
