changed Makefile.am to compile IOMultiplexer files
[NeonServV5.git] / src / ssl.h
1 /* ssl.h - NeonServ v5.5
2  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
3  * 
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License 
15  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
16  */
17 #ifndef _ssl_h
18 #define _ssl_h
19
20 #include "main.h"
21
22 struct ClientSocket;
23
24 #ifdef HAVE_SSL
25 #include <openssl/rand.h>
26 #include <openssl/ssl.h>
27 #include <openssl/err.h>
28
29 struct SSLConnection {
30     SSL *sslHandle;
31     SSL_CTX *sslContext;
32 };
33 #else
34 struct SSLConnection {
35     //just unused
36 };
37 #endif
38
39 void ssl_init();
40 void ssl_connect(struct ClientSocket *client);
41 void ssl_disconnect(struct ClientSocket *client);
42 int ssl_read(struct ClientSocket *client, char *buffer, int len);
43 int ssl_write(struct ClientSocket *client, char *buffer, int len);
44
45 #endif