blob: 99fd84599ff3236b345a140c55a120e8559f4621 [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
akmhoqueb1710aa2014-02-19 17:13:36 -06007namespace nlsr {
8
akmhoque1a481092014-02-19 16:34:22 -06009class Nlsr;
akmhoque298385a2014-02-13 14:13:09 -060010
11using namespace std;
akmhoque85d88332014-02-17 21:11:21 -060012using namespace ndn;
akmhoque298385a2014-02-13 14:13:09 -060013
14class Fib
15{
16public:
17 Fib()
18 {
19 }
20
akmhoque1a481092014-02-19 16:34:22 -060021 void removeFromFib(Nlsr& pnlsr, string name);
22 void updateFib(Nlsr& pnlsr, string name, Nhl& nextHopList, int maxFacesPerPrefix);
23 void cleanFib(Nlsr& pnlsr);
akmhoque298385a2014-02-13 14:13:09 -060024 void setFibEntryRefreshTime(int fert)
25 {
26 fibEntryRefreshTime=fert;
27 }
28
29 void printFib();
30
31private:
32 void removeFibEntryHop(Nhl& nl, int doNotRemoveHopFaceId);
33 int getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix);
akmhoque85d88332014-02-17 21:11:21 -060034 ndn::EventId
akmhoque1a481092014-02-19 16:34:22 -060035 scheduleFibEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum, int refreshTime);
36 void cancelScheduledFeExpiringEvent(Nlsr& pnlsr, EventId eid);
akmhoque85d88332014-02-17 21:11:21 -060037 void refreshFibEntry(string name, int feSeqNum);
akmhoque298385a2014-02-13 14:13:09 -060038
39private:
40 std::list<FibEntry> fibTable;
41 int fibEntryRefreshTime;
42};
43
akmhoqueb1710aa2014-02-19 17:13:36 -060044}//namespace nlsr
akmhoque298385a2014-02-13 14:13:09 -060045#endif