2013-03-30 13:21:40 +01:00
|
|
|
#ifndef LSEC_SSL_H
|
|
|
|
#define LSEC_SSL_H
|
2012-09-02 16:15:49 +02:00
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
2014-01-29 21:43:33 +01:00
|
|
|
* LuaSec 0.5
|
|
|
|
* Copyright (C) 2006-2014 Bruno Silvestre
|
2012-09-02 16:15:49 +02:00
|
|
|
*
|
|
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#include <openssl/ssl.h>
|
|
|
|
#include <lua.h>
|
|
|
|
|
2013-03-30 13:21:40 +01:00
|
|
|
#include <luasocket/io.h>
|
|
|
|
#include <luasocket/buffer.h>
|
|
|
|
#include <luasocket/timeout.h>
|
|
|
|
#include <luasocket/socket.h>
|
|
|
|
|
|
|
|
#include "config.h"
|
2012-09-02 16:32:26 +02:00
|
|
|
#include "context.h"
|
2012-09-02 16:15:49 +02:00
|
|
|
|
2013-03-30 13:21:40 +01:00
|
|
|
#define LSEC_STATE_NEW 1
|
|
|
|
#define LSEC_STATE_CONNECTED 2
|
|
|
|
#define LSEC_STATE_CLOSED 3
|
|
|
|
|
|
|
|
#define LSEC_IO_SSL -100
|
2012-09-02 16:15:49 +02:00
|
|
|
|
|
|
|
typedef struct t_ssl_ {
|
|
|
|
t_socket sock;
|
|
|
|
t_io io;
|
|
|
|
t_buffer buf;
|
|
|
|
t_timeout tm;
|
|
|
|
SSL *ssl;
|
2013-03-30 13:21:40 +01:00
|
|
|
int state;
|
2012-09-02 16:15:49 +02:00
|
|
|
int error;
|
|
|
|
} t_ssl;
|
|
|
|
typedef t_ssl* p_ssl;
|
|
|
|
|
2013-03-30 13:21:40 +01:00
|
|
|
LSEC_API int luaopen_ssl_core(lua_State *L);
|
2012-09-02 16:15:49 +02:00
|
|
|
|
|
|
|
#endif
|