2003-03-25 Paul Jakma <paul@dishone.st>
* sync to latest zebra CVS
* spec file: updated and added define for ospf-api/client
NB: OSPF-API has been broken by the zebra.org changes, which
has added struct ospf * as a new arg to many functions
diff --git a/ospfd/ospf_neighbor.c b/ospfd/ospf_neighbor.c
index a302aa9..ccef055 100644
--- a/ospfd/ospf_neighbor.c
+++ b/ospfd/ospf_neighbor.c
@@ -202,20 +202,15 @@
/* Get neighbor count by status.
Specify status = 0, get all neighbor other than myself. */
int
-ospf_nbr_count (struct route_table *nbrs, int state)
+ospf_nbr_count (struct ospf_interface *oi, int state)
{
- struct route_node *rn;
struct ospf_neighbor *nbr;
+ struct route_node *rn;
int count = 0;
- /* Sanity check. */
- if (nbrs == NULL)
- return 0;
-
- for (rn = route_top (nbrs); rn; rn = route_next (rn))
- if ((nbr = rn->info) != NULL)
- /* Ignore myself. */
- if (!IPV4_ADDR_SAME (&nbr->router_id, &ospf_top->router_id))
+ for (rn = route_top (oi->nbrs); rn; rn = route_next (rn))
+ if ((nbr = rn->info))
+ if (!IPV4_ADDR_SAME (&nbr->router_id, &oi->ospf->router_id))
if (state == 0 || nbr->state == state)
count++;
@@ -224,23 +219,18 @@
#ifdef HAVE_OPAQUE_LSA
int
-ospf_opaque_capable_nbr_count (struct route_table *nbrs, int state)
+ospf_nbr_count_opaque_capable (struct ospf_interface *oi)
{
- struct route_node *rn;
struct ospf_neighbor *nbr;
+ struct route_node *rn;
int count = 0;
- /* Sanity check. */
- if (nbrs == NULL)
- return 0;
-
- for (rn = route_top (nbrs); rn; rn = route_next (rn))
- if ((nbr = rn->info) != NULL)
- /* Ignore myself. */
- if (!IPV4_ADDR_SAME (&nbr->router_id, &ospf_top->router_id))
- if ((state == 0 || nbr->state == state)
- && CHECK_FLAG (nbr->options, OSPF_OPTION_O))
- count++;
+ for (rn = route_top (oi->nbrs); rn; rn = route_next (rn))
+ if ((nbr = rn->info))
+ if (!IPV4_ADDR_SAME (&nbr->router_id, &oi->ospf->router_id))
+ if (nbr->state == NSM_Full)
+ if (CHECK_FLAG (nbr->options, OSPF_OPTION_O))
+ count++;
return count;
}