luasec/src/ssl.h

42 lines
798 B
C
Raw Normal View History

2013-03-30 13:21:40 +01:00
#ifndef LSEC_SSL_H
#define LSEC_SSL_H
2012-09-02 16:15:49 +02:00
/*--------------------------------------------------------------------------
2018-06-27 15:36:26 +02:00
* LuaSec 0.7
2017-09-26 23:22:49 +02:00
*
2018-06-27 15:36:26 +02:00
* Copyright (C) 2006-2018 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>
2017-06-17 02:03:10 +02:00
#include "compat.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