blob: 82edaf056b453340fc320c1e8bf621a5619ce0b2 [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
akmhoque1fd8c1e2014-02-19 19:41:49 -06008namespace nlsr
9{
akmhoqueb1710aa2014-02-19 17:13:36 -060010
akmhoque5a44dd42014-03-12 18:11:32 -050011 class Nlsr;
akmhoque298385a2014-02-13 14:13:09 -060012
akmhoque5a44dd42014-03-12 18:11:32 -050013 using namespace std;
akmhoque298385a2014-02-13 14:13:09 -060014
akmhoque5a44dd42014-03-12 18:11:32 -050015 class Adl
16 {
17
18 public:
19 Adl();
20 ~Adl();
21 int insert(Adjacent& adj);
22 int updateAdjacentStatus(string adjName, int s);
23 int updateAdjacentLinkCost(string adjName, double lc);
24 std::list<Adjacent>& getAdjList();
25 bool isNeighbor(string adjName);
26 void incrementTimedOutInterestCount(string& neighbor);
27 int getTimedOutInterestCount(string& neighbor);
28 int getStatusOfNeighbor(string& neighbor);
29 void setStatusOfNeighbor(string& neighbor, int status);
30 void setTimedOutInterestCount(string& neighbor, int count);
31 void addAdjacentsFromAdl(Adl& adl);
32
33 bool isAdjLsaBuildable(Nlsr& pnlsr);
34 int getNumOfActiveNeighbor();
35 Adjacent getAdjacent(string adjName);
36
37 bool isAdlEqual(Adl &adl);
38
39 int getAdlSize()
akmhoque1fd8c1e2014-02-19 19:41:49 -060040 {
akmhoque5a44dd42014-03-12 18:11:32 -050041 return adjList.size();
42 }
akmhoque298385a2014-02-13 14:13:09 -060043
akmhoque5a44dd42014-03-12 18:11:32 -050044 void resetAdl()
45 {
46 if( adjList.size() > 0 )
47 {
48 adjList.clear();
49 }
50 }
akmhoque298385a2014-02-13 14:13:09 -060051
akmhoque5a44dd42014-03-12 18:11:32 -050052 void printAdl();
akmhoque298385a2014-02-13 14:13:09 -060053
akmhoque5a44dd42014-03-12 18:11:32 -050054 private:
55 std::list< Adjacent > adjList;
56 };
akmhoque298385a2014-02-13 14:13:09 -060057
akmhoqueb1710aa2014-02-19 17:13:36 -060058} //namespace nlsr
akmhoque298385a2014-02-13 14:13:09 -060059#endif