rib: Separate trust models for `/localhost` and `/localhop` RIB management commands
Change-Id: I10fd9a1c8a2e0e572ea28f6e97d57b0b5b9750c8
Refs: #1557
Refs: #1558
diff --git a/rib/rib-manager.hpp b/rib/rib-manager.hpp
index 4c2c344..1d542fb 100644
--- a/rib/rib-manager.hpp
+++ b/rib/rib-manager.hpp
@@ -46,10 +46,17 @@
class RibManager : noncopyable
{
public:
- RibManager();
+ class Error : public std::runtime_error
+ {
+ public:
+ explicit
+ Error(const std::string& what)
+ : std::runtime_error(what)
+ {
+ }
+ };
- void
- onRibRequest(const Interest& request);
+ RibManager();
void
registerWithNfd();
@@ -67,6 +74,12 @@
const std::string& filename);
void
+ onLocalhopRequest(const Interest& request);
+
+ void
+ onLocalhostRequest(const Interest& request);
+
+ void
sendResponse(const Name& name,
const ControlResponse& response);
@@ -131,8 +144,10 @@
ndn::Face m_face;
ndn::shared_ptr<ndn::nfd::Controller> m_nfdController;
ndn::KeyChain m_keyChain;
- ndn::ValidatorConfig m_validator;
+ ndn::ValidatorConfig m_localhostValidator;
+ ndn::ValidatorConfig m_localhopValidator;
FaceMonitor m_faceMonitor;
+ bool m_isLocalhopEnabled;
typedef boost::function<void(RibManager*,
const shared_ptr<const Interest>& request,