a client-side face for unit testing More...
#include <dummy-client-face.hpp>
Classes | |
class | Options |
options for DummyClientFace More... | |
class | Transport |
Public Member Functions | |
DummyClientFace (const Options &options=Options()) | |
Create a dummy face with internal IO service. More... | |
DummyClientFace (KeyChain &keyChain, const Options &options=Options()) | |
Create a dummy face with internal IO service and the specified KeyChain. More... | |
DummyClientFace (boost::asio::io_service &ioService, const Options &options=Options()) | |
Create a dummy face with the provided IO service. More... | |
DummyClientFace (boost::asio::io_service &ioService, KeyChain &keyChain, const Options &options=Options()) | |
Create a dummy face with the provided IO service and the specified KeyChain. More... | |
template<typename Packet > | |
void | receive (const Packet &packet) |
cause the Face to receive a packet More... | |
template<> | |
void | receive (const lp::Nack &nack) |
Public Member Functions inherited from ndn::Face | |
Face (shared_ptr< Transport > transport=nullptr) | |
Create Face using given transport (or default transport if omitted) More... | |
Face (boost::asio::io_service &ioService) | |
Create Face using default transport and given io_service. More... | |
Face (shared_ptr< Transport > transport, KeyChain &keyChain) | |
Create Face using given transport and KeyChain. More... | |
Face (shared_ptr< Transport > transport, boost::asio::io_service &ioService) | |
Create Face using given transport and IO service. More... | |
Face (shared_ptr< Transport > transport, boost::asio::io_service &ioService, KeyChain &keyChain) | |
Create a new Face using given Transport and IO service. More... | |
~Face () | |
const PendingInterestId * | expressInterest (const Interest &interest, const DataCallback &afterSatisfied, const NackCallback &afterNacked, const TimeoutCallback &afterTimeout) |
Express Interest. More... | |
const PendingInterestId * | expressInterest (const Interest &interest, const OnData &onData, const OnTimeout &onTimeout=nullptr) |
Express Interest. More... | |
const PendingInterestId * | expressInterest (const Name &name, const Interest &tmpl, const OnData &onData, const OnTimeout &onTimeout=nullptr) |
Express Interest using name and Interest template. More... | |
void | removePendingInterest (const PendingInterestId *pendingInterestId) |
Cancel previously expressed Interest. More... | |
void | removeAllPendingInterests () |
Cancel all previously expressed Interests. More... | |
size_t | getNPendingInterests () const |
Get number of pending Interests. More... | |
const RegisteredPrefixId * | setInterestFilter (const InterestFilter &interestFilter, const InterestCallback &onInterest, const RegisterPrefixFailureCallback &onFailure, const security::SigningInfo &signingInfo=security::SigningInfo(), uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT) |
Set InterestFilter to dispatch incoming matching interest to onInterest callback and register the filtered prefix with the connected NDN forwarder. More... | |
const RegisteredPrefixId * | setInterestFilter (const InterestFilter &interestFilter, const InterestCallback &onInterest, const RegisterPrefixSuccessCallback &onSuccess, const RegisterPrefixFailureCallback &onFailure, const security::SigningInfo &signingInfo=security::SigningInfo(), uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT) |
Set InterestFilter to dispatch incoming matching interest to onInterest callback and register the filtered prefix with the connected NDN forwarder. More... | |
const InterestFilterId * | setInterestFilter (const InterestFilter &interestFilter, const InterestCallback &onInterest) |
Set InterestFilter to dispatch incoming matching interest to onInterest callback. More... | |
DEPRECATED (const RegisteredPrefixId *setInterestFilter(const InterestFilter &interestFilter, const OnInterest &onInterest, const RegisterPrefixSuccessCallback &onSuccess, const RegisterPrefixFailureCallback &onFailure, const security::v1::IdentityCertificate &certificate, uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT)) | |
Set InterestFilter to dispatch incoming matching interest to onInterest callback and register the filtered prefix with the connected NDN forwarder. More... | |
DEPRECATED (const RegisteredPrefixId *setInterestFilter(const InterestFilter &interestFilter, const OnInterest &onInterest, const RegisterPrefixFailureCallback &onFailure, const security::v1::IdentityCertificate &certificate, uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT)) | |
Set InterestFilter to dispatch incoming matching interest to onInterest callback and register the filtered prefix with the connected NDN forwarder. More... | |
DEPRECATED (const RegisteredPrefixId *setInterestFilter(const InterestFilter &interestFilter, const OnInterest &onInterest, const RegisterPrefixSuccessCallback &onSuccess, const RegisterPrefixFailureCallback &onFailure, const Name &identity, uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT)) | |
Set InterestFilter to dispatch incoming matching interest to onInterest callback and register the filtered prefix with the connected NDN forwarder. More... | |
DEPRECATED (const RegisteredPrefixId *setInterestFilter(const InterestFilter &interestFilter, const OnInterest &onInterest, const RegisterPrefixFailureCallback &onFailure, const Name &identity, uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT)) | |
Set InterestFilter to dispatch incoming matching interest to onInterest callback and register the filtered prefix with the connected NDN forwarder. More... | |
const RegisteredPrefixId * | registerPrefix (const Name &prefix, const RegisterPrefixSuccessCallback &onSuccess, const RegisterPrefixFailureCallback &onFailure, const security::SigningInfo &signingInfo=security::SigningInfo(), uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT) |
Register prefix with the connected NDN forwarder. More... | |
DEPRECATED (const RegisteredPrefixId *registerPrefix(const Name &prefix, const RegisterPrefixSuccessCallback &onSuccess, const RegisterPrefixFailureCallback &onFailure, const security::v1::IdentityCertificate &certificate, uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT)) | |
Register prefix with the connected NDN forwarder. More... | |
DEPRECATED (const RegisteredPrefixId *registerPrefix(const Name &prefix, const RegisterPrefixSuccessCallback &onSuccess, const RegisterPrefixFailureCallback &onFailure, const Name &identity, uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT)) | |
Register prefix with the connected NDN forwarder and call onInterest when a matching interest is received. More... | |
void | unsetInterestFilter (const RegisteredPrefixId *registeredPrefixId) |
Remove the registered prefix entry with the registeredPrefixId. More... | |
void | unsetInterestFilter (const InterestFilterId *interestFilterId) |
Remove previously set InterestFilter from library's FIB. More... | |
void | unregisterPrefix (const RegisteredPrefixId *registeredPrefixId, const UnregisterPrefixSuccessCallback &onSuccess, const UnregisterPrefixFailureCallback &onFailure) |
Unregister prefix from RIB. More... | |
void | put (const Data &data) |
Publish data packet. More... | |
void | put (const lp::Nack &nack) |
sends a Network NACK More... | |
void | processEvents (const time::milliseconds &timeout=time::milliseconds::zero(), bool keepThread=false) |
Process any data to receive or call timeout callbacks. More... | |
void | shutdown () |
Shutdown face operations. More... | |
boost::asio::io_service & | getIoService () |
Return nullptr (cannot use IoService in simulations), preserved for API compatibility. More... | |
Public Attributes | |
std::vector< Interest > | sentInterests |
Interests sent out of this DummyClientFace. More... | |
std::vector< Data > | sentData |
Data sent out of this DummyClientFace. More... | |
std::vector< lp::Nack > | sentNacks |
Nacks sent out of this DummyClientFace. More... | |
Signal< DummyClientFace, Interest > | onSendInterest |
emits whenever an Interest is sent More... | |
Signal< DummyClientFace, Data > | onSendData |
emits whenever a Data packet is sent More... | |
Signal< DummyClientFace, lp::Nack > | onSendNack |
emits whenever a Nack is sent More... | |
Public Attributes inherited from ndn::Face | |
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED | __pad0__: shared_ptr<Transport> getTransport() |
Additional Inherited Members |
a client-side face for unit testing
Definition at line 34 of file dummy-client-face.hpp.
Create a dummy face with internal IO service.
Definition at line 87 of file dummy-client-face.cpp.
|
explicit |
Create a dummy face with internal IO service and the specified KeyChain.
Definition at line 95 of file dummy-client-face.cpp.
|
explicit |
Create a dummy face with the provided IO service.
Definition at line 103 of file dummy-client-face.cpp.
ndn::util::DummyClientFace::DummyClientFace | ( | boost::asio::io_service & | ioService, |
KeyChain & | keyChain, | ||
const Options & | options = Options() |
||
) |
Create a dummy face with the provided IO service and the specified KeyChain.
Definition at line 112 of file dummy-client-face.cpp.
References ndn::Block::blockFromValue(), ndn::Transport::connect(), ndn::tlv::Data, ndn::util::DummyClientFace::Options::enablePacketLogging, ndn::util::DummyClientFace::Options::enableRegistrationReply, ndn::Name::get(), ndn::Face::getIoService(), ndn::Interest::getName(), ndn::Name::isPrefixOf(), onSendData, onSendInterest, onSendNack, ndn::util::DummyClientFace::Options::processEventsOverride, receive(), sentData, sentInterests, sentNacks, ndn::mgmt::ControlResponse::setBody(), ndn::mgmt::ControlResponse::setCode(), ndn::nfd::ControlParameters::setCost(), ndn::nfd::ControlParameters::setFaceId(), ndn::nfd::ControlParameters::setOrigin(), ndn::security::KeyChain::sign(), ndn::security::SigningInfo::SIGNER_TYPE_SHA256, and ndn::mgmt::ControlResponse::wireEncode().
template void ndn::util::DummyClientFace::receive< Data > | ( | const Packet & | packet | ) |
cause the Face to receive a packet
Definition at line 232 of file dummy-client-face.cpp.
Referenced by DummyClientFace(), and ndn::util::DummyClientFace::receive< lp::Nack >().
void ndn::util::DummyClientFace::receive | ( | const lp::Nack & | nack | ) |
std::vector<Interest> ndn::util::DummyClientFace::sentInterests |
Interests sent out of this DummyClientFace.
Sent Interests are appended to this container if options.enablePacketLogger is true. User of this class is responsible for cleaning up the container, if necessary. After .expressInterest, .processEvents must be called before the Interest would show up here.
Definition at line 124 of file dummy-client-face.hpp.
Referenced by DummyClientFace().
std::vector<Data> ndn::util::DummyClientFace::sentData |
Data sent out of this DummyClientFace.
Sent Data are appended to this container if options.enablePacketLogger is true. User of this class is responsible for cleaning up the container, if necessary. After .put, .processEvents must be called before the Data would show up here.
Definition at line 132 of file dummy-client-face.hpp.
Referenced by DummyClientFace().
std::vector<lp::Nack> ndn::util::DummyClientFace::sentNacks |
Nacks sent out of this DummyClientFace.
Sent Nacks are appended to this container if options.enablePacketLogger is true. User of this class is responsible for cleaning up the container, if necessary. After .put, .processEvents must be called before the NACK would show up here.
Definition at line 140 of file dummy-client-face.hpp.
Referenced by DummyClientFace().
Signal<DummyClientFace, Interest> ndn::util::DummyClientFace::onSendInterest |
emits whenever an Interest is sent
After .expressInterest, .processEvents must be called before this signal would be emitted.
Definition at line 146 of file dummy-client-face.hpp.
Referenced by DummyClientFace().
Signal<DummyClientFace, Data> ndn::util::DummyClientFace::onSendData |
emits whenever a Data packet is sent
After .put, .processEvents must be called before this signal would be emitted.
Definition at line 152 of file dummy-client-face.hpp.
Referenced by DummyClientFace().
Signal<DummyClientFace, lp::Nack> ndn::util::DummyClientFace::onSendNack |
emits whenever a Nack is sent
After .put, .processEvents must be called before this signal would be emitted.
Definition at line 158 of file dummy-client-face.hpp.
Referenced by DummyClientFace().