blob: edd77ab5b8c8b672f94719402eb990dc14c62c93 [file] [log] [blame]
akmhoqueba094742014-02-28 11:47:21 -06001#ifndef NLSR_FE_HPP
2#define NLSR_FE_HPP
3
4#include<list>
5#include <iostream>
6#include <ndn-cpp-dev/util/scheduler.hpp>
7
8#include "nlsr_nexthop.hpp"
9#include "nlsr_nhl.hpp"
10
11namespace nlsr
12{
13
akmhoque5a44dd42014-03-12 18:11:32 -050014 using namespace std;
akmhoqueba094742014-02-28 11:47:21 -060015
akmhoque5a44dd42014-03-12 18:11:32 -050016 class FibEntry
17 {
18 public:
19 FibEntry()
20 : name()
21 , timeToRefresh(0)
22 , feSeqNo(0)
23 , nhl()
akmhoqueba094742014-02-28 11:47:21 -060024 {
akmhoque5a44dd42014-03-12 18:11:32 -050025 }
akmhoqueba094742014-02-28 11:47:21 -060026
akmhoque5a44dd42014-03-12 18:11:32 -050027 FibEntry(string n)
28 : timeToRefresh(0)
29 , feSeqNo(0)
30 , nhl()
31 {
32 name=n;
33 }
akmhoqueba094742014-02-28 11:47:21 -060034
akmhoque5a44dd42014-03-12 18:11:32 -050035 string getName()
36 {
37 return name;
38 }
akmhoqueba094742014-02-28 11:47:21 -060039
akmhoque5a44dd42014-03-12 18:11:32 -050040 Nhl& getNhl()
41 {
42 return nhl;
43 }
akmhoqueba094742014-02-28 11:47:21 -060044
akmhoque5a44dd42014-03-12 18:11:32 -050045 int getTimeToRefresh()
46 {
47 return timeToRefresh;
48 }
akmhoqueba094742014-02-28 11:47:21 -060049
akmhoque5a44dd42014-03-12 18:11:32 -050050 void setTimeToRefresh(int ttr)
51 {
52 timeToRefresh=ttr;
53 }
akmhoqueba094742014-02-28 11:47:21 -060054
akmhoque5a44dd42014-03-12 18:11:32 -050055 void setFeExpiringEventId(ndn::EventId feid)
56 {
57 feExpiringEventId=feid;
58 }
akmhoqueba094742014-02-28 11:47:21 -060059
akmhoque5a44dd42014-03-12 18:11:32 -050060 ndn::EventId getFeExpiringEventId()
61 {
62 return feExpiringEventId;
63 }
akmhoqueba094742014-02-28 11:47:21 -060064
akmhoque5a44dd42014-03-12 18:11:32 -050065 void setFeSeqNo(int fsn)
66 {
67 feSeqNo=fsn;
68 }
akmhoqueba094742014-02-28 11:47:21 -060069
akmhoque5a44dd42014-03-12 18:11:32 -050070 int getFeSeqNo()
71 {
72 return feSeqNo;
73 }
akmhoqueba094742014-02-28 11:47:21 -060074
akmhoque5a44dd42014-03-12 18:11:32 -050075 bool isEqualNextHops(Nhl &nhlOther);
akmhoqueba094742014-02-28 11:47:21 -060076
akmhoque5a44dd42014-03-12 18:11:32 -050077 private:
78 string name;
79 int timeToRefresh;
80 ndn::EventId feExpiringEventId;
81 int feSeqNo;
82 Nhl nhl;
83 };
akmhoqueba094742014-02-28 11:47:21 -060084
akmhoque5a44dd42014-03-12 18:11:32 -050085 ostream& operator<<(ostream& os,FibEntry fe);
akmhoqueba094742014-02-28 11:47:21 -060086
87} //namespace nlsr
88
89#endif