Schedule Adj LSA build and installation
diff --git a/nlsr_adl.cpp b/nlsr_adl.cpp
index 0cbdb4a..0f4be8f 100644
--- a/nlsr_adl.cpp
+++ b/nlsr_adl.cpp
@@ -3,6 +3,7 @@
#include "nlsr_adl.hpp"
#include "nlsr_adjacent.hpp"
+#include "nlsr.hpp"
Adl::Adl(){
}
@@ -151,6 +152,51 @@
return adjList;
}
+bool
+Adl::isAdjLsaBuildable(nlsr& pnlsr)
+{
+ int nbrCount=0;
+ for( std::list<Adjacent>::iterator it=adjList.begin();
+ it!= adjList.end() ; it++)
+ {
+ if ( ((*it).getStatus() == 1 ) )
+ {
+ nbrCount++;
+ }
+ else
+ {
+ if ( (*it).getInterestTimedOutNo() >=
+ pnlsr.getConfParameter().getInterestRetryNumber())
+ {
+ nbrCount++;
+ }
+ }
+ }
+
+ if( nbrCount == adjList.size())
+ {
+ return true;
+ }
+
+ return false;
+}
+
+int
+Adl::getNumOfActiveNeighbor()
+{
+ int actNbrCount=0;
+ for( std::list<Adjacent>::iterator it=adjList.begin();
+ it!= adjList.end() ; it++)
+ {
+ if ( ((*it).getStatus() == 1 ) )
+ {
+ actNbrCount++;
+ }
+ }
+
+ return actNbrCount;
+}
+
// used for debugging purpose
void
Adl::printAdl(){