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