blob: 350270edbe104f6af22cb9fb20a3e85279d37b7c [file] [log] [blame]
akmhoque62a8e402014-02-08 12:00:27 -06001#include <list>
2#include "nlsr_fe.hpp"
3#include "nlsr_nexthop.hpp"
4
5using namespace std;
6
7bool
8FibEntry::isEqualNextHops(Nhl &nhlOther)
9{
10 if ( nhl.getNhlSize() != nhlOther.getNhlSize() )
11 {
12 return false;
13 }
14 else
15 {
16 int nhCount=0;
17 std::list<NextHop>::iterator it1, it2;
18
19 for ( it1=nhl.getNextHopList().begin(),
20 it2 = nhlOther.getNextHopList().begin() ;
21 it1 != nhl.getNextHopList().end() ; it1++, it2++)
22 {
23 if ((*it1).getConnectingFace() == (*it2).getConnectingFace() )
24 {
25 (*it1).setRouteCost((*it2).getRouteCost());
26 nhCount++;
27 }
28 else
29 {
30 break;
31 }
32 }
33
34 return nhCount == nhl.getNhlSize();
35 }
36}
37
38ostream&
39operator<<(ostream& os, FibEntry& fe)
40{
41 os<<"Name Prefix: "<<fe.getName()<<endl;
42 os<<fe.getNhl()<<endl;
43 return os;
44}