NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::nfd::Controller Class Reference

NFD Management protocol client. More...

#include <controller.hpp>

Inheritance diagram for ndn::nfd::Controller:
Collaboration diagram for ndn::nfd::Controller:

Public Types

using CommandSucceedCallback = function< void(const ControlParameters &)>
 a callback on command success More...
 
using CommandFailCallback = function< void(const ControlResponse &)>
 a callback on command failure More...
 
using DatasetFailCallback = function< void(uint32_t code, const std::string &reason)>
 a callback on dataset retrieval failure More...
 

Public Member Functions

 Controller (Face &face, KeyChain &keyChain, security::Validator &validator=security::getAcceptAllValidator())
 construct a Controller that uses face for transport, and uses the passed KeyChain to sign commands More...
 
 ~Controller ()
 
template<typename Command >
void start (const ControlParameters &parameters, const CommandSucceedCallback &onSuccess, const CommandFailCallback &onFailure, const CommandOptions &options=CommandOptions())
 start command execution More...
 
template<typename Dataset >
std::enable_if_t< std::is_default_constructible< Dataset >::value > fetch (const std::function< void(typename Dataset::ResultType)> &onSuccess, const DatasetFailCallback &onFailure, const CommandOptions &options=CommandOptions())
 start dataset fetching More...
 
template<typename Dataset , typename ParamType = typename Dataset::ParamType>
void fetch (const ParamType &param, const std::function< void(typename Dataset::ResultType)> &onSuccess, const DatasetFailCallback &onFailure, const CommandOptions &options=CommandOptions())
 start dataset fetching More...
 

Static Public Attributes

static const uint32_t ERROR_TIMEOUT = 10060
 error code for timeout More...
 
static const uint32_t ERROR_NACK = 10800
 error code for network Nack More...
 
static const uint32_t ERROR_VALIDATION = 10021
 error code for response validation failure More...
 
static const uint32_t ERROR_SERVER = 500
 error code for server error More...
 
static const uint32_t ERROR_LBOUND = 400
 inclusive lower bound of error codes More...
 

Protected Attributes

Facem_face
 
KeyChain & m_keyChain
 
security::Validator & m_validator
 
security::InterestSigner m_signer
 
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED __pad0__: std::set<shared_ptr<util::SegmentFetcher>> m_fetchers
 

Detailed Description

NFD Management protocol client.

See also
https://redmine.named-data.net/projects/nfd/wiki/Management

Definition at line 51 of file controller.hpp.

Member Typedef Documentation

◆ CommandSucceedCallback

a callback on command success

Definition at line 56 of file controller.hpp.

◆ CommandFailCallback

a callback on command failure

Definition at line 60 of file controller.hpp.

◆ DatasetFailCallback

using ndn::nfd::Controller::DatasetFailCallback = function<void(uint32_t code, const std::string& reason)>

a callback on dataset retrieval failure

Definition at line 64 of file controller.hpp.

Constructor & Destructor Documentation

◆ Controller()

ndn::nfd::Controller::Controller ( Face face,
KeyChain &  keyChain,
security::Validator &  validator = security::getAcceptAllValidator() 
)

construct a Controller that uses face for transport, and uses the passed KeyChain to sign commands

Definition at line 39 of file controller.cpp.

◆ ~Controller()

Member Function Documentation

◆ start()

template<typename Command >
void ndn::nfd::Controller::start ( const ControlParameters parameters,
const CommandSucceedCallback onSuccess,
const CommandFailCallback onFailure,
const CommandOptions options = CommandOptions() 
)
inline

◆ fetch() [1/2]

template<typename Dataset >
std::enable_if_t<std::is_default_constructible<Dataset>::value> ndn::nfd::Controller::fetch ( const std::function< void(typename Dataset::ResultType)> &  onSuccess,
const DatasetFailCallback onFailure,
const CommandOptions options = CommandOptions() 
)
inline

start dataset fetching

Definition at line 90 of file controller.hpp.

Referenced by nfd::RibManager::slFindAnn().

◆ fetch() [2/2]

template<typename Dataset , typename ParamType = typename Dataset::ParamType>
void ndn::nfd::Controller::fetch ( const ParamType &  param,
const std::function< void(typename Dataset::ResultType)> &  onSuccess,
const DatasetFailCallback onFailure,
const CommandOptions options = CommandOptions() 
)
inline

start dataset fetching

Definition at line 101 of file controller.hpp.

Member Data Documentation

◆ ERROR_TIMEOUT

const uint32_t ndn::nfd::Controller::ERROR_TIMEOUT = 10060
static

error code for timeout

Definition at line 155 of file controller.hpp.

Referenced by nfd::rib::FibUpdater::computeAndSendFibUpdates(), and ~Controller().

◆ ERROR_NACK

const uint32_t ndn::nfd::Controller::ERROR_NACK = 10800
static

error code for network Nack

Definition at line 159 of file controller.hpp.

Referenced by ~Controller().

◆ ERROR_VALIDATION

const uint32_t ndn::nfd::Controller::ERROR_VALIDATION = 10021
static

error code for response validation failure

Definition at line 163 of file controller.hpp.

Referenced by ~Controller().

◆ ERROR_SERVER

const uint32_t ndn::nfd::Controller::ERROR_SERVER = 500
static

error code for server error

Definition at line 167 of file controller.hpp.

Referenced by ~Controller().

◆ ERROR_LBOUND

const uint32_t ndn::nfd::Controller::ERROR_LBOUND = 400
static

inclusive lower bound of error codes

Definition at line 171 of file controller.hpp.

Referenced by ~Controller().

◆ m_face

Face& ndn::nfd::Controller::m_face
protected

Definition at line 174 of file controller.hpp.

Referenced by ~Controller().

◆ m_keyChain

KeyChain& ndn::nfd::Controller::m_keyChain
protected

Definition at line 175 of file controller.hpp.

◆ m_validator

security::Validator& ndn::nfd::Controller::m_validator
protected

Definition at line 176 of file controller.hpp.

Referenced by ~Controller().

◆ m_signer

security::InterestSigner ndn::nfd::Controller::m_signer
protected

Definition at line 177 of file controller.hpp.

Referenced by ~Controller().

◆ __pad0__

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED ndn::nfd::Controller::__pad0__
protected

Definition at line 180 of file controller.hpp.


The documentation for this class was generated from the following files: