]> git.proxmox.com Git - mirror_frr.git/blobdiff - pathd/path_pcep_cli.c
*: fix for -Wstrict-prototypes
[mirror_frr.git] / pathd / path_pcep_cli.c
index db5f256a8643d41645b947f86f9ddb90f7697b83..a6f253d3e32451511372fe76e21936b3c6a3da8c 100644 (file)
@@ -69,7 +69,7 @@ static int pcep_cli_pcep_pce_config_write(struct vty *vty);
 /* Internal Util Function declarations */
 static struct pce_opts_cli *pcep_cli_find_pce(const char *pce_name);
 static bool pcep_cli_add_pce(struct pce_opts_cli *pce_opts_cli);
-static struct pce_opts_cli *pcep_cli_create_pce_opts();
+static struct pce_opts_cli *pcep_cli_create_pce_opts(const char *name);
 static void pcep_cli_delete_pce(const char *pce_name);
 static void
 pcep_cli_merge_pcep_pce_config_options(struct pce_opts_cli *pce_opts_cli);
@@ -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,10 @@ 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);
+       vty_out(vty, "  exit\n");
        return 1;
 }
 
@@ -1468,7 +1468,7 @@ int pcep_cli_pcc_config_write(struct vty *vty)
        }
 
        if (pce_connections_g.num_connections == 0) {
-               return lines;
+               goto exit;
        }
 
        buf[0] = 0;
@@ -1495,6 +1495,8 @@ int pcep_cli_pcc_config_write(struct vty *vty)
                lines++;
                buf[0] = 0;
        }
+exit:
+       vty_out(vty, "   exit\n");
 
        return lines;
 }
@@ -1655,6 +1657,8 @@ int pcep_cli_pce_config_write(struct vty *vty)
 
                vty_out(vty, "%s", buf);
                buf[0] = '\0';
+
+               vty_out(vty, "   exit\n");
        }
 
        return lines;
@@ -1679,6 +1683,8 @@ int pcep_cli_pcep_pce_config_write(struct vty *vty)
                        pcep_cli_print_pce_config(group_opts, buf, sizeof(buf));
                vty_out(vty, "%s", buf);
                buf[0] = 0;
+
+               vty_out(vty, "   exit\n");
        }
 
        return lines;
@@ -1999,6 +2005,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);