NLSR - (Hello Protocol + FIB Update)
diff --git a/src/route/nlsr_fe.cpp b/src/route/nlsr_fe.cpp
index 5f4811c..9464f63 100644
--- a/src/route/nlsr_fe.cpp
+++ b/src/route/nlsr_fe.cpp
@@ -5,44 +5,44 @@
namespace nlsr
{
- using namespace std;
+ using namespace std;
- bool
- FibEntry::isEqualNextHops(Nhl &nhlOther)
+ bool
+ FibEntry::isEqualNextHops(Nhl &nhlOther)
+ {
+ if ( nhl.getNhlSize() != nhlOther.getNhlSize() )
{
- if ( nhl.getNhlSize() != nhlOther.getNhlSize() )
+ return false;
+ }
+ else
+ {
+ int nhCount=0;
+ std::list<NextHop>::iterator it1, it2;
+ for ( it1=nhl.getNextHopList().begin(),
+ it2 = nhlOther.getNextHopList().begin() ;
+ it1 != nhl.getNextHopList().end() ; it1++, it2++)
+ {
+ if (it1->getConnectingFace() == it2->getConnectingFace() )
{
- return false;
+ it1->setRouteCost(it2->getRouteCost());
+ nhCount++;
}
else
{
- int nhCount=0;
- std::list<NextHop>::iterator it1, it2;
- for ( it1=nhl.getNextHopList().begin(),
- it2 = nhlOther.getNextHopList().begin() ;
- it1 != nhl.getNextHopList().end() ; it1++, it2++)
- {
- if ((*it1).getConnectingFace() == (*it2).getConnectingFace() )
- {
- (*it1).setRouteCost((*it2).getRouteCost());
- nhCount++;
- }
- else
- {
- break;
- }
- }
- return nhCount == nhl.getNhlSize();
+ break;
}
+ }
+ return nhCount == nhl.getNhlSize();
}
+ }
- ostream&
- operator<<(ostream& os, FibEntry& fe)
- {
- os<<"Name Prefix: "<<fe.getName()<<endl;
- os<<"Time to Refresh: "<<fe.getTimeToRefresh()<<endl;
- os<<fe.getNhl()<<endl;
- return os;
- }
+ ostream&
+ operator<<(ostream& os, FibEntry fe)
+ {
+ os<<"Name Prefix: "<<fe.getName()<<endl;
+ os<<"Time to Refresh: "<<fe.getTimeToRefresh()<<endl;
+ os<<fe.getNhl()<<endl;
+ return os;
+ }
}//namespace nlsr