41 m_wantDirectInterestOnly = wantDirectInterestOnly;
46 const shared_ptr<ValidationState>& state,
50 uint64_t incomingFaceId = 0;
51 if (interestState !=
nullptr) {
53 if (incomingFaceIdTag !=
nullptr) {
54 incomingFaceId = incomingFaceIdTag->
get();
60 if (incomingFaceIdTag !=
nullptr) {
61 incomingFaceId = incomingFaceIdTag->
get();
64 if (incomingFaceId != 0) {
65 Interest directInterest(keyRequest->interest);
67 directInterest.
setTag(make_shared<lp::NextHopFaceIdTag>(incomingFaceId));
69 if (!m_wantDirectInterestOnly) {
76 dataCallback(data, keyRequest, state, continueValidation);
79 nackCallback(nack, keyRequest, state, continueValidation);
87 if (!m_wantDirectInterestOnly) {
91 else if (incomingFaceId == 0) {
92 state->fail({ValidationError::Code::CANNOT_RETRIEVE_CERT,
93 "Cannot direct fetch certificate as IncomingFaceId tag is not set"});
const Data & getOriginalData() const
void setTag(shared_ptr< T > tag) const
set a tag item
Fetch missing keys from the network.
Copyright (c) 2011-2015 Regents of the University of California.
CertificateFetcherDirectFetch(Face &face)
shared_ptr< T > getTag() const
get a tag item
const Interest & getOriginalInterest() const
void nackCallback(const lp::Nack &nack, const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
Callback invoked when interest for fetching certificate gets NACKed.
void refreshNonce()
Change nonce value.
Represents an Interest packet.
std::function< void(const Certificate &cert, const shared_ptr< ValidationState > &state)> ValidationContinuation
represents a Network Nack
Validation state for a data packet.
void doFetch(const shared_ptr< CertificateRequest > &keyRequest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) override
Asynchronous certificate fetching implementation.
provides a tag type for simple types
Validation state for an interest packet.
constexpr const T & get() const noexcept
Provide a communication channel with local or remote NDN forwarder.
void dataCallback(const Data &data, const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
Callback invoked when certificate is retrieved.
PendingInterestHandle expressInterest(const Interest &interest, const DataCallback &afterSatisfied, const NackCallback &afterNacked, const TimeoutCallback &afterTimeout)
Express Interest.
void timeoutCallback(const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation)
Callback invoked when interest for fetching certificate times out.
Represents a Data packet.
void setSendDirectInterestOnly(bool wantDirectInterestOnly)
If wantDirectInterestOnly, only the direct Interest will be sent out.
void doFetch(const shared_ptr< CertificateRequest > &certRequest, const shared_ptr< ValidationState > &state, const ValidationContinuation &continueValidation) override
Asynchronous certificate fetching implementation.