]> git.puffer.fish Git - mirror/frr.git/commitdiff
pathd: add no msd command in the pcc context
authorFarid Mihoub <farid.mihoub@6wind.com>
Mon, 30 Oct 2023 14:11:47 +0000 (15:11 +0100)
committerFarid Mihoub <farid.mihoub@6wind.com>
Tue, 31 Oct 2023 11:02:37 +0000 (12:02 +0100)
Add the "no msd" command to deconfigure pcc/msd node.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
pathd/path_pcep_cli.c

index 9880081f35e8b12a87704b137b6bddf21b3cfab5..2da321c02c67a32a7e059f7a9bcfde2d4f588bf3 100644 (file)
@@ -1018,10 +1018,14 @@ static int path_pcep_cli_pcc_delete(struct vty *vty)
 }
 
 static int path_pcep_cli_pcc_pcc_msd(struct vty *vty, const char *msd_str,
-                                    long msd)
+                                    long msd, bool reset)
 {
-       pcc_msd_configured_g = true;
-       PCEP_VTYSH_INT_ARG_CHECK(msd_str, msd, pcc_msd_g, 0, 33);
+       if (reset)
+               pcc_msd_configured_g = false;
+       else {
+               pcc_msd_configured_g = true;
+               PCEP_VTYSH_INT_ARG_CHECK(msd_str, msd, pcc_msd_g, 0, 33);
+       }
 
        return CMD_SUCCESS;
 }
@@ -2007,11 +2011,12 @@ DEFPY(pcep_cli_no_pcc,
 
 DEFPY(pcep_cli_pcc_pcc_msd,
       pcep_cli_pcc_pcc_msd_cmd,
-      "msd (1-32)",
+      "[no] msd (1-32)",
+      NO_STR
       "PCC maximum SID depth \n"
       "PCC maximum SID depth value\n")
 {
-       return path_pcep_cli_pcc_pcc_msd(vty, msd_str, msd);
+       return path_pcep_cli_pcc_pcc_msd(vty, msd_str, msd, no);
 }
 
 DEFPY(pcep_cli_pcc_pcc_peer,