akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 1 | #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 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 8 | namespace nlsr |
| 9 | { |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 10 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 11 | class Nlsr; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 12 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 13 | using namespace std; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 14 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 15 | 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() |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 40 | { |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 41 | return adjList.size(); |
| 42 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 43 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 44 | void resetAdl() |
| 45 | { |
| 46 | if( adjList.size() > 0 ) |
| 47 | { |
| 48 | adjList.clear(); |
| 49 | } |
| 50 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 51 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 52 | void printAdl(); |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 53 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 54 | private: |
| 55 | std::list< Adjacent > adjList; |
| 56 | }; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 57 | |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 58 | } //namespace nlsr |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 59 | #endif |