diff --git a/src/routing/static-route-manager.cc b/src/routing/static-route-manager.cc index 867baeadd..b7bb13f3f 100644 --- a/src/routing/static-route-manager.cc +++ b/src/routing/static-route-manager.cc @@ -15,6 +15,7 @@ */ #include #include +#include #include "ns3/assert.h" #include "ns3/fatal-error.h" #include "ns3/debug.h" @@ -26,6 +27,15 @@ NS_DEBUG_COMPONENT_DEFINE ("StaticRouteManager"); namespace ns3 { +SPFVertex::SPFVertex () : + m_vertexType(VertexUnknown), + m_vertexId("255.255.255.255"), + m_lsa(0), + m_distanceFromRoot(SPF_INFINITY), + m_stat(false) +{ +} + SPFVertex::~SPFVertex () { delete m_lsa; @@ -191,6 +201,9 @@ void StaticRouteManager::SPFCalculate(Ipv4Address root) { NS_DEBUG("StaticRouteManager::SPFCalculate ()"); + // Make a priority queue of int using a vector container + // priority_queue, less > pq; + //priority_queue, less > candidate; /* * struct pqueue* candidate; * struct vertex* v; diff --git a/src/routing/static-route-manager.h b/src/routing/static-route-manager.h index 6e0ac608f..861da5c13 100644 --- a/src/routing/static-route-manager.h +++ b/src/routing/static-route-manager.h @@ -26,6 +26,8 @@ namespace ns3 { +const uint32_t SPF_INFINITY = 0xffffffff; + /** * \brief Vertex used in shortest path first (SPF) computations * @@ -34,10 +36,12 @@ namespace ns3 { class SPFVertex { public: + SPFVertex(); ~SPFVertex(); enum VertexType { - VertexRouter = 1, + VertexUnknown = 0, + VertexRouter, VertexNetwork } m_vertexType; @@ -51,6 +55,8 @@ public: type_listOfSPFVertex::iterator m_iter; uint32_t m_distanceFromRoot; + + bool m_stat; // true if LSA is in SPF tree already }; /**