blob: 0169a5fef342db3794a4c5269ff6d28cdd41baa4 [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
akmhoqueb1710aa2014-02-19 17:13:36 -06008namespace nlsr {
9
akmhoque1a481092014-02-19 16:34:22 -060010class Nlsr;
akmhoque298385a2014-02-13 14:13:09 -060011
12using namespace std;
13
14class Adl{
15
16public:
17 Adl();
18 ~Adl();
19 int insert(Adjacent& adj);
20 int updateAdjacentStatus(string adjName, int s);
21 int updateAdjacentLinkCost(string adjName, double lc);
22 std::list<Adjacent>& getAdjList();
23 bool isNeighbor(string adjName);
24 void incrementTimedOutInterestCount(string& neighbor);
25 int getTimedOutInterestCount(string& neighbor);
26 int getStatusOfNeighbor(string& neighbor);
27 void setStatusOfNeighbor(string& neighbor, int status);
28 void setTimedOutInterestCount(string& neighbor, int count);
29 void addAdjacentsFromAdl(Adl& adl);
30
akmhoque1a481092014-02-19 16:34:22 -060031 bool isAdjLsaBuildable(Nlsr& pnlsr);
akmhoque298385a2014-02-13 14:13:09 -060032 int getNumOfActiveNeighbor();
33 Adjacent getAdjacent(string adjName);
34
35 bool isAdlEqual(Adl &adl);
36
37 int getAdlSize()
38 {
39 return adjList.size();
40 }
41
42 void resetAdl()
43 {
44 if( adjList.size() > 0 )
45 {
46 adjList.clear();
47 }
48 }
49
50 void printAdl();
51
52private:
53 std::list< Adjacent > adjList;
54};
55
akmhoqueb1710aa2014-02-19 17:13:36 -060056} //namespace nlsr
akmhoque298385a2014-02-13 14:13:09 -060057#endif