blob: fde32c80243c7a585169716e41f4240f2b8791ac [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
akmhoqueb1710aa2014-02-19 17:13:36 -060011namespace nlsr {
12
akmhoque298385a2014-02-13 14:13:09 -060013using namespace std;
14
15class FibEntry
16{
17public:
18 FibEntry()
19 : name()
20 , timeToRefresh(0)
akmhoque85d88332014-02-17 21:11:21 -060021 , feSeqNo(0)
akmhoque298385a2014-02-13 14:13:09 -060022 {
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
akmhoque85d88332014-02-17 21:11:21 -060050 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
akmhoque298385a2014-02-13 14:13:09 -060070 bool isEqualNextHops(Nhl &nhlOther);
71
72private:
73 string name;
74 int timeToRefresh;
akmhoque85d88332014-02-17 21:11:21 -060075 ndn::EventId feExpiringEventId;
76 int feSeqNo;
akmhoque298385a2014-02-13 14:13:09 -060077 Nhl nhl;
78};
79
80ostream& operator<<(ostream& os, FibEntry& fe);
81
akmhoqueb1710aa2014-02-19 17:13:36 -060082} //namespace nlsr
83
akmhoque298385a2014-02-13 14:13:09 -060084#endif