NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
nfd-controller.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_MANAGEMENT_NFD_CONTROLLER_HPP
23
#define NDN_MANAGEMENT_NFD_CONTROLLER_HPP
24
25
#include "
nfd-control-command.hpp
"
26
#include "../face.hpp"
27
#include "../security/key-chain.hpp"
28
#include "
nfd-command-options.hpp
"
29
30
namespace
ndn
{
31
namespace
nfd
{
32
41
class
Controller
: noncopyable
42
{
43
public
:
46
typedef
function<void(const ControlParameters&)>
CommandSucceedCallback
;
47
50
typedef
function
<void(uint32_t
/*code*/
,
const
std::string&
/*reason*/
)>
CommandFailCallback
;
51
55
Controller
(
Face
& face,
KeyChain
& keyChain);
56
59
template
<
typename
Command>
60
void
61
start
(
const
ControlParameters
& parameters,
62
const
CommandSucceedCallback
& onSuccess,
63
const
CommandFailCallback
& onFailure,
64
const
CommandOptions
& options =
CommandOptions
())
65
{
66
shared_ptr<ControlCommand> command = make_shared<Command>();
67
this->startCommand(command, parameters, onSuccess, onFailure, options);
68
}
69
70
private
:
71
void
72
startCommand(
const
shared_ptr<ControlCommand>& command,
73
const
ControlParameters
& parameters,
74
const
CommandSucceedCallback
& onSuccess,
75
const
CommandFailCallback
& onFailure,
76
const
CommandOptions
& options);
77
78
void
79
processCommandResponse(
const
Data
& data,
80
const
shared_ptr<ControlCommand>& command,
81
const
CommandSucceedCallback
& onSuccess,
82
const
CommandFailCallback
& onFailure);
83
84
public
:
88
static
const
uint32_t
ERROR_TIMEOUT
;
89
92
static
const
uint32_t
ERROR_SERVER
;
93
96
static
const
uint32_t
ERROR_LBOUND
;
97
98
protected
:
99
Face
&
m_face
;
100
KeyChain
&
m_keyChain
;
101
};
102
103
}
// namespace nfd
104
}
// namespace ndn
105
106
#endif // NDN_MANAGEMENT_NFD_CONTROLLER_HPP
ndn::nfd::Controller::start
void start(const ControlParameters ¶meters, const CommandSucceedCallback &onSuccess, const CommandFailCallback &onFailure, const CommandOptions &options=CommandOptions())
start command execution
Definition:
nfd-controller.hpp:61
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::nfd::ControlParameters
represents parameters in a ControlCommand request or response
Definition:
nfd-control-parameters.hpp:75
ndn::nfd::Controller::m_keyChain
KeyChain & m_keyChain
Definition:
nfd-controller.hpp:100
ndn::security::KeyChain
The packet signing interface.
Definition:
key-chain.hpp:48
nfd-control-command.hpp
ndn::nfd::Controller::ERROR_TIMEOUT
static const uint32_t ERROR_TIMEOUT
error code for timeout
Definition:
nfd-controller.hpp:88
ndn::nfd::Controller::CommandSucceedCallback
function< void(const ControlParameters &)> CommandSucceedCallback
a callback on command success
Definition:
nfd-controller.hpp:46
ndn::nfd::Controller::ERROR_LBOUND
static const uint32_t ERROR_LBOUND
inclusive lower bound of error codes
Definition:
nfd-controller.hpp:96
ndn::nfd::CommandOptions
contains options for ControlCommand execution
Definition:
nfd-command-options.hpp:39
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
ndn::Face
Abstraction to communicate with local or remote NDN forwarder.
Definition:
face.hpp:100
ndn::nfd::Controller
NFD Management protocol - ControlCommand client.
Definition:
nfd-controller.hpp:41
ndn::nfd::Controller::CommandFailCallback
function< void(uint32_t, const std::string &)> CommandFailCallback
a callback on command failure
Definition:
nfd-controller.hpp:50
ndn::nfd::Controller::Controller
Controller(Face &face, KeyChain &keyChain)
construct a Controller that uses face for transport, and uses the passed KeyChain to sign commands ...
Definition:
nfd-controller.cpp:32
nfd-command-options.hpp
ndn::nfd::Controller::m_face
Face & m_face
Definition:
nfd-controller.hpp:99
ndn::Data
represents a Data packet
Definition:
data.hpp:39
ndn::nfd::Controller::ERROR_SERVER
static const uint32_t ERROR_SERVER
error code for server error
Definition:
nfd-controller.hpp:92
ndnSIM
ndn-cxx
src
management
nfd-controller.hpp
Generated on Fri Feb 23 2018 12:30:54 for ndnSIM by
1.8.14