Changing class name nlsr to Nlsr
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index 444063a..a8b1cb8 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -18,7 +18,7 @@
using namespace std;
void
-nlsr::nlsrRegistrationFailed(const ndn::Name& name)
+Nlsr::nlsrRegistrationFailed(const ndn::Name& name)
{
cerr << "ERROR: Failed to register prefix in local hub's daemon" << endl;
getNlsrFace().shutdown();
@@ -26,23 +26,23 @@
void
-nlsr::setInterestFilterNlsr(const string& name)
+Nlsr::setInterestFilterNlsr(const string& name)
{
getNlsrFace().setInterestFilter(name,
func_lib::bind(&interestManager::processInterest, &im,
boost::ref(*this), _1, _2),
- func_lib::bind(&nlsr::nlsrRegistrationFailed, this, _1));
+ func_lib::bind(&Nlsr::nlsrRegistrationFailed, this, _1));
}
void
-nlsr::startEventLoop()
+Nlsr::startEventLoop()
{
getNlsrFace().processEvents();
}
int
-nlsr::usage(const string& progname)
+Nlsr::usage(const string& progname)
{
cout << "Usage: " << progname << " [OPTIONS...]"<<endl;
@@ -57,76 +57,76 @@
int
main(int argc, char **argv){
- nlsr nlsr;
+ Nlsr nlsr_;
string programName(argv[0]);
- nlsr.setConfFileName("nlsr.conf");
+ nlsr_.setConfFileName("nlsr.conf");
int opt;
while ((opt = getopt(argc, argv, "df:p:h")) != -1) {
switch (opt) {
case 'f':
- nlsr.setConfFileName(optarg);
+ nlsr_.setConfFileName(optarg);
break;
case 'd':
- nlsr.setIsDaemonProcess(optarg);
+ nlsr_.setIsDaemonProcess(optarg);
break;
case 'p':
{
stringstream sst(optarg);
int ap;
sst>>ap;
- nlsr.setApiPort(ap);
+ nlsr_.setApiPort(ap);
}
break;
case 'h':
default:
- nlsr.usage(programName);
+ nlsr_.usage(programName);
return EXIT_FAILURE;
}
}
- ConfFileProcessor cfp(nlsr.getConfFileName());
- int res=cfp.processConfFile(nlsr);
+ ConfFileProcessor cfp(nlsr_.getConfFileName());
+ int res=cfp.processConfFile(nlsr_);
if ( res < 0 )
{
return EXIT_FAILURE;
}
- nlsr.getConfParameter().buildRouterPrefix();
- nlsr.getNlsrLogger().initNlsrLogger(nlsr.getConfParameter().getLogDir());
+ nlsr_.getConfParameter().buildRouterPrefix();
+ nlsr_.getNlsrLogger().initNlsrLogger(nlsr_.getConfParameter().getLogDir());
//src::logger lg;
//BOOST_LOG(lg) << "Some log record from nlsr.cpp";
//for(int j=0; j< 1000; j++)
//{
// BOOST_LOG(lg) << "Some log record from nlsr.cpp "<<j;
//}
- nlsr.getLsdb().setLsaRefreshTime(nlsr.getConfParameter().getLsaRefreshTime());
- nlsr.getFib().setFibEntryRefreshTime(2*nlsr.getConfParameter().getLsaRefreshTime());
- nlsr.getLsdb().setThisRouterPrefix(nlsr.getConfParameter().getRouterPrefix());
+ nlsr_.getLsdb().setLsaRefreshTime(nlsr_.getConfParameter().getLsaRefreshTime());
+ nlsr_.getFib().setFibEntryRefreshTime(2*nlsr_.getConfParameter().getLsaRefreshTime());
+ nlsr_.getLsdb().setThisRouterPrefix(nlsr_.getConfParameter().getRouterPrefix());
/* debugging purpose start */
- cout << nlsr.getConfParameter();
- nlsr.getAdl().printAdl();
- nlsr.getNpl().printNpl();
+ cout << nlsr_.getConfParameter();
+ nlsr_.getAdl().printAdl();
+ nlsr_.getNpl().printNpl();
/* debugging purpose end */
- nlsr.getLsdb().buildAndInstallOwnNameLsa(nlsr);
- nlsr.getLsdb().buildAndInstallOwnCorLsa(nlsr);
+ nlsr_.getLsdb().buildAndInstallOwnNameLsa(nlsr_);
+ nlsr_.getLsdb().buildAndInstallOwnCorLsa(nlsr_);
- nlsr.setInterestFilterNlsr(nlsr.getConfParameter().getRouterPrefix());
- nlsr.getIm().scheduleInfoInterest(nlsr,1);
+ nlsr_.setInterestFilterNlsr(nlsr_.getConfParameter().getRouterPrefix());
+ nlsr_.getIm().scheduleInfoInterest(nlsr_,1);
//testing purpose
- nlsr.getNlsrTesting().schedlueAddingLsas(nlsr);
+ nlsr_.getNlsrTesting().schedlueAddingLsas(nlsr_);
try{
- nlsr.startEventLoop();
+ nlsr_.startEventLoop();
}catch(std::exception &e) {
std::cerr << "ERROR: " << e.what() << std::endl;
}
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index 31655f4..5762916 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -24,10 +24,10 @@
using namespace ndn;
using namespace std;
-class nlsr
+class Nlsr
{
public:
- nlsr()
+ Nlsr()
: io(ndn::make_shared<boost::asio::io_service>())
, nlsrFace(io)
, scheduler(*io)
@@ -164,7 +164,7 @@
isBuildAdjLsaSheduled=iabls;
}
- nlsrTest& getNlsrTesting()
+ NlsrTest& getNlsrTesting()
{
return nlsrTesting;
}
@@ -230,7 +230,7 @@
int isRouteCalculationScheduled;
int isRoutingTableCalculating;
- nlsrTest nlsrTesting;
+ NlsrTest nlsrTesting;
};
diff --git a/src/nlsr_adl.cpp b/src/nlsr_adl.cpp
index eaf0699..ff05695 100644
--- a/src/nlsr_adl.cpp
+++ b/src/nlsr_adl.cpp
@@ -211,7 +211,7 @@
}
bool
-Adl::isAdjLsaBuildable(nlsr& pnlsr)
+Adl::isAdjLsaBuildable(Nlsr& pnlsr)
{
int nbrCount=0;
for( std::list<Adjacent>::iterator it=adjList.begin();
diff --git a/src/nlsr_adl.hpp b/src/nlsr_adl.hpp
index 0d868ae..a655013 100644
--- a/src/nlsr_adl.hpp
+++ b/src/nlsr_adl.hpp
@@ -5,7 +5,7 @@
#include "nlsr_adjacent.hpp"
#include<list>
-class nlsr;
+class Nlsr;
using namespace std;
@@ -26,7 +26,7 @@
void setTimedOutInterestCount(string& neighbor, int count);
void addAdjacentsFromAdl(Adl& adl);
- bool isAdjLsaBuildable(nlsr& pnlsr);
+ bool isAdjLsaBuildable(Nlsr& pnlsr);
int getNumOfActiveNeighbor();
Adjacent getAdjacent(string adjName);
diff --git a/src/nlsr_conf_processor.cpp b/src/nlsr_conf_processor.cpp
index 939aa56..86fadac 100644
--- a/src/nlsr_conf_processor.cpp
+++ b/src/nlsr_conf_processor.cpp
@@ -13,7 +13,7 @@
using namespace std;
int
-ConfFileProcessor::processConfFile(nlsr& pnlsr){
+ConfFileProcessor::processConfFile(Nlsr& pnlsr){
int ret=0;
if ( !confFileName.empty()){
@@ -42,7 +42,7 @@
int
-ConfFileProcessor::processConfCommand(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommand(Nlsr& pnlsr, string command){
int ret=0;
nlsrTokenizer nt(command," ");
if( (nt.getFirstToken() == "network")){
@@ -104,7 +104,7 @@
}
int
-ConfFileProcessor::processConfCommandNetwork(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandNetwork(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Network can not be null or empty :( !"<<endl;
return -1;
@@ -121,7 +121,7 @@
}
int
-ConfFileProcessor::processConfCommandSiteName(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandSiteName(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<"Site name can not be null or empty :( !"<<endl;
return -1;
@@ -138,7 +138,7 @@
}
int
-ConfFileProcessor::processConfCommandRouterName(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandRouterName(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Router name can not be null or empty :( !"<<endl;
return -1;
@@ -155,7 +155,7 @@
}
int
-ConfFileProcessor::processConfCommandInterestRetryNumber(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandInterestRetryNumber(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [interest-retry-num n]"<<endl;
}else{
@@ -170,7 +170,7 @@
}
int
-ConfFileProcessor::processConfCommandInterestResendTime(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandInterestResendTime(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [interest-resend-time s]"<<endl;
}else{
@@ -185,7 +185,7 @@
}
int
-ConfFileProcessor::processConfCommandLsaRefreshTime(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandLsaRefreshTime(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [interest-resend-time s]"<<endl;
}else{
@@ -200,7 +200,7 @@
}
int
-ConfFileProcessor::processConfCommandMaxFacesPerPrefix(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandMaxFacesPerPrefix(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [max-faces-per-prefix n]"<<endl;
}else{
@@ -215,7 +215,7 @@
}
int
-ConfFileProcessor::processConfCommandTunnelType(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandTunnelType(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [tunnel-type tcp/udp]!"<<endl;
}else{
@@ -232,7 +232,7 @@
}
int
-ConfFileProcessor::processConfCommandChronosyncSyncPrefix(nlsr& pnlsr,
+ConfFileProcessor::processConfCommandChronosyncSyncPrefix(Nlsr& pnlsr,
string command){
if(command.empty() ){
cerr <<" Wrong command format ! [chronosync-sync-prefix name/prefix]!"<<endl;
@@ -244,7 +244,7 @@
int
-ConfFileProcessor::processConfCommandLogDir(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandLogDir(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [log-dir /path/to/log/dir]!"<<endl;
}else{
@@ -254,7 +254,7 @@
}
int
-ConfFileProcessor::processConfCommandDebugging(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandDebugging(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [debugging on/of]!"<<endl;
}else{
@@ -271,7 +271,7 @@
}
int
-ConfFileProcessor::processConfCommandDetailedLogging(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandDetailedLogging(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [detailed-logging on/off]!"<<endl;
}else{
@@ -288,7 +288,7 @@
}
int
-ConfFileProcessor::processConfCommandIsHyperbolicCalc(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandIsHyperbolicCalc(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [hyperbolic-routing on/off/dry-run]!"<<endl;
}else{
@@ -308,7 +308,7 @@
}
int
-ConfFileProcessor::processConfCommandHyperbolicCordinate(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandHyperbolicCordinate(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [hyperbolic-cordinate r 0]!"<<endl;
if (pnlsr.getConfParameter().getIsHyperbolicCalc() > 0 ){
@@ -331,7 +331,7 @@
int
-ConfFileProcessor::processConfCommandNdnNeighbor(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandNdnNeighbor(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [ndnneighbor /nbr/name/ FaceId]!"<<endl;
}else{
@@ -354,7 +354,7 @@
}
int
-ConfFileProcessor::processConfCommandNdnName(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandNdnName(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [ndnname name/prefix]!"<<endl;
}else{
@@ -365,7 +365,7 @@
int
-ConfFileProcessor::processConfCommandLinkCost(nlsr& pnlsr, string command){
+ConfFileProcessor::processConfCommandLinkCost(Nlsr& pnlsr, string command){
if(command.empty() ){
cerr <<" Wrong command format ! [link-cost nbr/name cost]!"<<endl;
if (pnlsr.getConfParameter().getIsHyperbolicCalc() > 0 ){
diff --git a/src/nlsr_conf_processor.hpp b/src/nlsr_conf_processor.hpp
index 1a1ff8a..32b1cfb 100644
--- a/src/nlsr_conf_processor.hpp
+++ b/src/nlsr_conf_processor.hpp
@@ -15,28 +15,28 @@
confFileName=cfile;
}
- int processConfFile(nlsr& pnlsr);
- int processConfCommand(nlsr& pnlsr, string command);
- int processConfCommandNetwork(nlsr& pnlsr, string command);
- int processConfCommandSiteName(nlsr& pnlsr, string command);
- int processConfCommandRouterName(nlsr& pnlsr, string command);
- int processConfCommandInterestRetryNumber(nlsr& pnlsr, string command);
- int processConfCommandInterestResendTime(nlsr& pnlsr, string command);
- int processConfCommandLsaRefreshTime(nlsr& pnlsr, string command);
- int processConfCommandMaxFacesPerPrefix(nlsr& pnlsr, string command);
- int processConfCommandTunnelType(nlsr& pnlsr, string command);
+ int processConfFile(Nlsr& pnlsr);
+ int processConfCommand(Nlsr& pnlsr, string command);
+ int processConfCommandNetwork(Nlsr& pnlsr, string command);
+ int processConfCommandSiteName(Nlsr& pnlsr, string command);
+ int processConfCommandRouterName(Nlsr& pnlsr, string command);
+ int processConfCommandInterestRetryNumber(Nlsr& pnlsr, string command);
+ int processConfCommandInterestResendTime(Nlsr& pnlsr, string command);
+ int processConfCommandLsaRefreshTime(Nlsr& pnlsr, string command);
+ int processConfCommandMaxFacesPerPrefix(Nlsr& pnlsr, string command);
+ int processConfCommandTunnelType(Nlsr& pnlsr, string command);
- int processConfCommandChronosyncSyncPrefix(nlsr& pnlsr, string command);
- int processConfCommandLogDir(nlsr& pnlsr, string command);
- int processConfCommandDebugging(nlsr& pnlsr, string command);
- int processConfCommandDetailedLogging(nlsr& pnlsr, string command);
- int processConfCommandIsHyperbolicCalc(nlsr& pnlsr, string command);
+ int processConfCommandChronosyncSyncPrefix(Nlsr& pnlsr, string command);
+ int processConfCommandLogDir(Nlsr& pnlsr, string command);
+ int processConfCommandDebugging(Nlsr& pnlsr, string command);
+ int processConfCommandDetailedLogging(Nlsr& pnlsr, string command);
+ int processConfCommandIsHyperbolicCalc(Nlsr& pnlsr, string command);
- int processConfCommandHyperbolicCordinate(nlsr& pnlsr, string command);
+ int processConfCommandHyperbolicCordinate(Nlsr& pnlsr, string command);
- int processConfCommandNdnNeighbor(nlsr& pnlsr, string command);
- int processConfCommandNdnName(nlsr& pnlsr, string command);
- int processConfCommandLinkCost(nlsr& pnlsr, string command);
+ int processConfCommandNdnNeighbor(Nlsr& pnlsr, string command);
+ int processConfCommandNdnName(Nlsr& pnlsr, string command);
+ int processConfCommandLinkCost(Nlsr& pnlsr, string command);
private:
diff --git a/src/nlsr_dm.cpp b/src/nlsr_dm.cpp
index 46b278d..a076815 100644
--- a/src/nlsr_dm.cpp
+++ b/src/nlsr_dm.cpp
@@ -12,7 +12,7 @@
using namespace ndn;
void
-DataManager::processContent(nlsr& pnlsr, const ndn::Interest &interest,
+DataManager::processContent(Nlsr& pnlsr, const ndn::Interest &interest,
const ndn::Data & data)
{
@@ -33,7 +33,7 @@
}
void
-DataManager::processContentInfo(nlsr& pnlsr, string& dataName,
+DataManager::processContentInfo(Nlsr& pnlsr, string& dataName,
string& dataContent)
{
nlsrTokenizer nt(dataName,"/");
diff --git a/src/nlsr_dm.hpp b/src/nlsr_dm.hpp
index 923d2fa..c12c429 100644
--- a/src/nlsr_dm.hpp
+++ b/src/nlsr_dm.hpp
@@ -9,14 +9,14 @@
using namespace ndn;
using namespace std;
-class nlsr;
+class Nlsr;
class DataManager
{
public:
- void processContent(nlsr& pnlsr, const ndn::Interest &interest,
+ void processContent(Nlsr& pnlsr, const ndn::Interest &interest,
const ndn::Data& data);
- void processContentInfo(nlsr& pnlsr, string& dataName,
+ void processContentInfo(Nlsr& pnlsr, string& dataName,
string& dataContent);
private:
diff --git a/src/nlsr_fib.cpp b/src/nlsr_fib.cpp
index fd4b209..776e2d6 100644
--- a/src/nlsr_fib.cpp
+++ b/src/nlsr_fib.cpp
@@ -14,14 +14,14 @@
}
void
-Fib::cancelScheduledFeExpiringEvent(nlsr& pnlsr, EventId eid)
+Fib::cancelScheduledFeExpiringEvent(Nlsr& pnlsr, EventId eid)
{
pnlsr.getScheduler().cancelEvent(eid);
}
ndn::EventId
-Fib::scheduleFibEntryRefreshing(nlsr& pnlsr, string name, int feSeqNum, int refreshTime)
+Fib::scheduleFibEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum, int refreshTime)
{
return pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(refreshTime),
ndn::bind(&Fib::refreshFibEntry,this,name,feSeqNum));
@@ -34,7 +34,7 @@
}
void
-Fib::removeFromFib(nlsr& pnlsr, string name)
+Fib::removeFromFib(Nlsr& pnlsr, string name)
{
std::list<FibEntry >::iterator it = std::find_if( fibTable.begin(),
fibTable.end(), bind(&fibEntryNameCompare, _1, name));
@@ -52,7 +52,7 @@
void
-Fib::updateFib(nlsr& pnlsr,string name, Nhl& nextHopList, int maxFacesPerPrefix)
+Fib::updateFib(Nlsr& pnlsr,string name, Nhl& nextHopList, int maxFacesPerPrefix)
{
int startFace=0;
int endFace=getNumberOfFacesForName(nextHopList,maxFacesPerPrefix);
@@ -106,7 +106,7 @@
-void Fib::cleanFib(nlsr& pnlsr)
+void Fib::cleanFib(Nlsr& pnlsr)
{
for( std::list<FibEntry >::iterator it=fibTable.begin(); it != fibTable.end();
++it)
diff --git a/src/nlsr_fib.hpp b/src/nlsr_fib.hpp
index d02d040..452e669 100644
--- a/src/nlsr_fib.hpp
+++ b/src/nlsr_fib.hpp
@@ -4,7 +4,7 @@
#include <list>
#include "nlsr_fe.hpp"
-class nlsr;
+class Nlsr;
using namespace std;
using namespace ndn;
@@ -16,9 +16,9 @@
{
}
- void removeFromFib(nlsr& pnlsr, string name);
- void updateFib(nlsr& pnlsr, string name, Nhl& nextHopList, int maxFacesPerPrefix);
- void cleanFib(nlsr& pnlsr);
+ void removeFromFib(Nlsr& pnlsr, string name);
+ void updateFib(Nlsr& pnlsr, string name, Nhl& nextHopList, int maxFacesPerPrefix);
+ void cleanFib(Nlsr& pnlsr);
void setFibEntryRefreshTime(int fert)
{
fibEntryRefreshTime=fert;
@@ -30,8 +30,8 @@
void removeFibEntryHop(Nhl& nl, int doNotRemoveHopFaceId);
int getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix);
ndn::EventId
- scheduleFibEntryRefreshing(nlsr& pnlsr, string name, int feSeqNum, int refreshTime);
- void cancelScheduledFeExpiringEvent(nlsr& pnlsr, EventId eid);
+ scheduleFibEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum, int refreshTime);
+ void cancelScheduledFeExpiringEvent(Nlsr& pnlsr, EventId eid);
void refreshFibEntry(string name, int feSeqNum);
private:
diff --git a/src/nlsr_im.cpp b/src/nlsr_im.cpp
index 886aca8..3609a0b 100644
--- a/src/nlsr_im.cpp
+++ b/src/nlsr_im.cpp
@@ -13,7 +13,7 @@
using namespace ndn;
void
-interestManager::processInterest( nlsr& pnlsr,
+interestManager::processInterest( Nlsr& pnlsr,
const ndn::Name &name,
const ndn::Interest &interest)
{
@@ -38,7 +38,7 @@
}
void
-interestManager::processInterestInfo(nlsr& pnlsr, string& neighbor,
+interestManager::processInterestInfo(Nlsr& pnlsr, string& neighbor,
const ndn::Interest &interest)
{
if ( pnlsr.getAdl().isNeighbor(neighbor) )
@@ -62,7 +62,7 @@
}
void
-interestManager::processInterestTimedOut(nlsr& pnlsr,
+interestManager::processInterestTimedOut(Nlsr& pnlsr,
const ndn::Interest &interest)
{
cout << "Timed out interest : " << interest.getName().toUri() << endl;
@@ -78,7 +78,7 @@
}
void
-interestManager::processInterestTimedOutInfo(nlsr& pnlsr, string& neighbor,
+interestManager::processInterestTimedOutInfo(Nlsr& pnlsr, string& neighbor,
const ndn::Interest &interest)
{
pnlsr.getAdl().incrementTimedOutInterestCount(neighbor);
@@ -113,7 +113,7 @@
}
void
-interestManager::expressInterest(nlsr& pnlsr,const string& interestNamePrefix,
+interestManager::expressInterest(Nlsr& pnlsr,const string& interestNamePrefix,
int scope, int seconds)
{
Interest i((ndn::Name(interestNamePrefix)));
@@ -130,7 +130,7 @@
void
-interestManager::sendScheduledInfoInterest(nlsr& pnlsr, int seconds)
+interestManager::sendScheduledInfoInterest(Nlsr& pnlsr, int seconds)
{
std::list<Adjacent> adjList=pnlsr.getAdl().getAdjList();
for(std::list<Adjacent>::iterator it=adjList.begin(); it!=adjList.end();++it)
@@ -145,7 +145,7 @@
}
void
-interestManager::scheduleInfoInterest(nlsr& pnlsr, int seconds)
+interestManager::scheduleInfoInterest(Nlsr& pnlsr, int seconds)
{
EventId eid=pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(seconds),
ndn::bind(&interestManager::sendScheduledInfoInterest, this,
diff --git a/src/nlsr_im.hpp b/src/nlsr_im.hpp
index 6e71500..5e2f6c4 100644
--- a/src/nlsr_im.hpp
+++ b/src/nlsr_im.hpp
@@ -9,24 +9,24 @@
using namespace ndn;
using namespace std;
-class nlsr;
+class Nlsr;
class interestManager{
public:
interestManager()
{
}
- void processInterest(nlsr& pnlsr, const ndn::Name &name,
+ void processInterest(Nlsr& pnlsr, const ndn::Name &name,
const ndn::Interest &interest);
- void processInterestInfo(nlsr& pnlsr, string& neighbor,
+ void processInterestInfo(Nlsr& pnlsr, string& neighbor,
const ndn::Interest &interest);
- void processInterestTimedOut(nlsr& pnlsr, const ndn::Interest &interest);
- void processInterestTimedOutInfo(nlsr& pnlsr, string& neighbor,
+ void processInterestTimedOut(Nlsr& pnlsr, const ndn::Interest &interest);
+ void processInterestTimedOutInfo(Nlsr& pnlsr, string& neighbor,
const ndn::Interest &interest);
- void expressInterest(nlsr& pnlsr,const string& interestNamePrefix, int scope,
+ void expressInterest(Nlsr& pnlsr,const string& interestNamePrefix, int scope,
int seconds);
- void sendScheduledInfoInterest(nlsr& pnlsr, int seconds);
- void scheduleInfoInterest(nlsr& pnlsr, int seconds);
+ void sendScheduledInfoInterest(Nlsr& pnlsr, int seconds);
+ void scheduleInfoInterest(Nlsr& pnlsr, int seconds);
private:
diff --git a/src/nlsr_lsa.cpp b/src/nlsr_lsa.cpp
index 6eebb16..0a6e7e4 100644
--- a/src/nlsr_lsa.cpp
+++ b/src/nlsr_lsa.cpp
@@ -193,7 +193,7 @@
void
-AdjLsa::addNptEntriesForAdjLsa(nlsr& pnlsr)
+AdjLsa::addNptEntriesForAdjLsa(Nlsr& pnlsr)
{
if ( getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
{
@@ -204,7 +204,7 @@
void
-AdjLsa::removeNptEntriesForAdjLsa(nlsr& pnlsr)
+AdjLsa::removeNptEntriesForAdjLsa(Nlsr& pnlsr)
{
if ( getOrigRouter() !=pnlsr.getConfParameter().getRouterPrefix() )
{
diff --git a/src/nlsr_lsa.hpp b/src/nlsr_lsa.hpp
index b80d5a9..d06cc3c 100644
--- a/src/nlsr_lsa.hpp
+++ b/src/nlsr_lsa.hpp
@@ -143,8 +143,8 @@
}
bool isLsaContentEqual(AdjLsa& alsa);
- void addNptEntriesForAdjLsa(nlsr& pnlsr);
- void removeNptEntriesForAdjLsa(nlsr& pnlsr);
+ void addNptEntriesForAdjLsa(Nlsr& pnlsr);
+ void removeNptEntriesForAdjLsa(Nlsr& pnlsr);
private:
uint32_t noLink;
diff --git a/src/nlsr_lsdb.cpp b/src/nlsr_lsdb.cpp
index de1343a..08d0a96 100644
--- a/src/nlsr_lsdb.cpp
+++ b/src/nlsr_lsdb.cpp
@@ -6,7 +6,7 @@
using namespace std;
void
-Lsdb::cancelScheduleLsaExpiringEvent(nlsr& pnlsr, EventId eid)
+Lsdb::cancelScheduleLsaExpiringEvent(Nlsr& pnlsr, EventId eid)
{
pnlsr.getScheduler().cancelEvent(eid);
}
@@ -18,7 +18,7 @@
bool
-Lsdb::buildAndInstallOwnNameLsa(nlsr& pnlsr)
+Lsdb::buildAndInstallOwnNameLsa(Nlsr& pnlsr)
{
NameLsa nameLsa(pnlsr.getConfParameter().getRouterPrefix()
, 1
@@ -49,7 +49,7 @@
ndn::EventId
-Lsdb::scheduleNameLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime)
+Lsdb::scheduleNameLsaExpiration(Nlsr& pnlsr, string key, int seqNo, int expTime)
{
return pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(expTime),
ndn::bind(&Lsdb::exprireOrRefreshNameLsa,
@@ -57,7 +57,7 @@
}
bool
-Lsdb::installNameLsa(nlsr& pnlsr, NameLsa &nlsa)
+Lsdb::installNameLsa(Nlsr& pnlsr, NameLsa &nlsa)
{
int timeToExpire=lsaRefreshTime;
std::pair<NameLsa& , bool> chkNameLsa=getNameLsa(nlsa.getNameLsaKey());
@@ -162,7 +162,7 @@
}
bool
-Lsdb::removeNameLsa(nlsr& pnlsr, string& key)
+Lsdb::removeNameLsa(Nlsr& pnlsr, string& key)
{
std::list<NameLsa >::iterator it = std::find_if( nameLsdb.begin(),
nameLsdb.end(),
@@ -222,7 +222,7 @@
}
bool
-Lsdb::buildAndInstallOwnCorLsa(nlsr& pnlsr){
+Lsdb::buildAndInstallOwnCorLsa(Nlsr& pnlsr){
CorLsa corLsa(pnlsr.getConfParameter().getRouterPrefix()
, 3
, pnlsr.getSm().getCorLsaSeq()+1
@@ -251,7 +251,7 @@
}
ndn::EventId
-Lsdb::scheduleCorLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime)
+Lsdb::scheduleCorLsaExpiration(Nlsr& pnlsr, string key, int seqNo, int expTime)
{
return pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(expTime),
ndn::bind(&Lsdb::exprireOrRefreshCorLsa,
@@ -259,7 +259,7 @@
}
bool
-Lsdb::installCorLsa(nlsr& pnlsr, CorLsa &clsa)
+Lsdb::installCorLsa(Nlsr& pnlsr, CorLsa &clsa)
{
int timeToExpire=lsaRefreshTime;
std::pair<CorLsa& , bool> chkCorLsa=getCorLsa(clsa.getCorLsaKey());
@@ -334,7 +334,7 @@
}
bool
-Lsdb::removeCorLsa(nlsr& pnlsr, string& key)
+Lsdb::removeCorLsa(Nlsr& pnlsr, string& key)
{
std::list<CorLsa >::iterator it = std::find_if( corLsdb.begin(),
corLsdb.end(),
@@ -387,7 +387,7 @@
void
-Lsdb::scheduledAdjLsaBuild(nlsr& pnlsr)
+Lsdb::scheduledAdjLsaBuild(Nlsr& pnlsr)
{
cout<<"scheduledAdjLsaBuild Called"<<endl;
pnlsr.setIsBuildAdjLsaSheduled(0);
@@ -456,7 +456,7 @@
ndn::EventId
-Lsdb::scheduleAdjLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime)
+Lsdb::scheduleAdjLsaExpiration(Nlsr& pnlsr, string key, int seqNo, int expTime)
{
return pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(expTime),
ndn::bind(&Lsdb::exprireOrRefreshAdjLsa,
@@ -464,7 +464,7 @@
}
bool
-Lsdb::installAdjLsa(nlsr& pnlsr, AdjLsa &alsa)
+Lsdb::installAdjLsa(Nlsr& pnlsr, AdjLsa &alsa)
{
int timeToExpire=lsaRefreshTime;
std::pair<AdjLsa& , bool> chkAdjLsa=getAdjLsa(alsa.getAdjLsaKey());
@@ -514,7 +514,7 @@
}
bool
-Lsdb::buildAndInstallOwnAdjLsa(nlsr& pnlsr)
+Lsdb::buildAndInstallOwnAdjLsa(Nlsr& pnlsr)
{
AdjLsa adjLsa(pnlsr.getConfParameter().getRouterPrefix()
, 2
@@ -527,7 +527,7 @@
}
bool
-Lsdb::removeAdjLsa(nlsr& pnlsr, string& key)
+Lsdb::removeAdjLsa(Nlsr& pnlsr, string& key)
{
std::list<AdjLsa >::iterator it = std::find_if( adjLsdb.begin(),
adjLsdb.end(),
@@ -575,7 +575,7 @@
}
void
-Lsdb::exprireOrRefreshNameLsa(nlsr& pnlsr, string lsaKey, int seqNo)
+Lsdb::exprireOrRefreshNameLsa(Nlsr& pnlsr, string lsaKey, int seqNo)
{
cout<<"Lsdb::exprireOrRefreshNameLsa Called "<<endl;
cout<<"LSA Key : "<<lsaKey<<" Seq No: "<<endl;
@@ -602,7 +602,7 @@
}
void
-Lsdb::exprireOrRefreshAdjLsa(nlsr& pnlsr, string lsaKey, int seqNo)
+Lsdb::exprireOrRefreshAdjLsa(Nlsr& pnlsr, string lsaKey, int seqNo)
{
cout<<"Lsdb::exprireOrRefreshAdjLsa Called "<<endl;
cout<<"LSA Key : "<<lsaKey<<" Seq No: "<<endl;
@@ -632,7 +632,7 @@
}
void
-Lsdb::exprireOrRefreshCorLsa(nlsr& pnlsr, string lsaKey, int seqNo)
+Lsdb::exprireOrRefreshCorLsa(Nlsr& pnlsr, string lsaKey, int seqNo)
{
cout<<"Lsdb::exprireOrRefreshCorLsa Called "<<endl;
cout<<"LSA Key : "<<lsaKey<<" Seq No: "<<endl;
diff --git a/src/nlsr_lsdb.hpp b/src/nlsr_lsdb.hpp
index a9c8fb3..d04acd7 100644
--- a/src/nlsr_lsdb.hpp
+++ b/src/nlsr_lsdb.hpp
@@ -6,7 +6,7 @@
using namespace std;
-class nlsr;
+class Nlsr;
class Lsdb{
public:
@@ -18,29 +18,29 @@
bool doesLsaExist(string key, int lsType);
// function related to Name LSDB
- bool buildAndInstallOwnNameLsa(nlsr& pnlsr);
+ bool buildAndInstallOwnNameLsa(Nlsr& pnlsr);
std::pair<NameLsa&, bool> getNameLsa(string key);
- bool installNameLsa(nlsr& pnlsr, NameLsa &nlsa);
- bool removeNameLsa(nlsr& pnlsr, string& key);
+ bool installNameLsa(Nlsr& pnlsr, NameLsa &nlsa);
+ bool removeNameLsa(Nlsr& pnlsr, string& key);
void printNameLsdb(); //debugging
//function related to Cor LSDB
- bool buildAndInstallOwnCorLsa(nlsr& pnlsr);
+ bool buildAndInstallOwnCorLsa(Nlsr& pnlsr);
std::pair<CorLsa&, bool> getCorLsa(string key);
- bool installCorLsa(nlsr& pnlsr, CorLsa &clsa);
- bool removeCorLsa(nlsr& pnlsr, string& key);
+ bool installCorLsa(Nlsr& pnlsr, CorLsa &clsa);
+ bool removeCorLsa(Nlsr& pnlsr, string& key);
void printCorLsdb(); //debugging
//function related to Adj LSDB
- void scheduledAdjLsaBuild(nlsr& pnlsr);
- bool buildAndInstallOwnAdjLsa(nlsr& pnlsr);
- bool removeAdjLsa(nlsr& pnlsr, string& key);
- bool installAdjLsa(nlsr& pnlsr, AdjLsa &alsa);
+ void scheduledAdjLsaBuild(Nlsr& pnlsr);
+ bool buildAndInstallOwnAdjLsa(Nlsr& pnlsr);
+ bool removeAdjLsa(Nlsr& pnlsr, string& key);
+ bool installAdjLsa(Nlsr& pnlsr, AdjLsa &alsa);
std::pair<AdjLsa& , bool> getAdjLsa(string key);
std::list<AdjLsa>& getAdjLsdb();
void printAdjLsdb();
- //void scheduleRefreshLsdb(nlsr& pnlsr, int interval);
+ //void scheduleRefreshLsdb(Nlsr& pnlsr, int interval);
void setLsaRefreshTime(int lrt);
void setThisRouterPrefix(string trp);
@@ -56,18 +56,18 @@
bool doesAdjLsaExist(string key);
ndn::EventId
- scheduleNameLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime);
- void exprireOrRefreshNameLsa(nlsr& pnlsr, string lsaKey, int seqNo);
+ scheduleNameLsaExpiration(Nlsr& pnlsr, string key, int seqNo, int expTime);
+ void exprireOrRefreshNameLsa(Nlsr& pnlsr, string lsaKey, int seqNo);
ndn::EventId
- scheduleAdjLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime);
- void exprireOrRefreshAdjLsa(nlsr& pnlsr, string lsaKey, int seqNo);
+ scheduleAdjLsaExpiration(Nlsr& pnlsr, string key, int seqNo, int expTime);
+ void exprireOrRefreshAdjLsa(Nlsr& pnlsr, string lsaKey, int seqNo);
ndn::EventId
- scheduleCorLsaExpiration(nlsr& pnlsr, string key, int seqNo, int expTime);
- void exprireOrRefreshCorLsa(nlsr& pnlsr, string lsaKey, int seqNo);
+ scheduleCorLsaExpiration(Nlsr& pnlsr, string key, int seqNo, int expTime);
+ void exprireOrRefreshCorLsa(Nlsr& pnlsr, string lsaKey, int seqNo);
private:
- void cancelScheduleLsaExpiringEvent(nlsr& pnlsr, EventId eid);
+ void cancelScheduleLsaExpiringEvent(Nlsr& pnlsr, EventId eid);
std::list<NameLsa> nameLsdb;
std::list<AdjLsa> adjLsdb;
diff --git a/src/nlsr_map.cpp b/src/nlsr_map.cpp
index 3c4ee86..e96653c 100644
--- a/src/nlsr_map.cpp
+++ b/src/nlsr_map.cpp
@@ -78,7 +78,7 @@
}
void
-Map::createMapFromAdjLsdb(nlsr& pnlsr)
+Map::createMapFromAdjLsdb(Nlsr& pnlsr)
{
std::list<AdjLsa> adjLsdb=pnlsr.getLsdb().getAdjLsdb();
for( std::list<AdjLsa>::iterator it=adjLsdb.begin();
diff --git a/src/nlsr_map.hpp b/src/nlsr_map.hpp
index c02104a..7f73cac 100644
--- a/src/nlsr_map.hpp
+++ b/src/nlsr_map.hpp
@@ -6,7 +6,7 @@
#include <ndn-cpp-dev/face.hpp>
-class nlsr;
+class Nlsr;
using namespace std;
@@ -56,7 +56,7 @@
void addMapElement(string& rtrName);
- void createMapFromAdjLsdb(nlsr& pnlsr);
+ void createMapFromAdjLsdb(Nlsr& pnlsr);
string getRouterNameByMappingNo(int mn);
int getMappingNoByRouterName(string& rName);
void resetMap();
diff --git a/src/nlsr_npt.cpp b/src/nlsr_npt.cpp
index 697d11c..01b98e5 100644
--- a/src/nlsr_npt.cpp
+++ b/src/nlsr_npt.cpp
@@ -16,7 +16,7 @@
// Following two methods will update FIB with response to change in NPT
void
-Npt::addNpte(string name, RoutingTableEntry& rte, nlsr& pnlsr)
+Npt::addNpte(string name, RoutingTableEntry& rte, Nlsr& pnlsr)
{
std::list<Npte >::iterator it = std::find_if( npteList.begin(),
npteList.end(), bind(&npteCompare, _1, name));
@@ -42,7 +42,7 @@
}
void
-Npt::removeNpte(string name, RoutingTableEntry& rte, nlsr& pnlsr)
+Npt::removeNpte(string name, RoutingTableEntry& rte, Nlsr& pnlsr)
{
std::list<Npte >::iterator it = std::find_if( npteList.begin(),
npteList.end(), bind(&npteCompare, _1, name));
@@ -73,7 +73,7 @@
void
-Npt::addNpte(string name, string destRouter, nlsr& pnlsr)
+Npt::addNpte(string name, string destRouter, Nlsr& pnlsr)
{
std::pair<RoutingTableEntry& , bool> rteCheck=
pnlsr.getRoutingTable().findRoutingTableEntry(destRouter);
@@ -90,7 +90,7 @@
}
void
-Npt::removeNpte(string name, string destRouter, nlsr& pnlsr)
+Npt::removeNpte(string name, string destRouter, Nlsr& pnlsr)
{
std::pair<RoutingTableEntry& , bool> rteCheck=
pnlsr.getRoutingTable().findRoutingTableEntry(destRouter);
@@ -106,7 +106,7 @@
}
void
-Npt::updateNptWithNewRoute(nlsr& pnlsr)
+Npt::updateNptWithNewRoute(Nlsr& pnlsr)
{
for(std::list<Npte >::iterator it=npteList.begin(); it!=npteList.end(); ++it)
{
diff --git a/src/nlsr_npt.hpp b/src/nlsr_npt.hpp
index 8ceae33..c8394dc 100644
--- a/src/nlsr_npt.hpp
+++ b/src/nlsr_npt.hpp
@@ -7,7 +7,7 @@
using namespace std;
-class nlsr;
+class Nlsr;
class Npt
{
@@ -15,13 +15,13 @@
Npt()
{
}
- void addNpte(string name, string destRouter, nlsr& pnlsr);
- void removeNpte(string name, string destRouter, nlsr& pnlsr);
- void updateNptWithNewRoute(nlsr& pnlsr);
+ void addNpte(string name, string destRouter, Nlsr& pnlsr);
+ void removeNpte(string name, string destRouter, Nlsr& pnlsr);
+ void updateNptWithNewRoute(Nlsr& pnlsr);
void printNpt();
private:
- void addNpte(string name, RoutingTableEntry& rte, nlsr& pnlsr);
- void removeNpte(string name, RoutingTableEntry& rte, nlsr& pnlsr);
+ void addNpte(string name, RoutingTableEntry& rte, Nlsr& pnlsr);
+ void removeNpte(string name, RoutingTableEntry& rte, Nlsr& pnlsr);
private:
std::list<Npte> npteList;
};
diff --git a/src/nlsr_params.hpp b/src/nlsr_params.hpp
deleted file mode 100644
index a5f11c5..0000000
--- a/src/nlsr_params.hpp
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef NLSR_PARAMS_HPP
-#define NLSR_PARAMS_HPP
-
-class nlsrParams{
-
-
-
-
-
-};
-
-#endif
diff --git a/src/nlsr_rt.cpp b/src/nlsr_rt.cpp
index efa423a..1a3c091 100644
--- a/src/nlsr_rt.cpp
+++ b/src/nlsr_rt.cpp
@@ -12,7 +12,7 @@
using namespace std;
void
-RoutingTable::calculate(nlsr& pnlsr)
+RoutingTable::calculate(Nlsr& pnlsr)
{
//debugging purpose
pnlsr.getNpt().printNpt();
@@ -88,7 +88,7 @@
void
-RoutingTable::calculateLsRoutingTable(nlsr& pnlsr)
+RoutingTable::calculateLsRoutingTable(Nlsr& pnlsr)
{
cout<<"RoutingTable::calculateLsRoutingTable Called"<<endl;
Map vMap;
@@ -100,7 +100,7 @@
}
void
-RoutingTable::calculateHypRoutingTable(nlsr& pnlsr)
+RoutingTable::calculateHypRoutingTable(Nlsr& pnlsr)
{
Map vMap;
vMap.createMapFromAdjLsdb(pnlsr);
@@ -110,7 +110,7 @@
}
void
-RoutingTable::calculateHypDryRoutingTable(nlsr& pnlsr)
+RoutingTable::calculateHypDryRoutingTable(Nlsr& pnlsr)
{
Map vMap;
vMap.createMapFromAdjLsdb(pnlsr);
@@ -120,7 +120,7 @@
}
void
-RoutingTable::scheduleRoutingTableCalculation(nlsr& pnlsr)
+RoutingTable::scheduleRoutingTableCalculation(Nlsr& pnlsr)
{
if ( pnlsr.getIsRouteCalculationScheduled() != 1 )
{
diff --git a/src/nlsr_rt.hpp b/src/nlsr_rt.hpp
index ef54742..e65cf26 100644
--- a/src/nlsr_rt.hpp
+++ b/src/nlsr_rt.hpp
@@ -7,7 +7,7 @@
#include "nlsr_rte.hpp"
-class nlsr;
+class Nlsr;
class NextHop;
using namespace std;
@@ -19,19 +19,19 @@
: NO_NEXT_HOP(-12345)
{
}
- void calculate(nlsr& pnlsr);
+ void calculate(Nlsr& pnlsr);
void addNextHop(string destRouter, NextHop& nh);
void printRoutingTable();
void addNextHopToDryTable(string destRouter, NextHop& nh);
void printDryRoutingTable();
std::pair<RoutingTableEntry&, bool> findRoutingTableEntry(string destRouter);
- void scheduleRoutingTableCalculation(nlsr& pnlsr);
+ void scheduleRoutingTableCalculation(Nlsr& pnlsr);
private:
- void calculateLsRoutingTable(nlsr& pnlsr);
- void calculateHypRoutingTable(nlsr& pnlsr);
- void calculateHypDryRoutingTable(nlsr&pnlsr);
+ void calculateLsRoutingTable(Nlsr& pnlsr);
+ void calculateHypRoutingTable(Nlsr& pnlsr);
+ void calculateHypDryRoutingTable(Nlsr&pnlsr);
void clearRoutingTable();
void clearDryRoutingTable();
diff --git a/src/nlsr_rtc.cpp b/src/nlsr_rtc.cpp
index 539c6e9..8b67f7b 100644
--- a/src/nlsr_rtc.cpp
+++ b/src/nlsr_rtc.cpp
@@ -30,7 +30,7 @@
}
void
-RoutingTableCalculator::makeAdjMatrix(nlsr& pnlsr, Map pMap)
+RoutingTableCalculator::makeAdjMatrix(Nlsr& pnlsr, Map pMap)
{
std::list<AdjLsa> adjLsdb=pnlsr.getLsdb().getAdjLsdb();
for( std::list<AdjLsa>::iterator it=adjLsdb.begin();
@@ -143,7 +143,7 @@
void
LinkStateRoutingTableCalculator::calculatePath(Map& pMap,
- RoutingTable& rt, nlsr& pnlsr)
+ RoutingTable& rt, Nlsr& pnlsr)
{
cout<<"LinkStateRoutingTableCalculator::calculatePath Called"<<endl;
allocateAdjMatrix();
@@ -247,7 +247,7 @@
}
void
-LinkStateRoutingTableCalculator::addAllLsNextHopsToRoutingTable(nlsr& pnlsr,
+LinkStateRoutingTableCalculator::addAllLsNextHopsToRoutingTable(Nlsr& pnlsr,
RoutingTable& rt, Map& pMap, int sourceRouter)
{
cout<<"LinkStateRoutingTableCalculator::addAllNextHopsToRoutingTable Called";
@@ -381,7 +381,7 @@
void
HypRoutingTableCalculator::calculatePath(Map& pMap,
- RoutingTable& rt, nlsr& pnlsr)
+ RoutingTable& rt, Nlsr& pnlsr)
{
makeAdjMatrix(pnlsr,pMap);
string routerName=pnlsr.getConfParameter().getRouterPrefix();
@@ -434,7 +434,7 @@
}
void
-HypRoutingTableCalculator::addHypNextHopsToRoutingTable(nlsr& pnlsr,Map& pMap,
+HypRoutingTableCalculator::addHypNextHopsToRoutingTable(Nlsr& pnlsr,Map& pMap,
RoutingTable& rt, int noFaces, int dest)
{
for(int i=0 ; i < noFaces ; ++i)
@@ -451,7 +451,7 @@
}
double
-HypRoutingTableCalculator::getHyperbolicDistance(nlsr& pnlsr,
+HypRoutingTableCalculator::getHyperbolicDistance(Nlsr& pnlsr,
Map& pMap, int src, int dest)
{
double distance=0.0;
diff --git a/src/nlsr_rtc.hpp b/src/nlsr_rtc.hpp
index cba183b..4bbace7 100644
--- a/src/nlsr_rtc.hpp
+++ b/src/nlsr_rtc.hpp
@@ -8,7 +8,7 @@
class Map;
class RoutingTable;
-class nlsr;
+class Nlsr;
using namespace std;
@@ -26,7 +26,7 @@
protected:
void allocateAdjMatrix();
void initMatrix();
- void makeAdjMatrix(nlsr& pnlsr,Map pMap);
+ void makeAdjMatrix(Nlsr& pnlsr,Map pMap);
void printAdjMatrix();
int getNumOfLinkfromAdjMatrix(int sRouter);
void freeAdjMatrix();
@@ -65,7 +65,7 @@
}
- void calculatePath(Map& pMap, RoutingTable& rt, nlsr& pnlsr);
+ void calculatePath(Map& pMap, RoutingTable& rt, Nlsr& pnlsr);
private:
@@ -74,7 +74,7 @@
int isNotExplored(int *Q, int u,int start, int element);
void printAllLsPath(int sourceRouter);
void printLsPath(int destRouter);
- void addAllLsNextHopsToRoutingTable(nlsr& pnlsr, RoutingTable& rt,
+ void addAllLsNextHopsToRoutingTable(Nlsr& pnlsr, RoutingTable& rt,
Map& pMap,int sourceRouter);
int getLsNextHop(int dest, int source);
@@ -114,7 +114,7 @@
isDryRun=idr;
}
- void calculatePath(Map& pMap, RoutingTable& rt, nlsr& pnlsr);
+ void calculatePath(Map& pMap, RoutingTable& rt, Nlsr& pnlsr);
private:
void allocateLinkFaces();
@@ -124,8 +124,8 @@
void freeDistanceToNeighbor();
void freeDistFromNbrToDest();
- double getHyperbolicDistance(nlsr& pnlsr,Map& pMap, int src, int dest);
- void addHypNextHopsToRoutingTable(nlsr& pnlsr,Map& pMap,
+ double getHyperbolicDistance(Nlsr& pnlsr,Map& pMap, int src, int dest);
+ void addHypNextHopsToRoutingTable(Nlsr& pnlsr,Map& pMap,
RoutingTable& rt, int noFaces,int dest);
private:
diff --git a/src/nlsr_sm.cpp b/src/nlsr_sm.cpp
index 4a1706d..1744897 100644
--- a/src/nlsr_sm.cpp
+++ b/src/nlsr_sm.cpp
@@ -4,6 +4,6 @@
using namespace std;
-class nlsr;
+class Nlsr;
diff --git a/src/nlsr_test.cpp b/src/nlsr_test.cpp
index ef19e63..730befd 100644
--- a/src/nlsr_test.cpp
+++ b/src/nlsr_test.cpp
@@ -9,7 +9,7 @@
using namespace ndn;
void
-nlsrTest::schedlueAddingLsas(nlsr& pnlsr)
+NlsrTest::schedlueAddingLsas(Nlsr& pnlsr)
{
// scheduling adding two name lsas, two Cor Lsas and three Adj LSAs
@@ -22,15 +22,15 @@
Adjacent adj2("/ndn/memphis.edu/cs/maia",15,27,1,0);
pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(30),
- ndn::bind(&nlsrTest::secheduledAddNameLsa,pnlsr.getNlsrTesting(),
+ ndn::bind(&NlsrTest::secheduledAddNameLsa,pnlsr.getNlsrTesting(),
boost::ref(pnlsr)
,router,name1,name2,name3));
pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(37),
- ndn::bind(&nlsrTest::secheduledAddCorLsa,pnlsr.getNlsrTesting(),
+ ndn::bind(&NlsrTest::secheduledAddCorLsa,pnlsr.getNlsrTesting(),
boost::ref(pnlsr)
,router,123.098,1.875));
pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(47),
- ndn::bind(&nlsrTest::scheduledAddAdjacentLsa,pnlsr.getNlsrTesting(),
+ ndn::bind(&NlsrTest::scheduledAddAdjacentLsa,pnlsr.getNlsrTesting(),
boost::ref(pnlsr)
,router,adj1,adj2));
@@ -43,15 +43,15 @@
Adjacent maiaAdj2("/ndn/memphis.edu/cs/altair",11,15,1,0);
pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(55),
- ndn::bind(&nlsrTest::secheduledAddNameLsa,pnlsr.getNlsrTesting(),
+ ndn::bind(&NlsrTest::secheduledAddNameLsa,pnlsr.getNlsrTesting(),
boost::ref(pnlsr)
,routerMaia,maiaName1,maiaName2,maiaName3));
pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(65),
- ndn::bind(&nlsrTest::secheduledAddCorLsa,pnlsr.getNlsrTesting(),
+ ndn::bind(&NlsrTest::secheduledAddCorLsa,pnlsr.getNlsrTesting(),
boost::ref(pnlsr)
,routerMaia,12.098,0.875));
pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(75),
- ndn::bind(&nlsrTest::scheduledAddAdjacentLsa,pnlsr.getNlsrTesting(),
+ ndn::bind(&NlsrTest::scheduledAddAdjacentLsa,pnlsr.getNlsrTesting(),
boost::ref(pnlsr)
,routerMaia,maiaAdj1,maiaAdj2));
@@ -61,7 +61,7 @@
Adjacent polluxAdj2("/ndn/memphis.edu/cs/altair",12,23,1,0);
pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(90),
- ndn::bind(&nlsrTest::scheduledAddAdjacentLsa,pnlsr.getNlsrTesting(),
+ ndn::bind(&NlsrTest::scheduledAddAdjacentLsa,pnlsr.getNlsrTesting(),
boost::ref(pnlsr)
,routerPollux,polluxAdj1,polluxAdj2));
@@ -71,7 +71,7 @@
void
-nlsrTest::secheduledAddNameLsa(nlsr& pnlsr, string router,
+NlsrTest::secheduledAddNameLsa(Nlsr& pnlsr, string router,
string name1, string name2, string name3)
{
Npl npl;
@@ -84,14 +84,14 @@
}
void
-nlsrTest::secheduledAddCorLsa(nlsr& pnlsr,string router, double r, double angle)
+NlsrTest::secheduledAddCorLsa(Nlsr& pnlsr,string router, double r, double angle)
{
CorLsa corLsa(router,3,1,3600,r,angle);
pnlsr.getLsdb().installCorLsa(pnlsr, corLsa);
}
void
-nlsrTest::scheduledAddAdjacentLsa(nlsr& pnlsr, string router,
+NlsrTest::scheduledAddAdjacentLsa(Nlsr& pnlsr, string router,
Adjacent adj1, Adjacent adj2)
{
Adl adl;
diff --git a/src/nlsr_test.hpp b/src/nlsr_test.hpp
index e6e7dfd..c08fd30 100644
--- a/src/nlsr_test.hpp
+++ b/src/nlsr_test.hpp
@@ -12,21 +12,21 @@
using namespace std;
-class nlsr;
+class Nlsr;
-class nlsrTest
+class NlsrTest
{
public:
- nlsrTest()
+ NlsrTest()
{
}
- void schedlueAddingLsas(nlsr& pnlsr);
+ void schedlueAddingLsas(Nlsr& pnlsr);
private:
- void secheduledAddNameLsa(nlsr& pnlsr, string router,
+ void secheduledAddNameLsa(Nlsr& pnlsr, string router,
string name1, string name2, string name3);
- void secheduledAddCorLsa(nlsr& pnlsr,string router, double r, double angle);
+ void secheduledAddCorLsa(Nlsr& pnlsr,string router, double r, double angle);
- void scheduledAddAdjacentLsa(nlsr& pnlsr, string router,
+ void scheduledAddAdjacentLsa(Nlsr& pnlsr, string router,
Adjacent adj1, Adjacent adj2);
};