]> git.puffer.fish Git - matthieu/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)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 31 Oct 2023 16:05:37 +0000 (16:05 +0000)
Add the "no msd" command to deconfigure pcc/msd node.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
(cherry picked from commit 444b08d16afa192c4a9d7209f1328ac95f7b289b)

pathd/path_pcep_cli.c

index 6c660a3d085cbe053acb2ee21b20e7371de313f7..110a419d87cc216e313497ff4d9dd0d9fafebfda 100644 (file)
@@ -974,10 +974,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;
 }
@@ -1928,11 +1932,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,