blob: 453b7db15ac7c3e8ae536306c0bac7b40aa3b88f [file] [log] [blame]
akmhoque62a8e402014-02-08 12:00:27 -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;
10
11class Fib
12{
13public:
14 Fib()
15 {
16 }
17
18 void removeFromFib(string name);
19 void updateFib(string name, Nhl& nextHopList, int maxFacesPerPrefix);
akmhoquee77d8142014-02-11 11:59:57 -060020 void scheduleFibRefreshing(nlsr& pnlsr, int refreshTime);
akmhoque62a8e402014-02-08 12:00:27 -060021 void cleanFib();
akmhoquee77d8142014-02-11 11:59:57 -060022 void setFibEntryRefreshTime(int fert)
23 {
24 fibEntryRefreshTime=fert;
25 }
26
akmhoque62a8e402014-02-08 12:00:27 -060027 void printFib();
28
29private:
akmhoquee77d8142014-02-11 11:59:57 -060030 void removeFibEntryHop(Nhl& nl, int doNotRemoveHopFaceId);
akmhoque62a8e402014-02-08 12:00:27 -060031 int getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix);
akmhoquee77d8142014-02-11 11:59:57 -060032 void refreshFib(nlsr& pnlsr);
akmhoque62a8e402014-02-08 12:00:27 -060033
34private:
35 std::list<FibEntry> fibTable;
akmhoquee77d8142014-02-11 11:59:57 -060036 int fibEntryRefreshTime;
akmhoque62a8e402014-02-08 12:00:27 -060037};
38
39#endif