src: Renaming class to spell out them (Adl, Nhl, Npl, Npt, Npte)
Refs: #1534
Change-Id: If4a205e8ad2419505cc796027a5c863471ef5439
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index 4a80c48..2a90fc1 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -2,35 +2,41 @@
#define NLSR_FIB_HPP
#include <list>
+#include <boost/cstdint.hpp>
+
+#include <ndn-cxx/management/nfd-controller.hpp>
+
#include "fib-entry.hpp"
namespace nlsr {
class Nlsr;
-using namespace std;
-using namespace ndn;
class Fib
{
public:
- Fib()
+ Fib(ndn::Face& face)
: m_table()
, m_refreshTime(0)
+ , m_controller(face)
+ {
+ }
+ ~Fib()
{
}
void
- remove(Nlsr& pnlsr, string name);
+ remove(Nlsr& pnlsr, const std::string& name);
void
- update(Nlsr& pnlsr, string name, NexthopList& nextHopList);
+ update(Nlsr& pnlsr, const std::string& name, NexthopList& nextHopList);
void
clean(Nlsr& pnlsr);
void
- setEntryRefreshTime(int fert)
+ setEntryRefreshTime(int32_t fert)
{
m_refreshTime = fert;
}
@@ -40,23 +46,38 @@
private:
void
- removeHop(Nlsr& pnlsr, NexthopList& nl, int doNotRemoveHopFaceId);
+ removeHop(Nlsr& pnlsr, NexthopList& nl, uint32_t doNotRemoveHopFaceId,
+ const std::string& name);
int
- getNumberOfFacesForName(NexthopList& nextHopList, int maxFacesPerPrefix);
+ getNumberOfFacesForName(NexthopList& nextHopList, uint32_t maxFacesPerPrefix);
ndn::EventId
- scheduleEntryRefreshing(Nlsr& pnlsr, string name, int feSeqNum,
- int refreshTime);
- void
- cancelScheduledExpiringEvent(Nlsr& pnlsr, EventId eid);
+ scheduleEntryRefreshing(Nlsr& pnlsr, const std::string& name, int32_t feSeqNum,
+ int32_t refreshTime);
void
- refreshEntry(string name, int feSeqNum);
+ cancelScheduledExpiringEvent(Nlsr& pnlsr, ndn::EventId eid);
+
+ void
+ refreshEntry(Nlsr& nlsr, const std::string& name, int32_t feSeqNum);
+
+ void
+ registerPrefixInNfd(const std::string& namePrefix, uint64_t faceId, uint64_t faceCost);
+
+ void
+ unregisterPrefixFromNfd(const std::string& namePrefix, uint64_t faceId);
+
+ void
+ onSuccess(const ndn::nfd::ControlParameters& commandSuccessResult, const std::string& message);
+
+ void
+ onFailure(uint32_t code, const std::string& error, const std::string& message);
private:
std::list<FibEntry> m_table;
- int m_refreshTime;
+ int32_t m_refreshTime;
+ ndn::nfd::Controller m_controller;
};
}//namespace nlsr