terom@2: #ifndef SOCK_GNUTLS_H terom@2: #define SOCK_GNUTLS_H terom@2: terom@2: /* terom@2: * A sock_stream implementation using GnuTLS terom@2: */ terom@2: terom@2: #include "sock_internal.h" terom@2: #include "sock_tcp.h" terom@2: terom@2: #include terom@2: terom@2: /* terom@2: * Additional gnutls configuration for client sockets. terom@2: * terom@2: * XXX: currently, we just have one global instance, set up by sock_gnutls_init, used for all sockets terom@2: */ terom@2: struct sock_gnutls_client_ctx { terom@2: gnutls_certificate_credentials_t xcred; terom@2: }; terom@2: terom@2: /* terom@2: * Per-sock state, this includes the sock_tcp connection terom@2: */ terom@2: struct sock_gnutls { terom@2: /* SSL connections use TCP connections */ terom@2: struct sock_tcp base_tcp; terom@2: terom@2: /* Additional SSL info XXX: do we need to keep a ref to this? */ terom@2: struct sock_gnutls_ctx *ctx; terom@2: terom@2: /* The GnuTLS session for this connection */ terom@2: gnutls_session_t session; terom@2: }; terom@2: terom@2: #define SOCK_GNUTLS_BASE(sock_ptr) (&(sock_ptr)->base_tcp.base) terom@2: #define SOCK_GNUTLS_TCP(sock_ptr) (&(sock_ptr)->base_tcp) terom@2: terom@2: /* terom@2: * Initialize the global gnutls state terom@2: */ terom@2: void sock_gnutls_init (void); terom@2: terom@2: #endif /* SOCK_GNUTLS_H */