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; |
akmhoque | 85d8833 | 2014-02-17 21:11:21 -0600 | [diff] [blame^] | 10 | using namespace ndn; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 11 | |
| 12 | class Fib |
| 13 | { |
| 14 | public: |
| 15 | Fib() |
| 16 | { |
| 17 | } |
| 18 | |
akmhoque | 85d8833 | 2014-02-17 21:11:21 -0600 | [diff] [blame^] | 19 | void removeFromFib(nlsr& pnlsr, string name); |
| 20 | void updateFib(nlsr& pnlsr, string name, Nhl& nextHopList, int maxFacesPerPrefix); |
| 21 | void cleanFib(nlsr& pnlsr); |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 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); |
akmhoque | 85d8833 | 2014-02-17 21:11:21 -0600 | [diff] [blame^] | 32 | ndn::EventId |
| 33 | scheduleFibEntryRefreshing(nlsr& pnlsr, string name, int feSeqNum, int refreshTime); |
| 34 | void cancelScheduledFeExpiringEvent(nlsr& pnlsr, EventId eid); |
| 35 | void refreshFibEntry(string name, int feSeqNum); |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 36 | |
| 37 | private: |
| 38 | std::list<FibEntry> fibTable; |
| 39 | int fibEntryRefreshTime; |
| 40 | }; |
| 41 | |
| 42 | #endif |