2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_SRC_SECURITY_SESSION_H
10 #define SQUID_SRC_SECURITY_SESSION_H
12 #include "security/LockingPointer.h"
17 #if HAVE_OPENSSL_SSL_H
18 #include <openssl/ssl.h>
23 #if HAVE_GNUTLS_GNUTLS_H
24 #include <gnutls/gnutls.h>
31 typedef SSL
* SessionPtr
;
32 CtoCpp1(SSL_free
, SSL
*);
33 typedef LockingPointer
<SSL
, Security::SSL_free_cpp
, CRYPTO_LOCK_SSL
> SessionPointer
;
36 typedef gnutls_session_t SessionPtr
;
37 // Locks can be implemented attaching locks counter to gnutls_session_t
38 // objects using the gnutls_session_set_ptr()/gnutls_session_get_ptr ()
40 CtoCpp1(gnutls_deinit
, gnutls_session_t
);
41 typedef LockingPointer
<struct gnutls_session_int
, gnutls_deinit_cpp
, -1> SessionPointer
;
44 // use void* so we can check against NULL
45 typedef void* SessionPtr
;
46 CtoCpp1(xfree
, SessionPtr
);
47 typedef LockingPointer
<void, xfree_cpp
, -1> SessionPointer
;
51 } // namespace Security
53 #endif /* SQUID_SRC_SECURITY_SESSION_H */