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 | 87347a3 | 2014-01-31 11:00:44 -0600 | [diff] [blame] | 27 | |
akmhoque | cd55247 | 2014-02-01 21:22:16 -0600 | [diff] [blame] | 28 | bool isAdjLsaBuildable(nlsr& pnlsr); |
| 29 | int getNumOfActiveNeighbor(); |
akmhoque | f7c2c7c | 2014-02-06 11:32:43 -0600 | [diff] [blame] | 30 | Adjacent getAdjacent(string adjName); |
akmhoque | cd55247 | 2014-02-01 21:22:16 -0600 | [diff] [blame] | 31 | |
| 32 | int getAdlSize() |
| 33 | { |
| 34 | return adjList.size(); |
| 35 | } |
| 36 | |
akmhoque | a8cd6b9 | 2014-01-31 20:13:26 -0600 | [diff] [blame] | 37 | void printAdl(); |
akmhoque | 87347a3 | 2014-01-31 11:00:44 -0600 | [diff] [blame] | 38 | |
| 39 | private: |
| 40 | std::list< Adjacent > adjList; |
| 41 | }; |
| 42 | |
| 43 | #endif |