akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 1 | #ifndef NLSR_FIB_HPP |
| 2 | #define NLSR_FIB_HPP |
| 3 | |
| 4 | #include <list> |
| 5 | #include "fib-entry.hpp" |
| 6 | |
| 7 | namespace nlsr { |
| 8 | |
| 9 | class Nlsr; |
| 10 | |
| 11 | using namespace std; |
| 12 | using namespace ndn; |
| 13 | |
| 14 | class Fib |
| 15 | { |
| 16 | public: |
| 17 | Fib() |
| 18 | : m_table() |
| 19 | , m_refreshTime(0) |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | void |
| 24 | remove(Nlsr& pnlsr, string name); |
| 25 | |
| 26 | void |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 27 | update(Nlsr& pnlsr, string name, NexthopList& nextHopList); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 28 | |
| 29 | void |
| 30 | clean(Nlsr& pnlsr); |
| 31 | |
| 32 | void |
| 33 | setEntryRefreshTime(int fert) |
| 34 | { |
| 35 | m_refreshTime = fert; |
| 36 | } |
| 37 | |
| 38 | void |
| 39 | print(); |
| 40 | |
| 41 | private: |
| 42 | void |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 43 | removeHop(Nlsr& pnlsr, NexthopList& nl, int doNotRemoveHopFaceId); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 44 | |
| 45 | int |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 46 | getNumberOfFacesForName(NexthopList& nextHopList, int maxFacesPerPrefix); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 47 | |
| 48 | ndn::EventId |
| 49 | scheduleEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum, |
| 50 | int refreshTime); |
| 51 | void |
| 52 | cancelScheduledExpiringEvent(Nlsr& pnlsr, EventId eid); |
| 53 | |
| 54 | void |
| 55 | refreshEntry(string name, int feSeqNum); |
| 56 | |
| 57 | private: |
| 58 | std::list<FibEntry> m_table; |
| 59 | int m_refreshTime; |
| 60 | }; |
| 61 | |
| 62 | }//namespace nlsr |
| 63 | #endif //NLSR_FIB_HPP |