blob: ad2a12827d8d1d48de028b1366a5bf642e4f99e2 [file] [log] [blame]
Jeff Thompsonf309aa62013-10-31 17:03:54 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
3 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Yingdi Yu <yingdi@cs.ucla.edu>
5 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
6 * See COPYING for copyright and distribution information.
7 */
8
9#ifndef NDN_VALIDATION_REQUEST_HPP
10#define NDN_VALIDATION_REQUEST_HPP
11
Yingdi Yu4f324632014-01-15 18:10:03 -080012#include "../interest.hpp"
Jeff Thompsonf309aa62013-10-31 17:03:54 -070013
14namespace ndn {
15
16class ValidationRequest {
17public:
Yingdi Yue07e3392014-01-28 10:29:27 -080018 /**
19 * An OnCertVerified function object is used to pass a callback to to report a successful verification.
20 */
21 typedef func_lib::function<void(const ptr_lib::shared_ptr<Data>&)> OnCertVerified;
22
23 /**
24 * An OnCertVerifyFailed function object is used to pass a callback to to report a failed verification.
25 */
26 typedef func_lib::function<void(const ptr_lib::shared_ptr<Data>&)> OnCertVerifyFailed;
27
28
Jeff Thompsonf309aa62013-10-31 17:03:54 -070029 ValidationRequest
Yingdi Yue07e3392014-01-28 10:29:27 -080030 (const ptr_lib::shared_ptr<Interest> &interest, const OnCertVerified& onVerified, const OnCertVerifyFailed& onVerifyFailed,
Jeff Thompson31aeed82013-11-25 15:44:45 -080031 int retry, int stepCount)
Yingdi Yue07e3392014-01-28 10:29:27 -080032 : m_interest(interest), m_onVerified(onVerified), m_onVerifyFailed(onVerifyFailed), m_retry(retry), m_stepCount(stepCount)
Jeff Thompsonf309aa62013-10-31 17:03:54 -070033 {
34 }
35
36 virtual
37 ~ValidationRequest() {}
38
Yingdi Yue07e3392014-01-28 10:29:27 -080039 ptr_lib::shared_ptr<Interest> m_interest; // An interest packet to fetch the requested data.
40 OnCertVerified m_onVerified; // A callback function if the requested certificate has been validated.
41 OnCertVerifyFailed m_onVerifyFailed; // A callback function if the requested certificate cannot be validated.
42 int m_retry; // The number of retrials when there is an interest timeout.
43 int m_stepCount;
Jeff Thompsonf309aa62013-10-31 17:03:54 -070044};
45
46}
47
48#endif