akmhoque | dfa4a5b | 2014-02-03 20:12:29 -0600 | [diff] [blame] | 1 | #ifndef NLSR_ADL_HPP |
| 2 | #define NLSR_ADL_HPP |
akmhoque | 87347a3 | 2014-01-31 11:00:44 -0600 | [diff] [blame] | 3 | |
| 4 | #include <ndn-cpp-dev/face.hpp> |
akmhoque | 204e754 | 2014-01-31 16:08:25 -0600 | [diff] [blame] | 5 | #include "nlsr_adjacent.hpp" |
akmhoque | 87347a3 | 2014-01-31 11:00:44 -0600 | [diff] [blame] | 6 | #include<list> |
| 7 | |
akmhoque | cd55247 | 2014-02-01 21:22:16 -0600 | [diff] [blame] | 8 | class nlsr; |
| 9 | |
akmhoque | 87347a3 | 2014-01-31 11:00:44 -0600 | [diff] [blame] | 10 | using namespace std; |
| 11 | |
| 12 | class Adl{ |
| 13 | |
| 14 | public: |
| 15 | Adl(); |
| 16 | ~Adl(); |
| 17 | int insert(Adjacent& adj); |
| 18 | int updateAdjacentStatus(string adjName, int s); |
| 19 | int updateAdjacentLinkCost(string adjName, double lc); |
akmhoque | 79d355f | 2014-02-04 15:11:16 -0600 | [diff] [blame] | 20 | std::list<Adjacent>& getAdjList(); |
akmhoque | a8cd6b9 | 2014-01-31 20:13:26 -0600 | [diff] [blame] | 21 | 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); |
akmhoque | 4768f89 | 2014-02-08 23:58:07 -0600 | [diff] [blame^] | 27 | void addAdjacentsFromAdl(Adl& adl); |
akmhoque | 87347a3 | 2014-01-31 11:00:44 -0600 | [diff] [blame] | 28 | |
akmhoque | cd55247 | 2014-02-01 21:22:16 -0600 | [diff] [blame] | 29 | bool isAdjLsaBuildable(nlsr& pnlsr); |
| 30 | int getNumOfActiveNeighbor(); |
akmhoque | f7c2c7c | 2014-02-06 11:32:43 -0600 | [diff] [blame] | 31 | Adjacent getAdjacent(string adjName); |
akmhoque | cd55247 | 2014-02-01 21:22:16 -0600 | [diff] [blame] | 32 | |
akmhoque | 4768f89 | 2014-02-08 23:58:07 -0600 | [diff] [blame^] | 33 | bool isAdlEqual(Adl &adl); |
| 34 | |
akmhoque | cd55247 | 2014-02-01 21:22:16 -0600 | [diff] [blame] | 35 | int getAdlSize() |
| 36 | { |
| 37 | return adjList.size(); |
| 38 | } |
| 39 | |
akmhoque | 4768f89 | 2014-02-08 23:58:07 -0600 | [diff] [blame^] | 40 | void resetAdl() |
| 41 | { |
| 42 | if( adjList.size() > 0 ) |
| 43 | { |
| 44 | adjList.clear(); |
| 45 | } |
| 46 | } |
| 47 | |
akmhoque | a8cd6b9 | 2014-01-31 20:13:26 -0600 | [diff] [blame] | 48 | void printAdl(); |
akmhoque | 87347a3 | 2014-01-31 11:00:44 -0600 | [diff] [blame] | 49 | |
| 50 | private: |
| 51 | std::list< Adjacent > adjList; |
| 52 | }; |
| 53 | |
| 54 | #endif |