akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame^] | 1 | #ifndef NLSR_FIB_HPP |
| 2 | #define NLSR_FIB_HPP |
| 3 | |
| 4 | #include <list> |
| 5 | #include "nlsr_fe.hpp" |
| 6 | |
| 7 | namespace nlsr |
| 8 | { |
| 9 | |
| 10 | class Nlsr; |
| 11 | |
| 12 | 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 | }; |
| 46 | |
| 47 | }//namespace nlsr |
| 48 | #endif |