]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ssl/helper.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / ssl / helper.h
1 /*
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef SQUID_SSL_HELPER_H
10 #define SQUID_SSL_HELPER_H
11
12 #include "base/LruMap.h"
13 #include "helper/forward.h"
14 #include "ssl/cert_validate_message.h"
15 #include "ssl/crtd_message.h"
16
17 namespace Ssl
18 {
19 /**
20 * Set of thread for ssl_crtd. This class is singleton. Use this class only
21 * over GetIntance() static method. This class use helper structure
22 * for threads management.
23 */
24 #if USE_SSL_CRTD
25 class Helper
26 {
27 public:
28 static Helper * GetInstance(); ///< Instance class.
29 void Init(); ///< Init helper structure.
30 void Shutdown(); ///< Shutdown helper structure.
31 /// Submit crtd message to external crtd server.
32 void sslSubmit(CrtdMessage const & message, HLPCB * callback, void *data);
33 private:
34 Helper();
35 ~Helper();
36
37 helper * ssl_crtd; ///< helper for management of ssl_crtd.
38 };
39 #endif
40
41 class CertValidationRequest;
42 class CertValidationResponse;
43 class CertValidationHelper
44 {
45 public:
46 typedef void CVHCB(void *, Ssl::CertValidationResponse const &);
47 static CertValidationHelper * GetInstance(); ///< Instance class.
48 void Init(); ///< Init helper structure.
49 void Shutdown(); ///< Shutdown helper structure.
50 /// Submit crtd request message to external crtd server.
51 void sslSubmit(Ssl::CertValidationRequest const & request, CVHCB * callback, void *data);
52 private:
53 CertValidationHelper();
54 ~CertValidationHelper();
55
56 helper * ssl_crt_validator; ///< helper for management of ssl_crtd.
57 public:
58 static LruMap<Ssl::CertValidationResponse> *HelperCache; ///< cache for cert validation helper
59 };
60
61 } //namespace Ssl
62 #endif // SQUID_SSL_HELPER_H
63