summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6d.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6d.c')
-rw-r--r--ospf6d/ospf6d.c134
1 files changed, 44 insertions, 90 deletions
diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c
index d10d1df6..e8fba97d 100644
--- a/ospf6d/ospf6d.c
+++ b/ospf6d/ospf6d.c
@@ -187,19 +187,16 @@ DEFUN (show_ipv6_ospf6_database,
level = parse_show_level (argc, argv);
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb);
}
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb);
@@ -262,21 +259,18 @@ DEFUN (show_ipv6_ospf6_database_type,
switch (OSPF6_LSA_SCOPE (type))
{
case OSPF6_SCOPE_AREA:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb);
}
break;
case OSPF6_SCOPE_LINKLOCAL:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb);
@@ -353,19 +347,16 @@ DEFUN (show_ipv6_ospf6_database_id,
argv++;
level = parse_show_level (argc, argv);
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb);
}
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb);
@@ -452,19 +443,16 @@ DEFUN (show_ipv6_ospf6_database_router,
argv++;
level = parse_show_level (argc, argv);
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
}
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
@@ -569,21 +557,18 @@ DEFUN (show_ipv6_ospf6_database_type_id,
switch (OSPF6_LSA_SCOPE (type))
{
case OSPF6_SCOPE_AREA:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb);
}
break;
case OSPF6_SCOPE_LINKLOCAL:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb);
@@ -728,21 +713,18 @@ DEFUN (show_ipv6_ospf6_database_type_router,
switch (OSPF6_LSA_SCOPE (type))
{
case OSPF6_SCOPE_AREA:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
}
break;
case OSPF6_SCOPE_LINKLOCAL:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
@@ -881,19 +863,16 @@ DEFUN (show_ipv6_ospf6_database_id_router,
argv++;
level = parse_show_level (argc, argv);
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
}
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
@@ -967,19 +946,16 @@ DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id,
argv++;
level = parse_show_level (argc, argv);
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
}
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
@@ -1071,21 +1047,18 @@ DEFUN (show_ipv6_ospf6_database_type_id_router,
switch (OSPF6_LSA_SCOPE (type))
{
case OSPF6_SCOPE_AREA:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
}
break;
case OSPF6_SCOPE_LINKLOCAL:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
@@ -1196,21 +1169,18 @@ DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
switch (OSPF6_LSA_SCOPE (type))
{
case OSPF6_SCOPE_AREA:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
}
break;
case OSPF6_SCOPE_LINKLOCAL:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
@@ -1282,19 +1252,16 @@ DEFUN (show_ipv6_ospf6_database_self_originated,
adv_router = o->router_id;
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
}
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
@@ -1362,21 +1329,18 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated,
switch (OSPF6_LSA_SCOPE (type))
{
case OSPF6_SCOPE_AREA:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
}
break;
case OSPF6_SCOPE_LINKLOCAL:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
@@ -1478,21 +1442,18 @@ DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
switch (OSPF6_LSA_SCOPE (type))
{
case OSPF6_SCOPE_AREA:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
}
break;
case OSPF6_SCOPE_LINKLOCAL:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
@@ -1594,21 +1555,18 @@ DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
switch (OSPF6_LSA_SCOPE (type))
{
case OSPF6_SCOPE_AREA:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
}
break;
case OSPF6_SCOPE_LINKLOCAL:
- for (i = listhead (o->area_list); i; nextnode (i))
+ for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
- oa = (struct ospf6_area *) getdata (i);
- for (j = listhead (oa->if_list); j; nextnode (j))
+ for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
{
- oi = (struct ospf6_interface *) getdata (j);
vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
oi->interface->name, oa->name, VNL, VNL);
ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
@@ -1730,10 +1688,8 @@ DEFUN (show_ipv6_ospf6_linkstate,
struct listnode *node;
struct ospf6_area *oa;
- for (node = listhead (ospf6->area_list); node; nextnode (node))
+ for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
{
- oa = OSPF6_AREA (getdata (node));
-
vty_out (vty, "%s SPF Result in Area %s%s%s",
VNL, oa->name, VNL, VNL);
ospf6_linkstate_table_show (vty, argc, argv, oa->spf_table);
@@ -1787,10 +1743,8 @@ DEFUN (show_ipv6_ospf6_linkstate_detail,
sargv[sargc++] = "detail";
sargv[sargc] = NULL;
- for (node = listhead (ospf6->area_list); node; nextnode (node))
+ for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
{
- oa = OSPF6_AREA (getdata (node));
-
vty_out (vty, "%s SPF Result in Area %s%s%s",
VNL, oa->name, VNL, VNL);
ospf6_linkstate_table_show (vty, sargc, sargv, oa->spf_table);