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

a client-side face for unit testing More...

#include <dummy-client-face.hpp>

Inheritance diagram for ndn::util::DummyClientFace:
Collaboration diagram for ndn::util::DummyClientFace:

Classes

struct  Options
 options for DummyClientFace More...
 
class  Transport
 

Public Member Functions

template<typename Packet >
void receive (const Packet &packet)
 cause the Face to receive a packet More...
 
- Public Member Functions inherited from ndn::Face
 Face ()
 Create a new Face using the default transport (UnixTransport) More...
 
 Face (boost::asio::io_service &ioService)
 Create a new Face using the default transport (UnixTransport) More...
 
 ~Face ()
 
const PendingInterestId * expressInterest (const Interest &interest, const OnData &onData, const OnTimeout &onTimeout=OnTimeout())
 Express Interest. More...
 
const PendingInterestId * expressInterest (const Name &name, const Interest &tmpl, const OnData &onData, const OnTimeout &onTimeout=OnTimeout())
 Express Interest using name and Interest template. More...
 
void removePendingInterest (const PendingInterestId *pendingInterestId)
 Cancel previously expressed Interest. More...
 
size_t getNPendingInterests () const
 Get number of pending Interests. More...
 
const RegisteredPrefixId * setInterestFilter (const InterestFilter &interestFilter, const OnInterest &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 OnInterest &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 OnInterest &onInterest)
 Set InterestFilter to dispatch incoming matching interest to onInterest callback. More...
 
const RegisteredPrefixId * setInterestFilter (const InterestFilter &interestFilter, const OnInterest &onInterest, const RegisterPrefixSuccessCallback &onSuccess, const RegisterPrefixFailureCallback &onFailure, const 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...
 
const RegisteredPrefixId * setInterestFilter (const InterestFilter &interestFilter, const OnInterest &onInterest, const RegisterPrefixFailureCallback &onFailure, const 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...
 
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...
 
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...
 
const RegisteredPrefixId * registerPrefix (const Name &prefix, const RegisterPrefixSuccessCallback &onSuccess, const RegisterPrefixFailureCallback &onFailure, const IdentityCertificate &certificate, uint64_t flags=nfd::ROUTE_FLAG_CHILD_INHERIT)
 Register prefix with the connected NDN forwarder. More...
 
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 processEvents (const time::milliseconds &timeout=time::milliseconds::zero(), bool keepThread=false)
 Noop (kept for compatibility) More...
 
void shutdown ()
 Shutdown face operations. More...
 
boost::asio::io_service & getIoService ()
 Return nullptr (kept for compatibility) More...
 

Public Attributes

std::vector< InterestsentInterests
 Interests sent out of this DummyClientFace. More...
 
std::vector< DatasentDatas
 Data sent out of this DummyClientFace. More...
 
Signal< DummyClientFace, InterestonSendInterest
 emits whenever an Interest is sent More...
 
Signal< DummyClientFace, DataonSendData
 emits whenever a Data packet is sent More...
 

Static Public Attributes

static const Options DEFAULT_OPTIONS { true, false }
 default options More...
 

Friends

shared_ptr< DummyClientFacemakeDummyClientFace (const DummyClientFace::Options &options)
 
shared_ptr< DummyClientFacemakeDummyClientFace (boost::asio::io_service &ioService, const DummyClientFace::Options &options)
 

Detailed Description

a client-side face for unit testing

Definition at line 33 of file dummy-client-face.hpp.

Member Function Documentation

template<typename Packet >
template void ndn::util::DummyClientFace::receive< Data > ( const Packet &  packet)

cause the Face to receive a packet

Template Parameters
Packeteither Interest or Data

Definition at line 169 of file dummy-client-face.cpp.

References ndn::encoding::Encoder::appendByteArray(), ndn::nfd::LocalControlHeader::ENCODE_ALL, ndn::Block::size(), and ndn::Block::wire().

Friends And Related Function Documentation

shared_ptr<DummyClientFace> makeDummyClientFace ( const DummyClientFace::Options options)
friend

Definition at line 197 of file dummy-client-face.cpp.

shared_ptr<DummyClientFace> makeDummyClientFace ( boost::asio::io_service &  ioService,
const DummyClientFace::Options options 
)
friend

Definition at line 205 of file dummy-client-face.cpp.

Member Data Documentation

const DummyClientFace::Options ndn::util::DummyClientFace::DEFAULT_OPTIONS { true, false }
static

default options

enablePacketLogging=true enableRegistrationReply=false

Definition at line 89 of file dummy-client-face.hpp.

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 97 of file dummy-client-face.hpp.

std::vector<Data> ndn::util::DummyClientFace::sentDatas

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 105 of file dummy-client-face.hpp.

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 111 of file dummy-client-face.hpp.

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 117 of file dummy-client-face.hpp.


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