38 m_wantDirectInterestOnly = wantDirectInterestOnly;
43 const shared_ptr<ValidationState>& state,
47 uint64_t incomingFaceId = 0;
48 if (interestState !=
nullptr) {
50 if (incomingFaceIdTag !=
nullptr) {
51 incomingFaceId = incomingFaceIdTag->
get();
57 if (incomingFaceIdTag !=
nullptr) {
58 incomingFaceId = incomingFaceIdTag->
get();
61 if (incomingFaceId != 0) {
62 Interest directInterest(keyRequest->interest);
64 directInterest.
setTag(make_shared<lp::NextHopFaceIdTag>(incomingFaceId));
66 if (!m_wantDirectInterestOnly) {
73 dataCallback(data, keyRequest, state, continueValidation);
76 nackCallback(nack, keyRequest, state, continueValidation);
84 if (!m_wantDirectInterestOnly) {
88 else if (incomingFaceId == 0) {
89 state->fail({ValidationError::Code::CANNOT_RETRIEVE_CERT,
90 "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.
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.