blob: 0d868aeda7a4115dd44a6c4d2d6611ae6ef2cc13 [file] [log] [blame]
akmhoquedfa4a5b2014-02-03 20:12:29 -06001#ifndef NLSR_ADL_HPP
2#define NLSR_ADL_HPP
akmhoque87347a32014-01-31 11:00:44 -06003
4#include <ndn-cpp-dev/face.hpp>
akmhoque204e7542014-01-31 16:08:25 -06005#include "nlsr_adjacent.hpp"
akmhoque87347a32014-01-31 11:00:44 -06006#include<list>
7
akmhoquecd552472014-02-01 21:22:16 -06008class nlsr;
9
akmhoque87347a32014-01-31 11:00:44 -060010using 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);
akmhoque79d355f2014-02-04 15:11:16 -060020 std::list<Adjacent>& getAdjList();
akmhoquea8cd6b92014-01-31 20:13:26 -060021 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);
akmhoque4768f892014-02-08 23:58:07 -060027 void addAdjacentsFromAdl(Adl& adl);
akmhoque87347a32014-01-31 11:00:44 -060028
akmhoquecd552472014-02-01 21:22:16 -060029 bool isAdjLsaBuildable(nlsr& pnlsr);
30 int getNumOfActiveNeighbor();
akmhoquef7c2c7c2014-02-06 11:32:43 -060031 Adjacent getAdjacent(string adjName);
akmhoquecd552472014-02-01 21:22:16 -060032
akmhoque4768f892014-02-08 23:58:07 -060033 bool isAdlEqual(Adl &adl);
34
akmhoquecd552472014-02-01 21:22:16 -060035 int getAdlSize()
36 {
37 return adjList.size();
38 }
39
akmhoque4768f892014-02-08 23:58:07 -060040 void resetAdl()
41 {
42 if( adjList.size() > 0 )
43 {
44 adjList.clear();
45 }
46 }
47
akmhoquea8cd6b92014-01-31 20:13:26 -060048 void printAdl();
akmhoque87347a32014-01-31 11:00:44 -060049
50private:
51 std::list< Adjacent > adjList;
52};
53
54#endif