OpenVPN
common.h
Go to the documentation of this file.
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.
7  *
8  * Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net>
9  *
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.
13  *
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.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 #ifndef COMMON_H
25 #define COMMON_H
26 
27 /*
28  * Statistics counters and associated printf formats.
29  */
30 #ifdef USE_64_BIT_COUNTERS
31 typedef unsigned long long int counter_type;
32 #ifdef _WIN32
33 #define counter_format "%I64u"
34 #else
35 #define counter_format "%llu"
36 #endif
37 #else /* ifdef USE_64_BIT_COUNTERS */
38 typedef unsigned int counter_type;
39 #define counter_format "%u"
40 #endif
41 
42 /*
43  * Time intervals
44  */
45 typedef int interval_t;
46 
47 /*
48  * Used as an upper bound for timeouts.
49  */
50 #define BIG_TIMEOUT (60*60*24*7) /* one week (in seconds) */
51 
52 /*
53  * Printf formats for special types
54  */
55 #ifdef _WIN64
56 #define ptr_format "0x%I64x"
57 #else
58 #define ptr_format "0x%08lx"
59 #endif
60 #define fragment_header_format "0x%08x"
61 
62 /* these are used to cast the arguments
63  * and MUST match the formats above */
64 #ifdef _WIN64
65 typedef unsigned long long ptr_type;
66 #else
67 typedef unsigned long ptr_type;
68 #endif
69 
70 /* the --client-config-dir default file */
71 #define CCD_DEFAULT "DEFAULT"
72 
73 /*
74  * This parameter controls the TLS channel buffer size and the
75  * maximum size of a single TLS message (cleartext).
76  * This parameter must be >= PUSH_BUNDLE_SIZE
77  */
78 #define TLS_CHANNEL_BUF_SIZE 2048
79 
80 /*
81  * This parameter controls the maximum size of a bundle
82  * of pushed options.
83  */
84 #define PUSH_BUNDLE_SIZE 1024
85 
86 /*
87  * In how many seconds does client re-send PUSH_REQUEST if we haven't yet received a reply
88  */
89 #define PUSH_REQUEST_INTERVAL 5
90 
91 /*
92  * A sort of pseudo-filename for data provided inline within
93  * the configuration file.
94  */
95 #define INLINE_FILE_TAG "[[INLINE]]"
96 
97 /*
98  * Script security warning
99  */
100 #define SCRIPT_SECURITY_WARNING "WARNING: External program may not be called unless '--script-security 2' or higher is enabled. See --help text or man page for detailed info."
101 
102 #endif /* ifndef COMMON_H */
unsigned long ptr_type
Definition: common.h:67
unsigned int counter_type
Definition: common.h:38
int interval_t
Definition: common.h:45