Skip to content

Commit

Permalink
Merge pull request #14705 from FRRouting/mergify/bp/dev/9.1/pr-14699
Browse files Browse the repository at this point in the history
Add missing pcep no commands (backport #14699)
  • Loading branch information
donaldsharp authored Oct 31, 2023
2 parents d0a8f80 + 7a29ccc commit 4c8cc8f
Showing 1 changed file with 40 additions and 5 deletions.
45 changes: 40 additions & 5 deletions pathd/path_pcep_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -1818,6 +1822,35 @@ DEFPY_NOSH(
return CMD_SUCCESS;
}

DEFPY(
pcep_cli_no_pcep,
pcep_cli_no_pcep_cmd,
"no pcep",
NO_STR
"PCEP configuration\n")
{
/* Delete PCCs */
path_pcep_cli_pcc_delete(vty);

for (int i = 0; i < MAX_PCE; i++) {
/* Delete PCEs */
if (pcep_g->pce_opts_cli[i] != NULL) {
XFREE(MTYPE_PCEP, pcep_g->pce_opts_cli[i]);
pcep_g->pce_opts_cli[i] = NULL;
pcep_g->num_pce_opts_cli--;
}

/* Delete PCE-CONFIGs */
if (pcep_g->config_group_opts[i] != NULL) {
XFREE(MTYPE_PCEP, pcep_g->config_group_opts[i]);
pcep_g->config_group_opts[i] = NULL;
pcep_g->num_config_group_opts--;
}
}

return CMD_SUCCESS;
}

DEFPY_NOSH(
pcep_cli_pcep_pce_config,
pcep_cli_pcep_pce_config_cmd,
Expand Down Expand Up @@ -2007,11 +2040,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,
Expand Down Expand Up @@ -2087,6 +2121,7 @@ void pcep_cli_init(void)
install_default(PCEP_NODE);

install_element(SR_TRAFFIC_ENG_NODE, &pcep_cli_pcep_cmd);
install_element(SR_TRAFFIC_ENG_NODE, &pcep_cli_no_pcep_cmd);

/* PCEP configuration group related configuration commands */
install_element(PCEP_NODE, &pcep_cli_pcep_pce_config_cmd);
Expand Down

0 comments on commit 4c8cc8f

Please sign in to comment.