31 const std::string& module)
32 : m_dispatcher(dispatcher)
40 return ndn::PartialName(m_module).append(verb);
46 const std::string& module)
48 , m_namePrefixList(namePrefixList)
55 const ndn::Interest& interest,
56 const ndn::mgmt::ControlParameters& parameters,
57 const ndn::mgmt::CommandContinuation& done)
59 const ndn::nfd::ControlParameters& castParams =
60 static_cast<const ndn::nfd::ControlParameters&
>(parameters);
64 NLSR_LOG_INFO(
"Advertising/Inserting name: " << castParams.getName() <<
"\n");
66 return done(ndn::nfd::ControlResponse(200,
"OK").setBody(parameters.wireEncode()));
69 return done(ndn::nfd::ControlResponse(204,
"Prefix is already advetised/inserted.").setBody(parameters.wireEncode()));
74 const ndn::Interest& interest,
75 const ndn::mgmt::ControlParameters& parameters,
76 const ndn::mgmt::CommandContinuation& done)
78 const ndn::nfd::ControlParameters& castParams =
79 static_cast<const ndn::nfd::ControlParameters&
>(parameters);
83 NLSR_LOG_INFO(
"Withdrawing/Removing name: " << castParams.getName() <<
"\n");
85 return done(ndn::nfd::ControlResponse(200,
"OK").setBody(parameters.wireEncode()));
88 return done(ndn::nfd::ControlResponse(204,
"Prefix is already withdrawn/removed.").setBody(parameters.wireEncode()));
bool remove(const ndn::Name &name, const std::string &source="")
removes name from NamePrefixList
bool insert(const ndn::Name &name, const std::string &source="")
inserts name into NamePrefixList
void advertiseAndInsertPrefix(const ndn::Name &prefix, const ndn::Interest &interest, const ndn::mgmt::ControlParameters ¶meters, const ndn::mgmt::CommandContinuation &done)
add desired name prefix to the advertised name prefix list or insert a prefix into the FIB if paramet...
#define INIT_LOGGER(name)
ManagerBase(ndn::mgmt::Dispatcher &m_dispatcher, const std::string &module)
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
CommandManagerBase(ndn::mgmt::Dispatcher &m_dispatcher, NamePrefixList &m_namePrefixList, Lsdb &lsdb, const std::string &module)
void withdrawAndRemovePrefix(const ndn::Name &prefix, const ndn::Interest &interest, const ndn::mgmt::ControlParameters ¶meters, const ndn::mgmt::CommandContinuation &done)
remove desired name prefix from the advertised name prefix list or remove a prefix from the FIB if pa...
bool buildAndInstallOwnNameLsa()
Builds a name LSA for this router and then installs it into the LSDB.
ndn::PartialName makeRelPrefix(const std::string &verb) const
generate the relative prefix for a handler by appending the verb name to the module name ...
NamePrefixList & m_namePrefixList