nfd-rib-command-processor.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
23 #include "logger.hpp"
24 
25 namespace nlsr {
26 namespace update {
27 
28 INIT_LOGGER("NfdRibProcessor");
29 
30 NfdRibCommandProcessor::NfdRibCommandProcessor(ndn::mgmt::Dispatcher& dispatcher,
31  NamePrefixList& namePrefixList,
32  Lsdb& lsdb)
33  : CommandManagerBase(dispatcher, namePrefixList, lsdb, "rib")
34 {
35  m_dispatcher.addControlCommand<ndn::nfd::ControlParameters>(makeRelPrefix("register"),
36  ndn::mgmt::makeAcceptAllAuthorization(),
37  std::bind(&NfdRibCommandProcessor::validateParameters<NfdRibRegisterCommand>, this, _1),
38  bind(&NfdRibCommandProcessor::advertiseAndInsertPrefix, this, _1, _2, _3, _4));
39 
40  m_dispatcher.addControlCommand<ndn::nfd::ControlParameters>(makeRelPrefix("unregister"),
41  ndn::mgmt::makeAcceptAllAuthorization(),
42  std::bind(&NfdRibCommandProcessor::validateParameters<NfdRibUnregisterCommand>, this, _1),
43  bind(&NfdRibCommandProcessor::withdrawAndRemovePrefix, this, _1, _2, _3, _4));
44 }
45 
46 } // namespace update
47 } // namespace nlsr
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California.
void advertiseAndInsertPrefix(const ndn::Name &prefix, const ndn::Interest &interest, const ndn::mgmt::ControlParameters &parameters, 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)
Definition: logger.hpp:35
NfdRibCommandProcessor(ndn::mgmt::Dispatcher &dispatcher, NamePrefixList &namePrefixList, Lsdb &lsdb)
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
void withdrawAndRemovePrefix(const ndn::Name &prefix, const ndn::Interest &interest, const ndn::mgmt::ControlParameters &parameters, const ndn::mgmt::CommandContinuation &done)
remove desired name prefix from the advertised name prefix list or remove a prefix from the FIB if pa...
ndn::PartialName makeRelPrefix(const std::string &verb) const
generate the relative prefix for a handler by appending the verb name to the module name ...
ndn::mgmt::Dispatcher & m_dispatcher