blob: d93d97257dcdc7582674cfe0eb99cba05e1a5835 [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
akmhoque1fd8c1e2014-02-19 19:41:49 -06007namespace nlsr
akmhoque298385a2014-02-13 14:13:09 -06008{
akmhoque298385a2014-02-13 14:13:09 -06009
akmhoque1fd8c1e2014-02-19 19:41:49 -060010 class Nlsr;
akmhoque298385a2014-02-13 14:13:09 -060011
akmhoque1fd8c1e2014-02-19 19:41:49 -060012 using namespace std;
13 using namespace ndn;
14
15 class Fib
16 {
17 public:
18 Fib()
19 {
20 }
21
22 void removeFromFib(Nlsr& pnlsr, string name);
23 void updateFib(Nlsr& pnlsr, string name, Nhl& nextHopList,
24 int maxFacesPerPrefix);
25 void cleanFib(Nlsr& pnlsr);
26 void setFibEntryRefreshTime(int fert)
27 {
28 fibEntryRefreshTime=fert;
29 }
30
31 void printFib();
32
33 private:
34 void removeFibEntryHop(Nhl& nl, int doNotRemoveHopFaceId);
35 int getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix);
36 ndn::EventId
37 scheduleFibEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum,
38 int refreshTime);
39 void cancelScheduledFeExpiringEvent(Nlsr& pnlsr, EventId eid);
40 void refreshFibEntry(string name, int feSeqNum);
41
42 private:
43 std::list<FibEntry> fibTable;
44 int fibEntryRefreshTime;
45 };
akmhoque298385a2014-02-13 14:13:09 -060046
akmhoqueb1710aa2014-02-19 17:13:36 -060047}//namespace nlsr
akmhoque298385a2014-02-13 14:13:09 -060048#endif