summaryrefslogtreecommitdiff
path: root/pathd/path_pcep_cli.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-08-05 23:54:22 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-08-23 22:08:20 +0300
commitac9103aadc4a3da65b30952d69fdc535ae87604f (patch)
treefb3b5186ad1dc9dceda83989c618f8899d6a1a90 /pathd/path_pcep_cli.c
parentfc43980f25eab0f5e05e274f7144cda811333284 (diff)
pathd: rework config printing code
Instead of setting a config_write callback for each node, set a single callback and print all config from there. It is necessary for the following work on explicit "exit" command in every node. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'pathd/path_pcep_cli.c')
-rw-r--r--pathd/path_pcep_cli.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pathd/path_pcep_cli.c b/pathd/path_pcep_cli.c
index db5f256a86..e602fd22df 100644
--- a/pathd/path_pcep_cli.c
+++ b/pathd/path_pcep_cli.c
@@ -175,7 +175,6 @@ static struct cmd_node pcep_node = {
.name = "srte pcep",
.node = PCEP_NODE,
.parent_node = SR_TRAFFIC_ENG_NODE,
- .config_write = pcep_cli_pcep_config_write,
.prompt = "%s(config-sr-te-pcep)# "
};
@@ -183,7 +182,6 @@ static struct cmd_node pcep_pcc_node = {
.name = "srte pcep pcc",
.node = PCEP_PCC_NODE,
.parent_node = PCEP_NODE,
- .config_write = pcep_cli_pcc_config_write,
.prompt = "%s(config-sr-te-pcep-pcc)# "
};
@@ -191,7 +189,6 @@ static struct cmd_node pcep_pce_node = {
.name = "srte pcep pce",
.node = PCEP_PCE_NODE,
.parent_node = PCEP_NODE,
- .config_write = pcep_cli_pce_config_write,
.prompt = "%s(config-sr-te-pcep-pce)# "
};
@@ -199,7 +196,6 @@ static struct cmd_node pcep_pce_config_node = {
.name = "srte pcep pce-config",
.node = PCEP_PCE_CONFIG_NODE,
.parent_node = PCEP_NODE,
- .config_write = pcep_cli_pcep_pce_config_write,
.prompt = "%s(pce-sr-te-pcep-pce-config)# "
};
@@ -1444,6 +1440,9 @@ int pcep_cli_debug_set_all(uint32_t flags, bool set)
int pcep_cli_pcep_config_write(struct vty *vty)
{
vty_out(vty, " pcep\n");
+ pcep_cli_pcep_pce_config_write(vty);
+ pcep_cli_pce_config_write(vty);
+ pcep_cli_pcc_config_write(vty);
return 1;
}
@@ -1999,6 +1998,7 @@ DEFPY(pcep_cli_clear_srte_pcep_session,
void pcep_cli_init(void)
{
+ hook_register(pathd_srte_config_write, pcep_cli_pcep_config_write);
hook_register(nb_client_debug_config_write,
pcep_cli_debug_config_write);
hook_register(nb_client_debug_set_all, pcep_cli_debug_set_all);