akmhoque | 62a8e40 | 2014-02-08 12:00:27 -0600 | [diff] [blame] | 1 | #ifndef NLSR_FIB_HPP |
| 2 | #define NLSR_FIB_HPP |
| 3 | |
| 4 | #include <list> |
| 5 | #include "nlsr_fe.hpp" |
| 6 | |
| 7 | class nlsr; |
| 8 | |
| 9 | using namespace std; |
| 10 | |
| 11 | class Fib |
| 12 | { |
| 13 | public: |
| 14 | Fib() |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | void removeFromFib(string name); |
| 19 | void updateFib(string name, Nhl& nextHopList, int maxFacesPerPrefix); |
akmhoque | e77d814 | 2014-02-11 11:59:57 -0600 | [diff] [blame] | 20 | void scheduleFibRefreshing(nlsr& pnlsr, int refreshTime); |
akmhoque | 62a8e40 | 2014-02-08 12:00:27 -0600 | [diff] [blame] | 21 | void cleanFib(); |
akmhoque | e77d814 | 2014-02-11 11:59:57 -0600 | [diff] [blame] | 22 | void setFibEntryRefreshTime(int fert) |
| 23 | { |
| 24 | fibEntryRefreshTime=fert; |
| 25 | } |
| 26 | |
akmhoque | 62a8e40 | 2014-02-08 12:00:27 -0600 | [diff] [blame] | 27 | void printFib(); |
| 28 | |
| 29 | private: |
akmhoque | e77d814 | 2014-02-11 11:59:57 -0600 | [diff] [blame] | 30 | void removeFibEntryHop(Nhl& nl, int doNotRemoveHopFaceId); |
akmhoque | 62a8e40 | 2014-02-08 12:00:27 -0600 | [diff] [blame] | 31 | int getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix); |
akmhoque | e77d814 | 2014-02-11 11:59:57 -0600 | [diff] [blame] | 32 | void refreshFib(nlsr& pnlsr); |
akmhoque | 62a8e40 | 2014-02-08 12:00:27 -0600 | [diff] [blame] | 33 | |
| 34 | private: |
| 35 | std::list<FibEntry> fibTable; |
akmhoque | e77d814 | 2014-02-11 11:59:57 -0600 | [diff] [blame] | 36 | int fibEntryRefreshTime; |
akmhoque | 62a8e40 | 2014-02-08 12:00:27 -0600 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | #endif |