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