ospfd: Remove local-block deprecated command

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2022-06-02 13:45:57 +03:00
parent 1bf4e04e0e
commit d2e02cbf64
11 changed files with 3 additions and 97 deletions

View File

@ -310,8 +310,7 @@ Routing.
ospf router-id 192.168.1.11
capability opaque
segment-routing on
segment-routing global-block 10000 19999
segment-routing local-block 5000 5999
segment-routing global-block 10000 19999 local-block 5000 5999
segment-routing node-msd 8
segment-routing prefix 192.168.1.11/32 index 1100

View File

@ -985,12 +985,6 @@ dataplane.
Block, i.e. the label range used for Adjacency SID. The negative version
of the command always unsets both ranges.
.. clicmd:: segment-routing local-block (16-1048575) (16-1048575)
Set the Segment Routing Local Block i.e. the label range used by MPLS to
store label in the MPLS FIB for Adjacency SID. This command is deprecated
in favor of the combined command above.
.. clicmd:: segment-routing node-msd (1-16)
Fix the Maximum Stack Depth supported by the router. The value depend of the

View File

@ -2302,84 +2302,6 @@ DEFUN(no_sr_global_label_range, no_sr_global_label_range_cmd,
return CMD_SUCCESS;
}
#if CONFDATE > 20220528
CPP_NOTICE(
"Use of the segment-routing local-block command is deprecated, use the combined global-block command instead")
#endif
DEFUN_HIDDEN(sr_local_label_range, sr_local_label_range_cmd,
"segment-routing local-block (16-1048575) (16-1048575)",
SR_STR
"Segment Routing Local Block label range\n"
"Lower-bound range in decimal (16-1048575)\n"
"Upper-bound range in decimal (16-1048575)\n")
{
uint32_t upper;
uint32_t lower;
uint32_t srgb_upper;
int idx_low = 2;
int idx_up = 3;
/* Get lower and upper bound */
lower = strtoul(argv[idx_low]->arg, NULL, 10);
upper = strtoul(argv[idx_up]->arg, NULL, 10);
/* check correctness of SRLB */
if (!sr_range_is_valid(lower, upper, MIN_SRLB_SIZE)) {
vty_out(vty, "Invalid SRLB range\n");
return CMD_WARNING_CONFIG_FAILED;
}
/* Check if values have changed */
if ((OspfSR.srlb.start == lower)
&& (OspfSR.srlb.end == upper))
return CMD_SUCCESS;
/* Validate SRLB against SRGB */
srgb_upper = OspfSR.srgb.start + OspfSR.srgb.size - 1;
if (ranges_overlap(OspfSR.srgb.start, srgb_upper, lower, upper)) {
vty_out(vty,
"New SR Local Block (%u/%u) conflicts with Global Block (%u/%u)\n",
lower, upper, OspfSR.srgb.start, srgb_upper);
return CMD_WARNING_CONFIG_FAILED;
}
if (update_sr_blocks(OspfSR.srgb.start, srgb_upper, lower, upper) < 0)
return CMD_WARNING_CONFIG_FAILED;
else
return CMD_SUCCESS;
}
DEFUN_HIDDEN(no_sr_local_label_range, no_sr_local_label_range_cmd,
"no segment-routing local-block [(16-1048575) (16-1048575)]",
NO_STR SR_STR
"Segment Routing Local Block label range\n"
"Lower-bound range in decimal (16-1048575)\n"
"Upper-bound range in decimal (16-1048575)\n")
{
uint32_t srgb_end;
/* Validate SRLB against SRGB */
srgb_end = OspfSR.srgb.start + OspfSR.srgb.size - 1;
if (ranges_overlap(OspfSR.srgb.start, srgb_end, DEFAULT_SRLB_LABEL,
DEFAULT_SRLB_END)) {
vty_out(vty,
"New SR Local Block (%u/%u) conflicts with Global Block (%u/%u)\n",
DEFAULT_SRLB_LABEL, DEFAULT_SRLB_END, OspfSR.srgb.start,
srgb_end);
return CMD_WARNING_CONFIG_FAILED;
}
if (update_sr_blocks(OspfSR.srgb.start, srgb_end, DEFAULT_SRLB_LABEL,
DEFAULT_SRLB_END)
< 0)
return CMD_WARNING_CONFIG_FAILED;
else
return CMD_SUCCESS;
}
DEFUN (sr_node_msd,
sr_node_msd_cmd,
"segment-routing node-msd (1-16)",
@ -3047,8 +2969,6 @@ void ospf_sr_register_vty(void)
install_element(OSPF_NODE, &no_ospf_sr_enable_cmd);
install_element(OSPF_NODE, &sr_global_label_range_cmd);
install_element(OSPF_NODE, &no_sr_global_label_range_cmd);
install_element(OSPF_NODE, &sr_local_label_range_cmd);
install_element(OSPF_NODE, &no_sr_local_label_range_cmd);
install_element(OSPF_NODE, &sr_node_msd_cmd);
install_element(OSPF_NODE, &no_sr_node_msd_cmd);
install_element(OSPF_NODE, &sr_prefix_sid_cmd);

View File

@ -30,7 +30,6 @@ router ospf
passive-interface lo
segment-routing on
segment-routing global-block 16000 23999
!segment-routing local-block 15000 15999
segment-routing node-msd 8
segment-routing prefix 1.1.1.1/32 index 10
!

View File

@ -41,7 +41,6 @@ router ospf
passive-interface lo
segment-routing on
segment-routing global-block 16000 23999
!segment-routing local-block 15000 15999
segment-routing node-msd 8
segment-routing prefix 2.2.2.2/32 index 20
!

View File

@ -40,7 +40,6 @@ router ospf
router-info area 0.0.0.0
segment-routing on
segment-routing global-block 16000 23999
!segment-routing local-block 15000 15999
segment-routing node-msd 8
segment-routing prefix 3.3.3.3/32 index 30
!

View File

@ -47,7 +47,6 @@ router ospf
passive-interface lo
segment-routing on
segment-routing global-block 16000 23999
!segment-routing local-block 15000 15999
segment-routing node-msd 8
segment-routing prefix 4.4.4.4/32 index 40
!

View File

@ -47,7 +47,6 @@ router ospf
passive-interface lo
segment-routing on
segment-routing global-block 16000 23999
! segment-routing local-block 15000 15999
segment-routing node-msd 8
segment-routing prefix 5.5.5.5/32 index 50
!

View File

@ -35,7 +35,6 @@ router ospf
passive-interface lo
segment-routing on
segment-routing global-block 16000 23999
! segment-routing local-block 15000 15999
segment-routing node-msd 8
segment-routing prefix 6.6.6.6/32 index 60
!

View File

@ -15,8 +15,7 @@ router ospf
mpls-te on
mpls-te router-address 10.0.255.4
segment-routing on
segment-routing local-block 5000 5999
segment-routing global-block 10000 19999
segment-routing global-block 10000 19999 local-block 5000 5999
segment-routing node-msd 12
segment-routing prefix 10.0.255.4/32 index 400 no-php-flag
!

View File

@ -224,7 +224,7 @@ def test_step4():
'vtysh -c "conf t" -c "router ospf" -c "segment-routing node-msd 16"'
)
tgen.net["r2"].cmd(
'vtysh -c "conf t" -c "router ospf" -c "segment-routing local-block 5000 6999"'
'vtysh -c "conf t" -c "router ospf" -c "segment-routing global-block 16000 23999 local-block 5000 6999"'
)
tgen.net["r2"].cmd(
'vtysh -c "conf t" -c "router ospf" -c "segment-routing prefix 10.0.255.2/32 index 20 explicit-null"'