mgmtd: add node for writing configuration

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
Igor Ryzhov 2023-11-15 02:14:22 +01:00
parent 0d2e1985a8
commit a22f5a5289
2 changed files with 20 additions and 0 deletions

View file

@ -176,6 +176,7 @@ enum node_type {
BMP_NODE, /* BMP config under router bgp */
ISIS_SRV6_NODE, /* ISIS SRv6 node */
ISIS_SRV6_NODE_MSD_NODE, /* ISIS SRv6 Node MSDs node */
MGMTD_NODE, /* MGMTD node. */
NODE_TYPE_MAX, /* maximum */
};
/* clang-format on */

View file

@ -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);