blob: 0d868aeda7a4115dd44a6c4d2d6611ae6ef2cc13 [file] [log] [blame]
akmhoque298385a2014-02-13 14:13:09 -06001#ifndef NLSR_ADL_HPP
2#define NLSR_ADL_HPP
3
4#include <ndn-cpp-dev/face.hpp>
5#include "nlsr_adjacent.hpp"
6#include<list>
7
8class nlsr;
9
10using namespace std;
11
12class Adl{
13
14public:
15 Adl();
16 ~Adl();
17 int insert(Adjacent& adj);
18 int updateAdjacentStatus(string adjName, int s);
19 int updateAdjacentLinkCost(string adjName, double lc);
20 std::list<Adjacent>& getAdjList();
21 bool isNeighbor(string adjName);
22 void incrementTimedOutInterestCount(string& neighbor);
23 int getTimedOutInterestCount(string& neighbor);
24 int getStatusOfNeighbor(string& neighbor);
25 void setStatusOfNeighbor(string& neighbor, int status);
26 void setTimedOutInterestCount(string& neighbor, int count);
27 void addAdjacentsFromAdl(Adl& adl);
28
29 bool isAdjLsaBuildable(nlsr& pnlsr);
30 int getNumOfActiveNeighbor();
31 Adjacent getAdjacent(string adjName);
32
33 bool isAdlEqual(Adl &adl);
34
35 int getAdlSize()
36 {
37 return adjList.size();
38 }
39
40 void resetAdl()
41 {
42 if( adjList.size() > 0 )
43 {
44 adjList.clear();
45 }
46 }
47
48 void printAdl();
49
50private:
51 std::list< Adjacent > adjList;
52};
53
54#endif