File: connection.h

package info (click to toggle)
pyopenssl 0.13-2%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,752 kB
  • sloc: ansic: 7,372; python: 6,688; perl: 3,089; xml: 693; makefile: 191; sh: 54; lisp: 13; sed: 2
file content (53 lines) | stat: -rw-r--r-- 1,205 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * connection.h
 *
 * Copyright (C) AB Strakt
 * See LICENSE for details.
 *
 * Export SSL Connection data structures and functions.
 * See the file RATIONALE for a short explanation of why this module was written.
 *
 * Reviewed 2001-07-23
 *
 */
#ifndef PyOpenSSL_SSL_CONNECTION_H_
#define PyOpenSSL_SSL_CONNECTION_H_

#include <Python.h>
#include <openssl/ssl.h>

/* shamelessly stolen from socketmodule.c */
#ifdef MS_WINDOWS
#  include <winsock.h>
typedef SOCKET SOCKET_T;
#  ifdef MS_WIN64
#    define SIZEOF_SOCKET_T 8
#  else
#    define SIZEOF_SOCKET_T 4
#  endif
#else
typedef int SOCKET_T;
#  define SIZEOF_SOCKET_T SIZEOF_INT
#endif


extern  int                      init_ssl_connection      (PyObject *);

extern  PyTypeObject      ssl_Connection_Type;

#define ssl_Connection_Check(v) ((v)->ob_type == &ssl_Connection_Type)

typedef struct {
    PyObject_HEAD
    SSL                 *ssl;
    ssl_ContextObj      *context;
    PyObject            *socket;
    PyThreadState       *tstate; /* This field is no longer used. */
    PyObject            *app_data;
    BIO                 *into_ssl, *from_ssl;  /* for connections without file descriptors */
} ssl_ConnectionObj;



#endif