| #ifndef NLSR_FIB_HPP |
| #define NLSR_FIB_HPP |
| |
| #include <list> |
| #include "fib-entry.hpp" |
| |
| namespace nlsr { |
| |
| class Nlsr; |
| |
| using namespace std; |
| using namespace ndn; |
| |
| class Fib |
| { |
| public: |
| Fib() |
| : m_table() |
| , m_refreshTime(0) |
| { |
| } |
| |
| void |
| remove(Nlsr& pnlsr, string name); |
| |
| void |
| update(Nlsr& pnlsr, string name, NexthopList& nextHopList); |
| |
| void |
| clean(Nlsr& pnlsr); |
| |
| void |
| setEntryRefreshTime(int fert) |
| { |
| m_refreshTime = fert; |
| } |
| |
| void |
| print(); |
| |
| private: |
| void |
| removeHop(Nlsr& pnlsr, NexthopList& nl, int doNotRemoveHopFaceId); |
| |
| int |
| getNumberOfFacesForName(NexthopList& nextHopList, int maxFacesPerPrefix); |
| |
| ndn::EventId |
| scheduleEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum, |
| int refreshTime); |
| void |
| cancelScheduledExpiringEvent(Nlsr& pnlsr, EventId eid); |
| |
| void |
| refreshEntry(string name, int feSeqNum); |
| |
| private: |
| std::list<FibEntry> m_table; |
| int m_refreshTime; |
| }; |
| |
| }//namespace nlsr |
| #endif //NLSR_FIB_HPP |