From 3adfd850c723b812ae1a2aba55ebcf7e4efde345 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Tue, 10 Jul 2007 13:39:54 -0700 Subject: [PATCH] Initialize SPFCalculate --- src/routing/static-route-manager.cc | 35 +++++++++-------------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/src/routing/static-route-manager.cc b/src/routing/static-route-manager.cc index ed8c68c3d..888892b1c 100644 --- a/src/routing/static-route-manager.cc +++ b/src/routing/static-route-manager.cc @@ -225,36 +225,23 @@ StaticRouteManager::SPFCalculate(Ipv4Address root) // The SPFVertex objects may have state from a previous computation m_lsdb->Initialize(); + SPFVertex* v; - // Make a priority queue of int using a vector container - // priority_queue, less > pq; - //priority_queue, less > candidate; - /* - * struct pqueue* candidate; - * struct vertex* v; - */ + // Make a priority queue of int using a vector container + // priority_queue, less > pq; + // + //priority_queue candidate; + // // Initialize the shortest-path tree to only the router doing the // calculation. // + v= m_lsdb->GetVertex(root); + // Set LSA position to LSA_SPF_IN_SPFTREE. This vertex is the root of the + // spanning tree. + v->m_distanceFromRoot = 0; + v->m_stat = true; #if 0 - ospf_spf_init (area); - v = area->spf; - - - /* Create a new heap for the candidates. */ - candidate = pqueue_create(); - candidate->cmp = cmp; - candidate->update = update_stat; - - /* Set LSA position to LSA_SPF_IN_SPFTREE. This vertex is the root of the - * * spanning tree. */ - *(v->stat) = LSA_SPF_IN_SPFTREE; - - /* Set Area A's TransitCapability to FALSE. */ - area->transit = OSPF_TRANSIT_FALSE; - area->shortcut_capability = 1; - for (;;) { /* RFC2328 16.1. (2). */