Initial import to Tizen
[profile/ivi/python-pyOpenSSL.git] / OpenSSL / ssl / connection.h
1 /*
2  * connection.h
3  *
4  * Copyright (C) AB Strakt
5  * See LICENSE for details.
6  *
7  * Export SSL Connection data structures and functions.
8  * See the file RATIONALE for a short explanation of why this module was written.
9  *
10  * Reviewed 2001-07-23
11  *
12  */
13 #ifndef PyOpenSSL_SSL_CONNECTION_H_
14 #define PyOpenSSL_SSL_CONNECTION_H_
15
16 #include <Python.h>
17 #include <openssl/ssl.h>
18
19 /* shamelessly stolen from socketmodule.c */
20 #ifdef MS_WINDOWS
21 #  include <winsock.h>
22 typedef SOCKET SOCKET_T;
23 #  ifdef MS_WIN64
24 #    define SIZEOF_SOCKET_T 8
25 #  else
26 #    define SIZEOF_SOCKET_T 4
27 #  endif
28 #else
29 typedef int SOCKET_T;
30 #  define SIZEOF_SOCKET_T SIZEOF_INT
31 #endif
32
33
34 extern  int                      init_ssl_connection      (PyObject *);
35
36 extern  PyTypeObject      ssl_Connection_Type;
37
38 #define ssl_Connection_Check(v) ((v)->ob_type == &ssl_Connection_Type)
39
40 typedef struct {
41     PyObject_HEAD
42     SSL                 *ssl;
43     ssl_ContextObj      *context;
44     PyObject            *socket;
45     PyThreadState       *tstate; /* This field is no longer used. */
46     PyObject            *app_data;
47     BIO                 *into_ssl, *from_ssl;  /* for connections without file descriptors */
48 } ssl_ConnectionObj;
49
50
51
52 #endif
53