Skip to content

Commit

Permalink
Merge pull request #14971 from opensourcerouting/o6-hidden-area
Browse files Browse the repository at this point in the history
ospf6d: remove hidden obsolete command
  • Loading branch information
donaldsharp authored Dec 10, 2023
2 parents df3e5ca + 28f5969 commit dabef02
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 185 deletions.
144 changes: 0 additions & 144 deletions ospf6d/ospf6_top.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,148 +1070,6 @@ DEFUN (no_ospf6_distance_ospf6,
return CMD_SUCCESS;
}

DEFUN_HIDDEN (ospf6_interface_area,
ospf6_interface_area_cmd,
"interface IFNAME area <A.B.C.D|(0-4294967295)>",
"Enable routing on an IPv6 interface\n"
IFNAME_STR
"Specify the OSPF6 area ID\n"
"OSPF6 area ID in IPv4 address notation\n"
"OSPF6 area ID in decimal notation\n"
)
{
VTY_DECLVAR_CONTEXT(ospf6, ospf6);
int idx_ifname = 1;
int idx_ipv4 = 3;
struct ospf6_area *oa;
struct ospf6_interface *oi;
struct interface *ifp;
uint32_t area_id;
int format;

vty_out(vty,
"This command is deprecated, because it is not VRF-aware.\n");
vty_out(vty,
"Please, use \"ipv6 ospf6 area\" on an interface instead.\n");

/* find/create ospf6 interface */
ifp = if_get_by_name(argv[idx_ifname]->arg, ospf6->vrf_id, ospf6->name);
oi = (struct ospf6_interface *)ifp->info;
if (oi == NULL)
oi = ospf6_interface_create(ifp);
if (oi->area) {
vty_out(vty, "%s already attached to Area %s\n",
oi->interface->name, oi->area->name);
return CMD_SUCCESS;
}

if (str2area_id(argv[idx_ipv4]->arg, &area_id, &format)) {
vty_out(vty, "Malformed Area-ID: %s\n", argv[idx_ipv4]->arg);
return CMD_WARNING_CONFIG_FAILED;
}

oi->area_id = area_id;
oi->area_id_format = format;

oa = ospf6_area_lookup(area_id, ospf6);
if (oa == NULL)
oa = ospf6_area_create(area_id, ospf6, format);

/* attach interface to area */
listnode_add(oa->if_list, oi); /* sort ?? */
oi->area = oa;

SET_FLAG(oa->flag, OSPF6_AREA_ENABLE);

/* ospf6 process is currently disabled, not much more to do */
if (CHECK_FLAG(ospf6->flag, OSPF6_DISABLED))
return CMD_SUCCESS;

/* start up */
ospf6_interface_enable(oi);

/* If the router is ABR, originate summary routes */
if (ospf6_check_and_set_router_abr(ospf6)) {
ospf6_abr_enable_area(oa);
ospf6_schedule_abr_task(oa->ospf6);
}

return CMD_SUCCESS;
}

