Upgrade to OpenVPN 2.1.0
[tomato.git] / release / src / router / openvpn / config-win32.h
blob3f1f3fe1deeca2079dd37be175d51e4fd69cf9ed
1 /*
2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
6 * packet compression.
8 * Copyright (C) 2002-2009 OpenVPN Technologies, Inc. <sales@openvpn.net>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program (see the file COPYING included with this
21 * distribution); if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * Configuration header for Win32 using the mingw environment.
27 * Manually edited based on linux version as generated by autoconf.
29 * config-win32.h is normally generated by copying
30 * config-win32.h.in -> config-win32.h and replacing
31 * [ampersand] VERSION [ampersand]
32 * with the appropriate version #. This is normally
33 * done automatically by configure.ac
36 #include <windows.h>
37 #include <winsock2.h>
38 #include "autodefs/defs.h"
40 #define sleep(x) Sleep((x)*1000)
42 #define random rand
43 #define srandom srand
45 typedef unsigned long in_addr_t;
47 #ifndef _SSIZE_T_
48 #define _SSIZE_T_
49 typedef unsigned int ssize_t;
50 #endif
52 /* Append a label to program startup title */
53 /*#define DEBUG_LABEL "DEBUG1"*/
55 /* Should we print debug info from driver? */
56 #ifdef PRODUCT_TAP_DEBUG
57 #define TAP_WIN32_DEBUG
58 #endif
61 * Minimum TAP-Win32 version number expected by userspace
63 * The TAP-Win32 version number is defined in tap-win32/SOURCES
65 #define TAP_ID tap0901
66 #define TAP_WIN32_MIN_MAJOR 9
67 #define TAP_WIN32_MIN_MINOR 1
69 /* Enable client/server capability */
70 #define ENABLE_CLIENT_SERVER 1
72 /* Enable client capability only */
73 /* #undef ENABLE_CLIENT_ONLY */
75 /* Enable management server capability */
76 #define ENABLE_MANAGEMENT 1
78 /* Enable PKCS#11 support */
79 #define USE_PKCS11 1
81 /* Enable HTTP proxy support */
82 #define ENABLE_HTTP_PROXY 1
84 /* Enable Socks proxy support */
85 #define ENABLE_SOCKS 1
87 /* Enable internal fragmentation support */
88 #define ENABLE_FRAGMENT 1
90 /* Enable smaller executable size */
91 /* #undef ENABLE_SMALL */
93 /* Enable debugging support */
94 #define ENABLE_DEBUG 1
96 /* if defined, will allow usage of the --plugin directive */
97 #define USE_LOAD_LIBRARY
99 /* Dimension size to use for empty array declaration */
100 #define EMPTY_ARRAY_SIZE 0
102 /* Define to 1 if you have the `getsockname' function. */
103 #define HAVE_GETSOCKNAME 1
105 /* Define to 1 if you have the <openssl/engine.h> header file. */
106 #define HAVE_OPENSSL_ENGINE_H 1
108 /* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */
109 #define HAVE_ENGINE_LOAD_BUILTIN_ENGINES 1
111 /* Define to 1 if you have the `ENGINE_register_all_complete' function. */
112 #define HAVE_ENGINE_REGISTER_ALL_COMPLETE 1
114 /* Define to 1 if you have the `ENGINE_cleanup' function. */
115 #define HAVE_ENGINE_CLEANUP 1
117 /* gettimeofday() is implemented in otime.c for Windows */
118 #define HAVE_GETTIMEOFDAY 1
120 /* Define to 1 if you have the 'chsize' function. */
121 #define HAVE_CHSIZE 1
123 /* Define to 1 if you have the `chdir' function. */
124 #define HAVE_CHDIR 1
126 /* Define to 1 if your compiler supports GNU GCC-style variadic macros */
127 #ifndef _MSC_VER /* Defines MSFT compiler version. Defined as 1200 for MSVC++ 6.0. */
128 #define HAVE_CPP_VARARG_MACRO_GCC 1
129 #endif
131 /* Define to 1 if you have the <ctype.h> header file. */
132 #define HAVE_CTYPE_H 1
134 /* Define to 1 if you have the <errno.h> header file. */
135 #define HAVE_ERRNO_H 1
137 /* Define to 1 if you have the `EVP_CIPHER_CTX_set_key_length' function. */
138 #define HAVE_EVP_CIPHER_CTX_SET_KEY_LENGTH 1
140 /* Define to 1 if you have the <fcntl.h> header file. */
141 #define HAVE_FCNTL_H 1
143 /* Define to 1 if you have the `getsockopt' function. */
144 #define HAVE_GETSOCKOPT 1
146 /* Define to 1 if you have the `inet_ntoa' function. */
147 #define HAVE_INET_NTOA 1
149 /* Define to 1 if your system has a GNU libc compatible `malloc' function, and
150 to 0 otherwise. */
151 #define HAVE_MALLOC 1
153 /* Define to 1 if you have the `memset' function. */
154 #define HAVE_MEMSET 1
156 /* Define to 1 if you have the `setsockopt' function. */
157 #define HAVE_SETSOCKOPT 1
159 /* Define to 1 if you have the `socket' function. */
160 #define HAVE_SOCKET 1
162 /* Define to 1 if you have the <stdarg.h> header file. */
163 #define HAVE_STDARG_H 1
165 /* Define to 1 if you have the <stdint.h> header file. */
166 #ifndef _MSC_VER
167 #define HAVE_STDINT_H 1
168 #endif
170 /* Define to 1 if you have the <stdio.h> header file. */
171 #define HAVE_STDIO_H 1
173 /* Define to 1 if you have the <stdlib.h> header file. */
174 #define HAVE_STDLIB_H 1
176 /* Define to 1 if you have the `strerror' function. */
177 #define HAVE_STRERROR 1
179 /* Define to 1 if you have the <strings.h> header file. */
180 #define HAVE_STRINGS_H 1
182 /* Define to 1 if you have the <string.h> header file. */
183 #define HAVE_STRING_H 1
185 /* Define to 1 if you have the `system' function. */
186 #define HAVE_SYSTEM 1
188 /* Define to 1 if you have the <sys/file.h> header file. */
189 #ifndef _MSC_VER
190 #define HAVE_SYS_FILE_H 1
191 #endif
193 /* Define to 1 if you have the <sys/stat.h> header file. */
194 #define HAVE_SYS_STAT_H 1
196 /* Define to 1 if you have the <sys/time.h> header file. */
197 #ifndef _MSC_VER
198 #define HAVE_SYS_TIME_H 1
199 #endif
201 /* Define to 1 if you have the <sys/types.h> header file. */
202 #define HAVE_SYS_TYPES_H 1
204 /* Define to 1 if you have the `time' function. */
205 #define HAVE_TIME 1
207 /* Define to 1 if you have the <unistd.h> header file. */
208 #ifndef _MSC_VER
209 #define HAVE_UNISTD_H 1
210 #endif
212 /* Define to 1 if you have the `vsnprintf' function. */
213 #define HAVE_VSNPRINTF 1
215 /* Special Windows version of getpass() defined in io.c */
216 #define HAVE_GETPASS 1
218 /* Name of package */
219 #define PACKAGE openvpn
221 /* Define to the address where bug reports for this package should be sent. */
222 //#define PACKAGE_BUGREPORT "openvpn-users@lists.sourceforge.net"
224 /* Define to the full name of this package. */
225 #define PACKAGE_NAME OpenVPN
227 /* Define to the one symbol short name of this package. */
228 #define PACKAGE_TARNAME openvpn
230 /* Define to the version of this package. */
231 #define PACKAGE_VERSION 2.1.0
233 /* Define to the full name and version of this package. */
234 #ifdef DEBUG_LABEL
235 #define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION " " DEBUG_LABEL
236 #else
237 #define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION
238 #endif
240 /* Define as the return type of signal handlers (`int' or `void'). */
241 #define RETSIGTYPE void
243 /* The size of a `unsigned int', as computed by sizeof. */
244 #define SIZEOF_UNSIGNED_INT 4
246 /* The size of a `unsigned long', as computed by sizeof. */
247 #define SIZEOF_UNSIGNED_LONG 4
249 /* Define to 1 if you have the ANSI C header files. */
250 #define STDC_HEADERS 1
252 /* A string representing our target */
253 #ifdef _MSC_VER
254 #define TARGET_ALIAS "Win32-MSVC++"
255 #else
256 #define TARGET_ALIAS "Win32-MinGW"
257 #endif
259 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
260 #ifndef _MSC_VER
261 #define TIME_WITH_SYS_TIME 1
262 #endif
264 /* Use OpenSSL crypto library */
265 #define USE_CRYPTO 1
267 /* Use LZO compression library */
268 #define USE_LZO 1
270 /* LZO version number */
271 #define LZO_VERSION_NUM "2"
273 /* Use lzo/ directory prefix for LZO header files (for LZO 2.0) */
274 #define LZO_HEADER_DIR 1
276 /* Use OpenSSL SSL library */
277 #define USE_SSL 1
279 /* Version number of package */
280 #define VERSION PACKAGE_VERSION
282 /* Define as `__inline' if that's what the C compiler calls it, or to nothing
283 if it is not supported. */
284 #define inline __inline
286 /* type to use in place of socklen_t if not defined */
287 #define socklen_t unsigned int
289 /* 32-bit unsigned type */
290 #define uint32_t unsigned int
292 /* 16-bit unsigned type */
293 #define uint16_t unsigned short
295 /* 8-bit unsigned type */
296 #define uint8_t unsigned char
298 /* Route command */
299 #define ROUTE_PATH "route"
301 /* Windows doesn't support PTHREAD yet */
302 #ifdef USE_PTHREAD
303 #error The Windows version of OpenVPN does not support PTHREAD yet
304 #endif
306 #ifdef _MSC_VER
307 /* MSVC++ hacks */
308 #include <io.h>
309 #include <direct.h>
310 #define vsnprintf _vsnprintf
311 #define vsnwprintf _vsnwprintf
312 #define snwprintf _snwprintf
313 #define write _write
314 #define open _open
315 #define read _read
316 #define close _close
317 #define chdir _chdir
318 #define S_IRUSR 0
319 #define S_IWUSR 0
320 typedef int intptr_t;
321 /* Visual Studio 2005 supports vararg macros */
322 #if _MSC_VER >= 1400
323 #define HAVE_CPP_VARARG_MACRO_ISO 1
324 #endif
325 #endif