[IOMultiplexerV2] added GnuTLS support
[NextIRCd.git] / src / IOHandler / IOHandler_config.h
1 /* IOHanlder_config.h - IOMultiplexer
2  * Copyright (C) 2014  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
18 /* required configure script checks
19  AC_FUNC_MALLOC
20  AC_CHECK_FUNCS([usleep select socket inet_pton inet_ntop])
21  AC_CHECK_HEADERS([fcntl.h sys/socket.h sys/select.h sys/time.h sys/types.h unistd.h windows.h winsock2.h errno.h sys/epoll.h sys/event.h])
22  
23  AC_CHECK_LIB(ws2_32, main, [ LIBS="$LIBS -lws2_32" ], [])
24  have_gnutls="no"
25  AC_CHECK_LIB(gnutls, gnutls_init, [
26    AC_CHECK_HEADERS(gnutls/gnutls.h, [
27      LIBS="$LIBS -lgnutls"
28      have_gnutls="yes"
29    ])
30  ])
31  if test x"$have_gnutls" = xno; then
32    AC_CHECK_LIB(ssl, SSL_read, [
33      AC_CHECK_LIB(crypto, X509_new, [
34        AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h openssl/rand.h, [
35          LIBS="$LIBS -lssl -lcrypto"
36        ])
37      ])
38    ])
39  fi
40  AC_CHECK_LIB(pthread, pthread_create, [
41    AC_CHECK_HEADERS(pthread.h, [
42      LIBS="$LIBS -lpthread"
43    ])
44  ])
45  AC_CHECK_LIB(cares, ares_init, [
46    AC_CHECK_HEADERS(ares.h, [
47      LIBS="$LIBS -lcares"
48    ])
49  ])
50 */
51 // configure config file
52 #include "../../config.h"
53
54 #define IOHANDLER_MAX_SOCKETS 1024
55 #define IOHANDLER_LOOP_MAXTIME 100000 /* 100ms */
56
57 #define IOSOCKET_PARSE_DELIMITERS_COUNT 5
58 #define IOSOCKET_PARSE_LINE_LIMIT 1024
59 #define IOSOCKET_PRINTF_LINE_LEN  1024
60
61 //#define IODNS_USE_THREADS
62
63 #define IOGC_TIMEOUT 60