blob: d02d040dd27672bbf12eeb00f96f53108ecffed5 [file] [log] [blame]
akmhoque298385a2014-02-13 14:13:09 -06001#ifndef NLSR_FIB_HPP
2#define NLSR_FIB_HPP
3
4#include <list>
5#include "nlsr_fe.hpp"
6
7class nlsr;
8
9using namespace std;
akmhoque85d88332014-02-17 21:11:21 -060010using namespace ndn;
akmhoque298385a2014-02-13 14:13:09 -060011
12class Fib
13{
14public:
15 Fib()
16 {
17 }
18
akmhoque85d88332014-02-17 21:11:21 -060019 void removeFromFib(nlsr& pnlsr, string name);
20 void updateFib(nlsr& pnlsr, string name, Nhl& nextHopList, int maxFacesPerPrefix);
21 void cleanFib(nlsr& pnlsr);
akmhoque298385a2014-02-13 14:13:09 -060022 void setFibEntryRefreshTime(int fert)
23 {
24 fibEntryRefreshTime=fert;
25 }
26
27 void printFib();
28
29private:
30 void removeFibEntryHop(Nhl& nl, int doNotRemoveHopFaceId);
31 int getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix);
akmhoque85d88332014-02-17 21:11:21 -060032 ndn::EventId
33 scheduleFibEntryRefreshing(nlsr& pnlsr, string name, int feSeqNum, int refreshTime);
34 void cancelScheduledFeExpiringEvent(nlsr& pnlsr, EventId eid);
35 void refreshFibEntry(string name, int feSeqNum);
akmhoque298385a2014-02-13 14:13:09 -060036
37private:
38 std::list<FibEntry> fibTable;
39 int fibEntryRefreshTime;
40};
41
42#endif