]> git.puffer.fish Git - mirror/frr.git/commitdiff
vtysh: add the "debug northbound" command
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 23 Sep 2019 12:38:02 +0000 (09:38 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 23 Sep 2019 12:38:05 +0000 (09:38 -0300)
This command is defined in the lib/northbound_cli.c file, which
is not being parsed by vtysh since most commands from there need
special handling in the context of vtysh. The "debug northbound"
command, however, can be made available to vtysh without problems.
Introduce a new DEFUNSH to do that.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
vtysh/vtysh.c

index a762e9555caf871aa03dda75c757c9b2d7a28c2e..ea079d8b18a5728d7f6b5be7b8cba42ad1ab9853 100644 (file)
@@ -2422,6 +2422,28 @@ DEFUN (vtysh_show_error_code,
        return CMD_SUCCESS;
 }
 
+/* Northbound. */
+DEFUNSH(VTYSH_ALL, debug_nb,
+       debug_nb_cmd,
+       "[no] debug northbound\
+          [<\
+           callbacks$cbs [{configuration$cbs_cfg|state$cbs_state|rpc$cbs_rpc}]\
+           |notifications$notifications\
+           |events$events\
+          >]",
+       NO_STR
+       DEBUG_STR
+       "Northbound debugging\n"
+       "Callbacks\n"
+       "Configuration\n"
+       "State\n"
+       "RPC\n"
+       "Notifications\n"
+       "Events\n")
+{
+       return CMD_SUCCESS;
+}
+
 /* Memory */
 DEFUN (vtysh_show_memory,
        vtysh_show_memory_cmd,
@@ -4017,6 +4039,10 @@ void vtysh_init_vty(void)
        install_element(ENABLE_NODE, &vtysh_debug_memstats_cmd);
        install_element(CONFIG_NODE, &vtysh_debug_memstats_cmd);
 
+       /* northbound */
+       install_element(ENABLE_NODE, &debug_nb_cmd);
+       install_element(CONFIG_NODE, &debug_nb_cmd);
+
        /* misc lib show commands */
        install_element(VIEW_NODE, &vtysh_show_memory_cmd);
        install_element(VIEW_NODE, &vtysh_show_modules_cmd);