blob: c85e045e24feb88a2bfa26f7e884dd2cbde82445 [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
akmhoque1fd8c1e2014-02-19 19:41:49 -060011namespace nlsr
akmhoque298385a2014-02-13 14:13:09 -060012{
akmhoque298385a2014-02-13 14:13:09 -060013
akmhoque1fd8c1e2014-02-19 19:41:49 -060014 using namespace std;
akmhoque298385a2014-02-13 14:13:09 -060015
akmhoque1fd8c1e2014-02-19 19:41:49 -060016 class FibEntry
17 {
18 public:
19 FibEntry()
20 : name()
21 , timeToRefresh(0)
22 , feSeqNo(0)
23 {
24 }
akmhoque298385a2014-02-13 14:13:09 -060025
akmhoque1fd8c1e2014-02-19 19:41:49 -060026 FibEntry(string n)
27 {
28 name=n;
29 }
akmhoque298385a2014-02-13 14:13:09 -060030
akmhoque1fd8c1e2014-02-19 19:41:49 -060031 string getName()
32 {
33 return name;
34 }
akmhoque298385a2014-02-13 14:13:09 -060035
akmhoque1fd8c1e2014-02-19 19:41:49 -060036 Nhl& getNhl()
37 {
38 return nhl;
39 }
akmhoque298385a2014-02-13 14:13:09 -060040
akmhoque1fd8c1e2014-02-19 19:41:49 -060041 int getTimeToRefresh()
42 {
43 return timeToRefresh;
44 }
akmhoque85d88332014-02-17 21:11:21 -060045
akmhoque1fd8c1e2014-02-19 19:41:49 -060046 void setTimeToRefresh(int ttr)
47 {
48 timeToRefresh=ttr;
49 }
akmhoque85d88332014-02-17 21:11:21 -060050
akmhoque1fd8c1e2014-02-19 19:41:49 -060051 void setFeExpiringEventId(ndn::EventId feid)
52 {
53 feExpiringEventId=feid;
54 }
akmhoque85d88332014-02-17 21:11:21 -060055
akmhoque1fd8c1e2014-02-19 19:41:49 -060056 ndn::EventId getFeExpiringEventId()
57 {
58 return feExpiringEventId;
59 }
akmhoque85d88332014-02-17 21:11:21 -060060
akmhoque1fd8c1e2014-02-19 19:41:49 -060061 void setFeSeqNo(int fsn)
62 {
63 feSeqNo=fsn;
64 }
akmhoque298385a2014-02-13 14:13:09 -060065
akmhoque1fd8c1e2014-02-19 19:41:49 -060066 int getFeSeqNo()
67 {
68 return feSeqNo;
69 }
70
71 bool isEqualNextHops(Nhl &nhlOther);
72
73 private:
74 string name;
75 int timeToRefresh;
76 ndn::EventId feExpiringEventId;
77 int feSeqNo;
78 Nhl nhl;
79 };
80
81 ostream& operator<<(ostream& os, FibEntry& fe);
akmhoque298385a2014-02-13 14:13:09 -060082
akmhoqueb1710aa2014-02-19 17:13:36 -060083} //namespace nlsr
84
akmhoque298385a2014-02-13 14:13:09 -060085#endif