blob: cc724fedb70f44a4132ea6af7248a8a085ee59ba [file] [log] [blame]
#include <list>
#include "nlsr_fe.hpp"
#include "nlsr_nexthop.hpp"
#include "utility/nlsr_logger.hpp"
#define THIS_FILE "nlsr_fe.cpp"
namespace nlsr
{
using namespace std;
bool
FibEntry::isEqualNextHops(Nhl& nhlOther)
{
if ( m_nhl.getSize() != nhlOther.getSize() )
{
return false;
}
else
{
int nhCount=0;
std::list<NextHop>::iterator it1, it2;
for ( it1=m_nhl.getNextHopList().begin(),
it2 = nhlOther.getNextHopList().begin() ;
it1 != m_nhl.getNextHopList().end() ; it1++, it2++)
{
if (it1->getConnectingFace() == it2->getConnectingFace() )
{
it1->setRouteCost(it2->getRouteCost());
nhCount++;
}
else
{
break;
}
}
return nhCount == m_nhl.getSize();
}
}
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