blob: 452e669e03e2685dbb0f6330742a0b0d4076d842 [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
akmhoque1a481092014-02-19 16:34:22 -06007class Nlsr;
akmhoque298385a2014-02-13 14:13:09 -06008
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
akmhoque1a481092014-02-19 16:34:22 -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
akmhoque1a481092014-02-19 16:34:22 -060033 scheduleFibEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum, int refreshTime);
34 void cancelScheduledFeExpiringEvent(Nlsr& pnlsr, EventId eid);
akmhoque85d88332014-02-17 21:11:21 -060035 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