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 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 10 | class Nlsr; |
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 11 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 12 | using namespace std; |
| 13 | using namespace ndn; |
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 14 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 15 | class Fib |
| 16 | { |
| 17 | public: |
| 18 | Fib() |
| 19 | : fibTable() |
| 20 | , fibEntryRefreshTime(0) |
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 21 | { |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 22 | } |
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 23 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 24 | void removeFromFib(Nlsr& pnlsr, string name); |
| 25 | void updateFib(Nlsr& pnlsr, string name, Nhl& nextHopList); |
| 26 | void cleanFib(Nlsr& pnlsr); |
| 27 | void setFibEntryRefreshTime(int fert) |
| 28 | { |
| 29 | fibEntryRefreshTime=fert; |
| 30 | } |
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 31 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 32 | void printFib(); |
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 33 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 34 | private: |
| 35 | void removeFibEntryHop(Nlsr& pnlsr, Nhl& nl, int doNotRemoveHopFaceId); |
| 36 | int getNumberOfFacesForName(Nhl& nextHopList, int maxFacesPerPrefix); |
| 37 | ndn::EventId |
| 38 | scheduleFibEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum, |
| 39 | int refreshTime); |
| 40 | void cancelScheduledFeExpiringEvent(Nlsr& pnlsr, EventId eid); |
| 41 | void refreshFibEntry(string name, int feSeqNum); |
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 42 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame] | 43 | private: |
| 44 | std::list<FibEntry> fibTable; |
| 45 | int fibEntryRefreshTime; |
| 46 | }; |
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 47 | |
| 48 | }//namespace nlsr |
| 49 | #endif |