DEFUN_HIDDEN (no_ospf6_interface_area,
no_ospf6_interface_area_cmd,
"no interface IFNAME area <A.B.C.D|(0-4294967295)>",
NO_STR
"Disable routing on an IPv6 interface\n"
IFNAME_STR
"Specify the OSPF6 area ID\n"
"OSPF6 area ID in IPv4 address notation\n"
"OSPF6 area ID in decimal notation\n"
)
{
VTY_DECLVAR_CONTEXT(ospf6, ospf6);
int idx_ifname = 2;
int idx_ipv4 = 4;
struct ospf6_interface *oi;
struct ospf6_area *oa;
struct interface *ifp;
uint32_t area_id;

vty_out(vty,
"This command is deprecated, because it is not VRF-aware.\n");
vty_out(vty,
"Please, use \"no ipv6 ospf6 area\" on an interface instead.\n");

/* find/create ospf6 interface */
ifp = if_get_by_name(argv[idx_ifname]->arg, ospf6->vrf_id, ospf6->name);

if (ifp == NULL) {
vty_out(vty, "No such interface %s\n", argv[idx_ifname]->arg);
return CMD_SUCCESS;
}

oi = (struct ospf6_interface *)ifp->info;
if (oi == NULL) {
vty_out(vty, "Interface %s not enabled\n", ifp->name);
return CMD_SUCCESS;
}

/* parse Area-ID */
if (inet_pton(AF_INET, argv[idx_ipv4]->arg, &area_id) != 1)
area_id = htonl(strtoul(argv[idx_ipv4]->arg, NULL, 10));

/* Verify Area */
if (oi->area == NULL) {
vty_out(vty, "%s not attached to area %s\n",
oi->interface->name, argv[idx_ipv4]->arg);
return CMD_SUCCESS;
}

if (oi->area->area_id != area_id) {
vty_out(vty, "Wrong Area-ID: %s is attached to area %s\n",
oi->interface->name, oi->area->name);
return CMD_SUCCESS;
}

ospf6_interface_disable(oi);

oa = oi->area;
listnode_delete(oi->area->if_list, oi);
oi->area = (struct ospf6_area *)NULL;

/* Withdraw inter-area routes from this area, if necessary */
if (oa->if_list->count == 0) {
UNSET_FLAG(oa->flag, OSPF6_AREA_ENABLE);
ospf6_abr_disable_area(oa);
}

oi->area_id = 0;
oi->area_id_format = OSPF6_AREA_FMT_UNSET;

return CMD_SUCCESS;
}

