--- a/src/routing/static-route-manager.cc Wed Jul 11 22:37:48 2007 -0700
+++ b/src/routing/static-route-manager.cc Wed Jul 11 22:54:47 2007 -0700
@@ -36,9 +36,17 @@
{
}
+SPFVertex::SPFVertex (StaticRouterLSA* lsa) :
+ m_vertexType(VertexRouter),
+ m_vertexId(lsa->m_linkStateId),
+ m_lsa(lsa),
+ m_distanceFromRoot(SPF_INFINITY)
+{
+}
+
+
SPFVertex::~SPFVertex ()
{
- delete m_lsa;
}
void
@@ -320,12 +328,8 @@
// Initialize the shortest-path tree to only the router doing the
// calculation.
//
- v= new SPFVertex();
- v->m_vertexType = SPFVertex::VertexRouter;
- v->m_vertexId = root;
- v-> m_lsa = m_lsdb->GetLSA(root);
- // Set LSA position to LSA_SPF_IN_SPFTREE. This vertex is the root of the
- // spanning tree.
+ v= new SPFVertex(m_lsdb->GetLSA(root));
+ // This vertex is the root of the SPF tree
v->m_distanceFromRoot = 0;
for (;;)
--- a/src/routing/static-route-manager.h Wed Jul 11 22:37:48 2007 -0700
+++ b/src/routing/static-route-manager.h Wed Jul 11 22:54:47 2007 -0700
@@ -40,6 +40,7 @@
{
public:
SPFVertex();
+ SPFVertex(StaticRouterLSA*);
~SPFVertex();
void Initialize ();