rib: reimplement auto prefix propagation based on readvertise
Change-Id: I6c4d81b829cf78084d26121c81d977d0a86c9a0c
Refs: #3819
diff --git a/rib/readvertise/nfd-rib-readvertise-destination.hpp b/rib/readvertise/nfd-rib-readvertise-destination.hpp
index ec71d98..d31e81b 100644
--- a/rib/readvertise/nfd-rib-readvertise-destination.hpp
+++ b/rib/readvertise/nfd-rib-readvertise-destination.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,7 +29,9 @@
#include "readvertise-destination.hpp"
#include "../rib.hpp"
+#include <ndn-cxx/mgmt/nfd/command-options.hpp>
#include <ndn-cxx/mgmt/nfd/controller.hpp>
+#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
namespace nfd {
namespace rib {
@@ -40,8 +42,11 @@
{
public:
NfdRibReadvertiseDestination(ndn::nfd::Controller& controller,
- const Name& commandPrefix,
- Rib& rib);
+ Rib& rib,
+ const ndn::nfd::CommandOptions& options = ndn::nfd::CommandOptions(),
+ const ndn::nfd::ControlParameters& parameters =
+ ndn::nfd::ControlParameters()
+ .setOrigin(ndn::nfd::ROUTE_ORIGIN_CLIENT));
/** \brief add a name prefix into NFD RIB
*/
@@ -57,6 +62,13 @@
std::function<void()> successCb,
std::function<void(const std::string&)> failureCb) override;
+protected:
+ ndn::nfd::ControlParameters
+ getControlParameters();
+
+ ndn::nfd::CommandOptions
+ getCommandOptions();
+
private:
void
handleRibInsert(const Name& name);
@@ -66,10 +78,12 @@
private:
ndn::nfd::Controller& m_controller;
- Name m_commandPrefix;
signal::ScopedConnection m_ribInsertConn;
signal::ScopedConnection m_ribEraseConn;
+
+ ndn::nfd::CommandOptions m_commandOptions;
+ ndn::nfd::ControlParameters m_controlParameters;
};
} // namespace rib