DEFUN (ospf6_stub_router_admin,
ospf6_stub_router_admin_cmd,
"stub-router administrative",
Expand Down Expand Up @@ -2360,8 +2218,6 @@ void ospf6_top_init(void)
install_element(OSPF6_NODE, &ospf6_timers_lsa_cmd);
install_element(OSPF6_NODE, &no_ospf6_timers_lsa_cmd);

install_element(OSPF6_NODE, &ospf6_interface_area_cmd);
install_element(OSPF6_NODE, &no_ospf6_interface_area_cmd);
install_element(OSPF6_NODE, &ospf6_stub_router_admin_cmd);
install_element(OSPF6_NODE, &no_ospf6_stub_router_admin_cmd);

Expand Down
4 changes: 2 additions & 2 deletions tests/topotests/all_protocol_startup/r1/ospf6d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ log file ospf6d.log
! debug ospf6 neighbor
!
interface r1-eth4
ipv6 ospf6 hello-interval 1
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 hello-interval 1
!
router ospf6
ospf6 router-id 192.168.0.1
log-adjacency-changes
interface r1-eth4 area 0.0.0.0
!
line vty
!
Expand Down
4 changes: 2 additions & 2 deletions tests/topotests/bfd_ospf_topo1/rt1/ospf6d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ hostname rt1
password 1
!
interface eth-rt2
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 8
ipv6 ospf6 network broadcast
ipv6 ospf6 bfd
!
interface eth-rt3
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 8
ipv6 ospf6 network broadcast
ipv6 ospf6 bfd
!
router ospf6
ospf6 router-id 1.1.1.1
interface eth-rt2 area 0.0.0.0
interface eth-rt3 area 0.0.0.0
redistribute connected
!
4 changes: 2 additions & 2 deletions tests/topotests/bfd_ospf_topo1/rt2/ospf6d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ hostname rt2
password 1
!
interface eth-rt1
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 8
ipv6 ospf6 network broadcast
ipv6 ospf6 bfd
!
interface eth-rt5
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 8
ipv6 ospf6 network broadcast
!
router ospf6
ospf6 router-id 2.2.2.2
interface eth-rt1 area 0.0.0.0
interface eth-rt5 area 0.0.0.0
redistribute connected
!
4 changes: 2 additions & 2 deletions tests/topotests/bfd_ospf_topo1/rt3/ospf6d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ hostname rt3
password 1
!
interface eth-rt1
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 8
ipv6 ospf6 network broadcast
ipv6 ospf6 bfd
!
interface eth-rt4
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 8
ipv6 ospf6 network broadcast
!
router ospf6
ospf6 router-id 3.3.3.3
interface eth-rt1 area 0.0.0.0
interface eth-rt4 area 0.0.0.0
redistribute connected
!
4 changes: 2 additions & 2 deletions tests/topotests/bfd_ospf_topo1/rt4/ospf6d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ hostname rt4
password 1
!
interface eth-rt3
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 8
ipv6 ospf6 network broadcast
!
interface eth-rt5
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 8
ipv6 ospf6 network broadcast
!
router ospf6
ospf6 router-id 4.4.4.4
interface eth-rt3 area 0.0.0.0
interface eth-rt5 area 0.0.0.0
redistribute connected
!
4 changes: 2 additions & 2 deletions tests/topotests/bfd_ospf_topo1/rt5/ospf6d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ hostname rt5
password 1
!
interface eth-rt2
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 network broadcast
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 8
!
interface eth-rt4
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 network broadcast
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 8
!
router ospf6
ospf6 router-id 5.5.5.5
interface eth-rt2 area 0.0.0.0
interface eth-rt4 area 0.0.0.0
redistribute connected
!
2 changes: 1 addition & 1 deletion tests/topotests/bfd_profiles_topo1/r4/ospf6d.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
interface r4-eth1
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 bfd profile fast-tx
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 10
!
router ospf6
ospf6 router-id 10.254.254.4
redistribute connected
interface r4-eth1 area 0.0.0.0
!
2 changes: 1 addition & 1 deletion tests/topotests/bfd_profiles_topo1/r5/ospf6d.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
interface r5-eth0
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 bfd
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 10
!
router ospf6
ospf6 router-id 10.254.254.5
redistribute connected
interface r5-eth0 area 0.0.0.0
!
6 changes: 3 additions & 3 deletions tests/topotests/bgp_features/r1/ospf6d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ log file ospf6d.log
! debug ospf6 neighbor
!
interface r1-lo
ipv6 ospf6 area 0.0.0.0
!
interface r1-eth1
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 priority 10
!
interface r1-eth2
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 priority 10
!
router ospf6
ospf6 router-id 192.168.0.1
log-adjacency-changes
interface r1-lo area 0.0.0.0
interface r1-eth1 area 0.0.0.0
interface r1-eth2 area 0.0.0.0
!
line vty
!
6 changes: 3 additions & 3 deletions tests/topotests/bgp_features/r2/ospf6d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ log file ospf6d.log
! debug ospf6 neighbor
!
interface r2-lo
ipv6 ospf6 area 0.0.0.0
!
interface r2-eth1
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 priority 5
!
interface r2-eth2
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 priority 10
!
router ospf6
ospf6 router-id 192.168.0.2
log-adjacency-changes
interface r2-lo area 0.0.0.0
interface r2-eth1 area 0.0.0.0
interface r2-eth2 area 0.0.0.0
!
line vty
!
6 changes: 3 additions & 3 deletions tests/topotests/bgp_features/r3/ospf6d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ log file ospf6d.log
! debug ospf6 neighbor
!
interface r3-lo
ipv6 ospf6 area 0.0.0.0
!
interface r3-eth1
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 priority 5
!
interface r3-eth2
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 priority 5
!
router ospf6
ospf6 router-id 192.168.0.3
log-adjacency-changes
interface r3-lo area 0.0.0.0
interface r3-eth1 area 0.0.0.0
interface r3-eth2 area 0.0.0.0
!
line vty
!
4 changes: 2 additions & 2 deletions tests/topotests/ospf6_topo1/r1/ospf6d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ log file ospf6d.log
! debug ospf6 flooding
!
interface r1-stubnet
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 network broadcast
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 10
!
interface r1-sw5
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 network broadcast
ipv6 ospf6 hello-interval 2
ipv6 ospf6 dead-interval 10
Expand All @@ -23,8 +25,6 @@ router ospf6
ospf6 router-id 10.0.0.1
log-adjacency-changes detail
redistribute static
interface r1-stubnet area 0.0.0.0
interface r1-sw5 area 0.0.0.0
!
line vty
exec-timeout 0 0
Expand Down
Loading

0 comments on commit dabef02

Please sign in to comment.