summaryrefslogtreecommitdiffstats
path: root/mgmtd/mgmt_vty.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2023-11-15 02:14:22 +0100
committerIgor Ryzhov <iryzhov@nfware.com>2023-11-21 12:13:05 +0100
commita22f5a5289a59ef01986616a34ee863fe24bd874 (patch)
treef19f2b6ca168d0de1b86d469de7cfc5660465911 /mgmtd/mgmt_vty.c
parentlib: load nb callbacks even with ignore_cbs set (diff)
downloadfrr-a22f5a5289a59ef01986616a34ee863fe24bd874.tar.xz
frr-a22f5a5289a59ef01986616a34ee863fe24bd874.zip
mgmtd: add node for writing configuration
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'mgmtd/mgmt_vty.c')
-rw-r--r--mgmtd/mgmt_vty.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/mgmtd/mgmt_vty.c b/mgmtd/mgmt_vty.c
index a637898f8..0f6df9f12 100644
--- a/mgmtd/mgmt_vty.c
+++ b/mgmtd/mgmt_vty.c
@@ -462,6 +462,24 @@ static void mgmt_config_read_in(struct event *event)
}
}
+static int mgmtd_config_write(struct vty *vty)
+{
+ struct lyd_node *root;
+
+ LY_LIST_FOR (running_config->dnode, root) {
+ nb_cli_show_dnode_cmds(vty, root, false);
+ }
+
+ return 1;
+}
+
+static struct cmd_node mgmtd_node = {
+ .name = "mgmtd",
+ .node = MGMTD_NODE,
+ .prompt = "",
+ .config_write = mgmtd_config_write,
+};
+
void mgmt_vty_init(void)
{
/*
@@ -479,6 +497,7 @@ void mgmt_vty_init(void)
&mgmt_daemon_info->read_in);
install_node(&debug_node);
+ install_node(&mgmtd_node);
install_element(VIEW_NODE, &show_mgmt_be_adapter_cmd);
install_element(VIEW_NODE, &show_mgmt_be_xpath_reg_cmd);