36 #define NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
38 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
40 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
52 class PendingInterestId;
53 class RegisteredPrefixId;
54 class InterestFilterId;
68 typedef function<void(const Interest&, const lp::Nack&)>
NackCallback;
79 typedef function<void(const Interest&, Data&)>
OnData;
96 typedef function<void (const InterestFilter&, const Interest&)>
OnInterest;
124 class Error :
public std::runtime_error
129 :
std::runtime_error(what)
147 Face(shared_ptr<Transport> transport =
nullptr);
178 Face(boost::asio::io_service& ioService);
187 Face(
const std::string& host,
const std::string& port =
"6363");
201 Face(shared_ptr<Transport> transport,
KeyChain& keyChain);
216 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService);
232 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService,
KeyChain& keyChain);
247 const PendingInterestId*
249 const DataCallback& afterSatisfied,
250 const NackCallback& afterNacked,
251 const TimeoutCallback& afterTimeout);
266 const PendingInterestId*
268 const OnData& onData,
269 const OnTimeout& onTimeout =
nullptr);
285 const PendingInterestId*
288 const OnData& onData,
289 const OnTimeout& onTimeout =
nullptr);
332 const RegisteredPrefixId*
334 const InterestCallback& onInterest,
335 const RegisterPrefixFailureCallback& onFailure,
360 const RegisteredPrefixId*
362 const InterestCallback& onInterest,
363 const RegisterPrefixSuccessCallback& onSuccess,
364 const RegisterPrefixFailureCallback& onFailure,
380 const InterestFilterId*
382 const InterestCallback& onInterest);
384 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
409 const RegisteredPrefixId*
411 const OnInterest& onInterest,
412 const RegisterPrefixSuccessCallback& onSuccess,
413 const RegisterPrefixFailureCallback& onFailure,
440 const RegisteredPrefixId*
442 const OnInterest& onInterest,
443 const RegisterPrefixFailureCallback& onFailure,
469 const RegisteredPrefixId*
471 const OnInterest& onInterest,
472 const RegisterPrefixSuccessCallback& onSuccess,
473 const RegisterPrefixFailureCallback& onFailure,
474 const Name& identity,
498 const RegisteredPrefixId*
500 const OnInterest& onInterest,
501 const RegisterPrefixFailureCallback& onFailure,
502 const Name& identity,
504 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
523 const RegisteredPrefixId*
525 const RegisterPrefixSuccessCallback& onSuccess,
526 const RegisterPrefixFailureCallback& onFailure,
530 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
550 const RegisteredPrefixId*
552 const RegisterPrefixSuccessCallback& onSuccess,
553 const RegisterPrefixFailureCallback& onFailure,
576 const RegisteredPrefixId*
578 const RegisterPrefixSuccessCallback& onSuccess,
579 const RegisterPrefixFailureCallback& onFailure,
580 const Name& identity,
582 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
625 const UnregisterPrefixSuccessCallback& onSuccess,
626 const UnregisterPrefixFailureCallback& onFailure);
675 processEvents(
const time::milliseconds& timeout = time::milliseconds::zero(),
676 bool keepThread =
false)
695 boost::asio::io_service&
705 shared_ptr<Transport>
716 shared_ptr<Transport>
717 makeDefaultTransport();
724 construct(shared_ptr<Transport> transport,
KeyChain& keyChain);
727 onReceiveElement(
const Block& blockFromDaemon);
734 unique_ptr<boost::asio::io_service> m_internalIoService;
736 boost::asio::io_service& m_ioService;
738 shared_ptr<Transport> m_transport;
747 unique_ptr<KeyChain> m_internalKeyChain;
749 unique_ptr<nfd::Controller> m_nfdController;
752 shared_ptr<Impl> m_impl;
757 #endif // NDN_FACE_HPP
Copyright (c) 2013-2016 Regents of the University of California.
Error(const std::string &what)
function< void(const std::string &)> UnregisterPrefixFailureCallback
Callback invoked when unregisterPrefix or unsetInterestFilter command fails.
Copyright (c) 2013-2016 Regents of the University of California.
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 fil...
Copyright (c) 2013-2017 Regents of the University of California.
declares the set of Interests a producer can serve, which starts with a name prefix, plus an optional regular expression
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
function< void(const Interest &)> OnTimeout
Callback invoked when expressed Interest times out.
function< void(const InterestFilter &, const Interest &)> OnInterest
Callback invoked when incoming Interest matches the specified InterestFilter.
virtual void doProcessEvents(const time::milliseconds &timeout, bool keepThread)
Signing parameters passed to KeyChain.
void unregisterPrefix(const RegisteredPrefixId *registeredPrefixId, const UnregisterPrefixSuccessCallback &onSuccess, const UnregisterPrefixFailureCallback &onFailure)
Unregister prefix from RIB.
represents a Network Nack
Copyright (c) 2013-2016 Regents of the University of California.
void removeAllPendingInterests()
Cancel all previously expressed Interests.
shared_ptr< Transport > getTransport()
void shutdown()
Shutdown face operations.
Provide a communication channel with local or remote NDN forwarder.
function< void(const Name &, const std::string &)> RegisterPrefixFailureCallback
Callback invoked when registerPrefix or setInterestFilter command fails.
function< void(const Name &)> RegisterPrefixSuccessCallback
Callback invoked when registerPrefix or setInterestFilter command succeeds.
Name abstraction to represent an absolute name.
void unsetInterestFilter(const RegisteredPrefixId *registeredPrefixId)
Remove the registered prefix entry with the registeredPrefixId.
boost::asio::io_service & getIoService()
function< void(const InterestFilter &, const Interest &)> InterestCallback
Callback invoked when incoming Interest matches the specified InterestFilter.
function< void(const Interest &, Data &)> OnData
Callback invoked when expressed Interest gets satisfied with Data packet.
size_t getNPendingInterests() const
Get number of pending Interests.
function< void()> UnregisterPrefixSuccessCallback
Callback invoked when unregisterPrefix or unsetInterestFilter command succeeds.
const PendingInterestId * expressInterest(const Interest &interest, const DataCallback &afterSatisfied, const NackCallback &afterNacked, const TimeoutCallback &afterTimeout)
Express Interest.
void processEvents(const time::milliseconds &timeout=time::milliseconds::zero(), bool keepThread=false)
Process any data to receive or call timeout callbacks.
function< void(const Interest &)> TimeoutCallback
Callback invoked when expressed Interest times out.
function< void(const Interest &, const lp::Nack &)> NackCallback
Callback invoked when Nack is sent in response to expressed Interest.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
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.
Face(shared_ptr< Transport > transport=nullptr)
Create Face using given transport (or default transport if omitted)
function< void(const Interest &, const Data &)> DataCallback
Callback invoked when expressed Interest gets satisfied with a Data packet.
void removePendingInterest(const PendingInterestId *pendingInterestId)
Cancel previously expressed Interest.
void put(const Data &data)
Publish data packet.