akmhoque | 298385a | 2014-02-13 14:13:09 -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); |
| 20 | void scheduleFibRefreshing(nlsr& pnlsr, int refreshTime); |
| 21 | void cleanFib(); |
| 22 | void setFibEntryRefreshTime(int fert) |
| 23 | { |
| 24 | fibEntryRefreshTime=fert; |
| 25 | } |
| 26 | |
| 27 | void printFib(); |
| 28 | |
| 29 | private: |
| 30 | void removeFibEntryHop(Nhl& nl, int doNotRemoveHopFaceId); |
| 31 | int getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix); |
| 32 | void refreshFib(nlsr& pnlsr); |
| 33 | |
| 34 | private: |
| 35 | std::list<FibEntry> fibTable; |
| 36 | int fibEntryRefreshTime; |
| 37 | }; |
| 38 | |
| 39 | #endif |