blob: 4c44993776580e18bb99261be468f8aad2def3b9 [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
akmhoque1fd8c1e2014-02-19 19:41:49 -060011 class Nlsr;
akmhoque298385a2014-02-13 14:13:09 -060012
akmhoque1fd8c1e2014-02-19 19:41:49 -060013 using namespace std;
akmhoque298385a2014-02-13 14:13:09 -060014
akmhoque1fd8c1e2014-02-19 19:41:49 -060015 class Adl
16 {
akmhoque298385a2014-02-13 14:13:09 -060017
akmhoque1fd8c1e2014-02-19 19:41:49 -060018 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);
akmhoque298385a2014-02-13 14:13:09 -060032
akmhoque1fd8c1e2014-02-19 19:41:49 -060033 bool isAdjLsaBuildable(Nlsr& pnlsr);
34 int getNumOfActiveNeighbor();
35 Adjacent getAdjacent(string adjName);
akmhoque298385a2014-02-13 14:13:09 -060036
akmhoque1fd8c1e2014-02-19 19:41:49 -060037 bool isAdlEqual(Adl &adl);
akmhoque298385a2014-02-13 14:13:09 -060038
akmhoque1fd8c1e2014-02-19 19:41:49 -060039 int getAdlSize()
40 {
41 return adjList.size();
42 }
akmhoque298385a2014-02-13 14:13:09 -060043
akmhoque1fd8c1e2014-02-19 19:41:49 -060044 void resetAdl()
45 {
46 if( adjList.size() > 0 )
47 {
48 adjList.clear();
49 }
50 }
akmhoque298385a2014-02-13 14:13:09 -060051
akmhoque1fd8c1e2014-02-19 19:41:49 -060052 void printAdl();
akmhoque298385a2014-02-13 14:13:09 -060053
akmhoque1fd8c1e2014-02-19 19:41:49 -060054 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