blob: 4a80c489762dc94e376f14581604cc933299af88 [file] [log] [blame]
akmhoque53353462014-04-22 08:43:45 -05001#ifndef NLSR_FIB_HPP
2#define NLSR_FIB_HPP
3
4#include <list>
5#include "fib-entry.hpp"
6
7namespace nlsr {
8
9class Nlsr;
10
11using namespace std;
12using namespace ndn;
13
14class Fib
15{
16public:
17 Fib()
18 : m_table()
19 , m_refreshTime(0)
20 {
21 }
22
23 void
24 remove(Nlsr& pnlsr, string name);
25
26 void
akmhoquec8a10f72014-04-25 18:42:55 -050027 update(Nlsr& pnlsr, string name, NexthopList& nextHopList);
akmhoque53353462014-04-22 08:43:45 -050028
29 void
30 clean(Nlsr& pnlsr);
31
32 void
33 setEntryRefreshTime(int fert)
34 {
35 m_refreshTime = fert;
36 }
37
38 void
39 print();
40
41private:
42 void
akmhoquec8a10f72014-04-25 18:42:55 -050043 removeHop(Nlsr& pnlsr, NexthopList& nl, int doNotRemoveHopFaceId);
akmhoque53353462014-04-22 08:43:45 -050044
45 int
akmhoquec8a10f72014-04-25 18:42:55 -050046 getNumberOfFacesForName(NexthopList& nextHopList, int maxFacesPerPrefix);
akmhoque53353462014-04-22 08:43:45 -050047
48 ndn::EventId
49 scheduleEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum,
50 int refreshTime);
51 void
52 cancelScheduledExpiringEvent(Nlsr& pnlsr, EventId eid);
53
54 void
55 refreshEntry(string name, int feSeqNum);
56
57private:
58 std::list<FibEntry> m_table;
59 int m_refreshTime;
60};
61
62}//namespace nlsr
63#endif //NLSR_FIB_HPP