Indentation
diff --git a/src/nlsr_dm.cpp b/src/nlsr_dm.cpp
index 1f3beab..8252423 100644
--- a/src/nlsr_dm.cpp
+++ b/src/nlsr_dm.cpp
@@ -6,76 +6,78 @@
#include "nlsr_tokenizer.hpp"
#include "nlsr_lsdb.hpp"
-namespace nlsr {
-
-using namespace std;
-using namespace ndn;
-
-void
-DataManager::processContent(Nlsr& pnlsr, const ndn::Interest &interest,
- const ndn::Data & data)
+namespace nlsr
{
- cout << "I: " << interest.toUri() << endl;
+ using namespace std;
+ using namespace ndn;
- string dataName(data.getName().toUri());
- string dataContent((char *)data.getContent().value());
-
- cout << "D: " << dataName << endl;
- cout << "Data Content: " << dataContent << endl;
+ void
+ DataManager::processContent(Nlsr& pnlsr, const ndn::Interest &interest,
+ const ndn::Data & data)
+ {
- nlsrTokenizer nt(dataName,"/");
- string chkString("info");
- if( nt.doesTokenExist(chkString) ){
- processContentInfo(pnlsr,dataName,dataContent);
- }
+ cout << "I: " << interest.toUri() << endl;
-}
+ string dataName(data.getName().toUri());
+ string dataContent((char *)data.getContent().value());
-void
-DataManager::processContentInfo(Nlsr& pnlsr, string& dataName,
- string& dataContent)
-{
- nlsrTokenizer nt(dataName,"/");
- string chkString("info");
- string neighbor="/" + nt.getFirstToken()
- +nt.getTokenString(0,nt.getTokenPosition(chkString)-1);
- int oldStatus=pnlsr.getAdl().getStatusOfNeighbor(neighbor);
- int infoIntTimedOutCount=pnlsr.getAdl().getTimedOutInterestCount(neighbor);
- //debugging purpose start
- cout <<"Before Updates: " <<endl;
- cout <<"Neighbor : "<<neighbor<<endl;
- cout<<"Status: "<< oldStatus << endl;
- cout<<"Info Interest Timed out: "<< infoIntTimedOutCount <<endl;
- //debugging purpose end
+ cout << "D: " << dataName << endl;
+ cout << "Data Content: " << dataContent << endl;
- pnlsr.getAdl().setStatusOfNeighbor(neighbor,1);
- pnlsr.getAdl().setTimedOutInterestCount(neighbor,0);
+ nlsrTokenizer nt(dataName,"/");
+ string chkString("info");
+ if( nt.doesTokenExist(chkString) )
+ {
+ processContentInfo(pnlsr,dataName,dataContent);
+ }
- int newStatus=pnlsr.getAdl().getStatusOfNeighbor(neighbor);
- infoIntTimedOutCount=pnlsr.getAdl().getTimedOutInterestCount(neighbor);
+ }
- //debugging purpose
- cout <<"After Updates: " <<endl;
- cout <<"Neighbor : "<<neighbor<<endl;
- cout<<"Status: "<< newStatus << endl;
- cout<<"Info Interest Timed out: "<< infoIntTimedOutCount <<endl;
- //debugging purpose end
+ void
+ DataManager::processContentInfo(Nlsr& pnlsr, string& dataName,
+ string& dataContent)
+ {
+ nlsrTokenizer nt(dataName,"/");
+ string chkString("info");
+ string neighbor="/" + nt.getFirstToken()
+ +nt.getTokenString(0,nt.getTokenPosition(chkString)-1);
+ int oldStatus=pnlsr.getAdl().getStatusOfNeighbor(neighbor);
+ int infoIntTimedOutCount=pnlsr.getAdl().getTimedOutInterestCount(neighbor);
+ //debugging purpose start
+ cout <<"Before Updates: " <<endl;
+ cout <<"Neighbor : "<<neighbor<<endl;
+ cout<<"Status: "<< oldStatus << endl;
+ cout<<"Info Interest Timed out: "<< infoIntTimedOutCount <<endl;
+ //debugging purpose end
- if ( ( oldStatus-newStatus)!= 0 ) // change in Adjacency list
- {
- pnlsr.incrementAdjBuildCount();
- /* Need to schedule event for Adjacency LSA building */
- if ( pnlsr.getIsBuildAdjLsaSheduled() == 0 )
- {
- pnlsr.setIsBuildAdjLsaSheduled(1);
- // event here
- pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(5),
- ndn::bind(&Lsdb::scheduledAdjLsaBuild, pnlsr.getLsdb(),
- boost::ref(pnlsr)));
- }
-
- }
-}
+ pnlsr.getAdl().setStatusOfNeighbor(neighbor,1);
+ pnlsr.getAdl().setTimedOutInterestCount(neighbor,0);
+
+ int newStatus=pnlsr.getAdl().getStatusOfNeighbor(neighbor);
+ infoIntTimedOutCount=pnlsr.getAdl().getTimedOutInterestCount(neighbor);
+
+ //debugging purpose
+ cout <<"After Updates: " <<endl;
+ cout <<"Neighbor : "<<neighbor<<endl;
+ cout<<"Status: "<< newStatus << endl;
+ cout<<"Info Interest Timed out: "<< infoIntTimedOutCount <<endl;
+ //debugging purpose end
+
+ if ( ( oldStatus-newStatus)!= 0 ) // change in Adjacency list
+ {
+ pnlsr.incrementAdjBuildCount();
+ /* Need to schedule event for Adjacency LSA building */
+ if ( pnlsr.getIsBuildAdjLsaSheduled() == 0 )
+ {
+ pnlsr.setIsBuildAdjLsaSheduled(1);
+ // event here
+ pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(5),
+ ndn::bind(&Lsdb::scheduledAdjLsaBuild, pnlsr.getLsdb(),
+ boost::ref(pnlsr)));
+ }
+
+ }
+ }
}//namespace nlsr