|
1 #ifndef __SSL_H__ |
|
2 #define __SSL_H__ |
|
3 |
|
4 /*-------------------------------------------------------------------------- |
|
5 * LuaSec 0.4 |
|
6 * Copyright (C) 2006-2009 Bruno Silvestre |
|
7 * |
|
8 *--------------------------------------------------------------------------*/ |
|
9 |
|
10 #include <openssl/ssl.h> |
|
11 #include <lua.h> |
|
12 |
|
13 #include "io.h" |
|
14 #include "buffer.h" |
|
15 #include "timeout.h" |
|
16 #include "context.h" |
|
17 |
|
18 #define ST_SSL_NEW 1 |
|
19 #define ST_SSL_CONNECTED 2 |
|
20 #define ST_SSL_CLOSED 3 |
|
21 |
|
22 typedef struct t_ssl_ { |
|
23 t_socket sock; |
|
24 t_io io; |
|
25 t_buffer buf; |
|
26 t_timeout tm; |
|
27 SSL *ssl; |
|
28 char state; |
|
29 int error; |
|
30 } t_ssl; |
|
31 typedef t_ssl* p_ssl; |
|
32 |
|
33 LUASEC_API int luaopen_ssl_core(lua_State *L); |
|
34 |
|
35 #endif |