blob: dedb73e9c62a7922b0aa587fb99db54b5865a437 [file] [log] [blame]
Jean-Paul Calderone897bc252008-02-18 20:50:23 -05001/*
2 * connection.h
3 *
4 * Copyright (C) AB Strakt 2001, All rights reserved
5 *
6 * Export SSL Connection data structures and functions.
7 * See the file RATIONALE for a short explanation of why this module was written.
8 *
9 * Reviewed 2001-07-23
10 *
11 * @(#) $Id: connection.h,v 1.11 2002/09/04 22:24:59 iko Exp $
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>
22typedef 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
29typedef int SOCKET_T;
30# define SIZEOF_SOCKET_T SIZEOF_INT
31#endif
32
33
34extern int init_ssl_connection (PyObject *);
35
36extern PyTypeObject ssl_Connection_Type;
37
38#define ssl_Connection_Check(v) ((v)->ob_type == &ssl_Connection_Type)
39
40typedef struct {
41 PyObject_HEAD
42 SSL *ssl;
43 ssl_ContextObj *context;
44 PyObject *socket;
45 PyThreadState *tstate;
46 PyObject *app_data;
47} ssl_ConnectionObj;
48
49
50
51#endif
52