blob: 2297315bf34c7faf1ebd0c7d926b81e0e6310ac4 [file] [log] [blame]
akmhoque298385a2014-02-13 14:13:09 -06001#ifndef NLSR_FE_HPP
2#define NLSR_FE_HPP
3
4#include<list>
5#include <iostream>
akmhoque85d88332014-02-17 21:11:21 -06006#include <ndn-cpp-dev/util/scheduler.hpp>
akmhoque298385a2014-02-13 14:13:09 -06007
8#include "nlsr_nexthop.hpp"
9#include "nlsr_nhl.hpp"
10
11using namespace std;
12
13class FibEntry
14{
15public:
16 FibEntry()
17 : name()
18 , timeToRefresh(0)
akmhoque85d88332014-02-17 21:11:21 -060019 , feSeqNo(0)
akmhoque298385a2014-02-13 14:13:09 -060020 {
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
akmhoque85d88332014-02-17 21:11:21 -060048 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
akmhoque298385a2014-02-13 14:13:09 -060068 bool isEqualNextHops(Nhl &nhlOther);
69
70private:
71 string name;
72 int timeToRefresh;
akmhoque85d88332014-02-17 21:11:21 -060073 ndn::EventId feExpiringEventId;
74 int feSeqNo;
akmhoque298385a2014-02-13 14:13:09 -060075 Nhl nhl;
76};
77
78ostream& operator<<(ostream& os, FibEntry& fe);
79
80#endif