akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 1 | #ifndef NLSR_FE_HPP |
2 | #define NLSR_FE_HPP | ||||
3 | |||||
4 | #include<list> | ||||
5 | #include <iostream> | ||||
akmhoque | 85d8833 | 2014-02-17 21:11:21 -0600 | [diff] [blame] | 6 | #include <ndn-cpp-dev/util/scheduler.hpp> |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 7 | |
8 | #include "nlsr_nexthop.hpp" | ||||
9 | #include "nlsr_nhl.hpp" | ||||
10 | |||||
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 11 | namespace nlsr |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 12 | { |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 13 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 14 | using namespace std; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 15 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 16 | class FibEntry |
17 | { | ||||
18 | public: | ||||
19 | FibEntry() | ||||
20 | : name() | ||||
21 | , timeToRefresh(0) | ||||
22 | , feSeqNo(0) | ||||
23 | { | ||||
24 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 25 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 26 | FibEntry(string n) |
27 | { | ||||
28 | name=n; | ||||
29 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 30 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 31 | string getName() |
32 | { | ||||
33 | return name; | ||||
34 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 35 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 36 | Nhl& getNhl() |
37 | { | ||||
38 | return nhl; | ||||
39 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 40 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 41 | int getTimeToRefresh() |
42 | { | ||||
43 | return timeToRefresh; | ||||
44 | } | ||||
akmhoque | 85d8833 | 2014-02-17 21:11:21 -0600 | [diff] [blame] | 45 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 46 | void setTimeToRefresh(int ttr) |
47 | { | ||||
48 | timeToRefresh=ttr; | ||||
49 | } | ||||
akmhoque | 85d8833 | 2014-02-17 21:11:21 -0600 | [diff] [blame] | 50 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 51 | void setFeExpiringEventId(ndn::EventId feid) |
52 | { | ||||
53 | feExpiringEventId=feid; | ||||
54 | } | ||||
akmhoque | 85d8833 | 2014-02-17 21:11:21 -0600 | [diff] [blame] | 55 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 56 | ndn::EventId getFeExpiringEventId() |
57 | { | ||||
58 | return feExpiringEventId; | ||||
59 | } | ||||
akmhoque | 85d8833 | 2014-02-17 21:11:21 -0600 | [diff] [blame] | 60 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 61 | void setFeSeqNo(int fsn) |
62 | { | ||||
63 | feSeqNo=fsn; | ||||
64 | } | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 65 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 66 | int getFeSeqNo() |
67 | { | ||||
68 | return feSeqNo; | ||||
69 | } | ||||
70 | |||||
71 | bool isEqualNextHops(Nhl &nhlOther); | ||||
72 | |||||
73 | private: | ||||
74 | string name; | ||||
75 | int timeToRefresh; | ||||
76 | ndn::EventId feExpiringEventId; | ||||
77 | int feSeqNo; | ||||
78 | Nhl nhl; | ||||
79 | }; | ||||
80 | |||||
81 | ostream& operator<<(ostream& os, FibEntry& fe); | ||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 82 | |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 83 | } //namespace nlsr |
84 | |||||
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 85 | #endif |