35 #define NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
37 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
39 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
51 class PendingInterestId;
52 class RegisteredPrefixId;
53 class InterestFilterId;
72 typedef function<void(const Interest&, const lp::Nack&)>
NackCallback;
83 typedef function<void(const Interest&, Data&)>
OnData;
100 typedef function<void (const InterestFilter&, const Interest&)>
OnInterest;
128 class Error :
public std::runtime_error
133 :
std::runtime_error(what)
151 Face(shared_ptr<Transport> transport =
nullptr);
182 Face(boost::asio::io_service& ioService);
191 Face(
const std::string& host,
const std::string& port =
"6363");
205 Face(shared_ptr<Transport> transport, KeyChain& keyChain);
220 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService);
236 Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService, KeyChain& keyChain);
250 const PendingInterestId*
252 const DataCallback& afterSatisfied,
253 const NackCallback& afterNacked,
254 const TimeoutCallback& afterTimeout);
269 const PendingInterestId*
271 const OnData& onData,
272 const OnTimeout& onTimeout =
nullptr);
288 const PendingInterestId*
291 const OnData& onData,
292 const OnTimeout& onTimeout =
nullptr);
335 const RegisteredPrefixId*
337 const InterestCallback& onInterest,
338 const RegisterPrefixFailureCallback& onFailure,
363 const RegisteredPrefixId*
365 const InterestCallback& onInterest,
366 const RegisterPrefixSuccessCallback& onSuccess,
367 const RegisterPrefixFailureCallback& onFailure,
383 const InterestFilterId*
385 const InterestCallback& onInterest);
387 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
412 const RegisteredPrefixId*
414 const OnInterest& onInterest,
415 const RegisterPrefixSuccessCallback& onSuccess,
416 const RegisterPrefixFailureCallback& onFailure,
443 const RegisteredPrefixId*
445 const OnInterest& onInterest,
446 const RegisterPrefixFailureCallback& onFailure,
472 const RegisteredPrefixId*
474 const OnInterest& onInterest,
475 const RegisterPrefixSuccessCallback& onSuccess,
476 const RegisterPrefixFailureCallback& onFailure,
477 const Name& identity,
501 const RegisteredPrefixId*
503 const OnInterest& onInterest,
504 const RegisterPrefixFailureCallback& onFailure,
505 const Name& identity,
507 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
526 const RegisteredPrefixId*
528 const RegisterPrefixSuccessCallback& onSuccess,
529 const RegisterPrefixFailureCallback& onFailure,
533 #ifdef NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
553 const RegisteredPrefixId*
555 const RegisterPrefixSuccessCallback& onSuccess,
556 const RegisterPrefixFailureCallback& onFailure,
579 const RegisteredPrefixId*
581 const RegisterPrefixSuccessCallback& onSuccess,
582 const RegisterPrefixFailureCallback& onFailure,
583 const Name& identity,
585 #endif // NDN_FACE_KEEP_DEPRECATED_REGISTRATION_SIGNING
628 const UnregisterPrefixSuccessCallback& onSuccess,
629 const UnregisterPrefixFailureCallback& onFailure);
678 processEvents(
const time::milliseconds& timeout = time::milliseconds::zero(),
679 bool keepThread =
false)
698 boost::asio::io_service&
708 shared_ptr<Transport>
719 shared_ptr<Transport>
720 makeDefaultTransport();
727 construct(shared_ptr<Transport> transport, KeyChain& keyChain);
730 onReceiveElement(
const Block& blockFromDaemon);
737 unique_ptr<boost::asio::io_service> m_internalIoService;
739 boost::asio::io_service& m_ioService;
741 shared_ptr<Transport> m_transport;
750 unique_ptr<KeyChain> m_internalKeyChain;
752 unique_ptr<nfd::Controller> m_nfdController;
755 shared_ptr<Impl> m_impl;
760 #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...
declares the set of Interests a producer can serve, which starts with a name prefix, plus an optional regular expression
The packet signing interface.
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.