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 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 7 | namespace nlsr |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 8 | { |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 9 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 10 | class Nlsr; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 11 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 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 | }; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 46 | |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 47 | }//namespace nlsr |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 48 | #endif |