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