Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 1 | /* |
Willy Tarreau | 8096de9 | 2010-02-26 11:12:27 +0100 | [diff] [blame] | 2 | * include/types/global.h |
| 3 | * Global variables. |
| 4 | * |
Willy Tarreau | e9f49e7 | 2012-11-11 17:42:00 +0100 | [diff] [blame] | 5 | * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu |
Willy Tarreau | 8096de9 | 2010-02-26 11:12:27 +0100 | [diff] [blame] | 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public |
| 9 | * License as published by the Free Software Foundation, version 2.1 |
| 10 | * exclusively. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public |
| 18 | * License along with this library; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 21 | |
| 22 | #ifndef _TYPES_GLOBAL_H |
| 23 | #define _TYPES_GLOBAL_H |
| 24 | |
| 25 | #include <netinet/in.h> |
| 26 | |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 27 | #include <common/config.h> |
Willy Tarreau | 65d805f | 2014-07-15 18:05:58 +0200 | [diff] [blame] | 28 | #include <common/standard.h> |
Willy Tarreau | ba3dd2b | 2015-06-01 15:38:33 +0200 | [diff] [blame] | 29 | #include <import/da.h> |
Willy Tarreau | c7e4238 | 2012-08-24 19:22:53 +0200 | [diff] [blame] | 30 | #include <types/freq_ctr.h> |
Willy Tarreau | d1d5454 | 2012-09-12 22:58:11 +0200 | [diff] [blame] | 31 | #include <types/listener.h> |
Willy Tarreau | 89a6313 | 2009-08-16 17:41:45 +0200 | [diff] [blame] | 32 | #include <types/proxy.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 33 | #include <types/task.h> |
| 34 | |
Thomas Holmes | eef3f9f | 2015-05-12 15:47:24 +0100 | [diff] [blame] | 35 | #ifdef USE_51DEGREES |
Dragan Dosen | 93b38d9 | 2015-06-29 16:43:25 +0200 | [diff] [blame] | 36 | #include <import/51d.h> |
Thomas Holmes | eef3f9f | 2015-05-12 15:47:24 +0100 | [diff] [blame] | 37 | #endif |
| 38 | |
Emeric Brun | c8e8d12 | 2012-10-02 18:42:10 +0200 | [diff] [blame] | 39 | #ifndef UNIX_MAX_PATH |
| 40 | #define UNIX_MAX_PATH 108 |
| 41 | #endif |
| 42 | |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 43 | /* modes of operation (global.mode) */ |
Willy Tarreau | fbee713 | 2007-10-18 13:53:22 +0200 | [diff] [blame] | 44 | #define MODE_DEBUG 0x01 |
| 45 | #define MODE_DAEMON 0x02 |
| 46 | #define MODE_QUIET 0x04 |
| 47 | #define MODE_CHECK 0x08 |
| 48 | #define MODE_VERBOSE 0x10 |
| 49 | #define MODE_STARTING 0x20 |
| 50 | #define MODE_FOREGROUND 0x40 |
Marc-Antoine Perennou | 992709b | 2013-02-12 10:53:52 +0100 | [diff] [blame] | 51 | #define MODE_SYSTEMD 0x80 |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 52 | |
Willy Tarreau | 77074d5 | 2006-11-12 23:57:19 +0100 | [diff] [blame] | 53 | /* list of last checks to perform, depending on config options */ |
| 54 | #define LSTCHK_CAP_BIND 0x00000001 /* check that we can bind to any port */ |
Willy Tarreau | 29fbe51 | 2015-08-20 19:35:14 +0200 | [diff] [blame] | 55 | #define LSTCHK_NETADM 0x00000002 /* check that we have CAP_NET_ADMIN */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 56 | |
Willy Tarreau | 43b7899 | 2009-01-25 15:42:27 +0100 | [diff] [blame] | 57 | /* Global tuning options */ |
| 58 | /* available polling mechanisms */ |
| 59 | #define GTUNE_USE_SELECT (1<<0) |
| 60 | #define GTUNE_USE_POLL (1<<1) |
| 61 | #define GTUNE_USE_EPOLL (1<<2) |
| 62 | #define GTUNE_USE_KQUEUE (1<<3) |
Willy Tarreau | 3ab68cf | 2009-01-25 16:03:28 +0100 | [diff] [blame] | 63 | /* platform-specific options */ |
Willy Tarreau | e9f49e7 | 2012-11-11 17:42:00 +0100 | [diff] [blame] | 64 | #define GTUNE_USE_SPLICE (1<<4) |
Nenad Merdanovic | 88afe03 | 2014-04-14 15:56:58 +0200 | [diff] [blame] | 65 | #define GTUNE_USE_GAI (1<<5) |
Lukas Tribus | a0bcbdc | 2016-09-12 21:42:20 +0000 | [diff] [blame] | 66 | #define GTUNE_USE_REUSEPORT (1<<6) |
Willy Tarreau | 43b7899 | 2009-01-25 15:42:27 +0100 | [diff] [blame] | 67 | |
Willy Tarreau | 6162db2 | 2009-10-10 17:13:00 +0200 | [diff] [blame] | 68 | /* Access level for a stats socket */ |
| 69 | #define ACCESS_LVL_NONE 0 |
| 70 | #define ACCESS_LVL_USER 1 |
| 71 | #define ACCESS_LVL_OPER 2 |
| 72 | #define ACCESS_LVL_ADMIN 3 |
Willy Tarreau | 43b7899 | 2009-01-25 15:42:27 +0100 | [diff] [blame] | 73 | |
Emeric Brun | 850efd5 | 2014-01-29 12:24:34 +0100 | [diff] [blame] | 74 | /* SSL server verify mode */ |
| 75 | enum { |
| 76 | SSL_SERVER_VERIFY_NONE = 0, |
| 77 | SSL_SERVER_VERIFY_REQUIRED = 1, |
| 78 | }; |
| 79 | |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 80 | /* FIXME : this will have to be redefined correctly */ |
| 81 | struct global { |
Emeric Brun | c8e8d12 | 2012-10-02 18:42:10 +0200 | [diff] [blame] | 82 | #ifdef USE_OPENSSL |
| 83 | char *crt_base; /* base directory path for certificates */ |
| 84 | char *ca_base; /* base directory path for CAs and CRLs */ |
| 85 | #endif |
Willy Tarreau | 77074d5 | 2006-11-12 23:57:19 +0100 | [diff] [blame] | 86 | int uid; |
| 87 | int gid; |
Simon Horman | 98637e5 | 2014-06-20 12:30:16 +0900 | [diff] [blame] | 88 | int external_check; |
Willy Tarreau | 77074d5 | 2006-11-12 23:57:19 +0100 | [diff] [blame] | 89 | int nbproc; |
Willy Tarreau | 91886b6 | 2011-09-07 14:38:31 +0200 | [diff] [blame] | 90 | int maxconn, hardmaxconn; |
Willy Tarreau | 403edff | 2012-09-06 11:58:37 +0200 | [diff] [blame] | 91 | int maxsslconn; |
Willy Tarreau | d92aa5c | 2015-01-15 21:34:39 +0100 | [diff] [blame] | 92 | int ssl_session_max_cost; /* how many bytes an SSL session may cost */ |
| 93 | int ssl_handshake_max_cost; /* how many bytes an SSL handshake may use */ |
Willy Tarreau | fce0311 | 2015-01-15 21:32:40 +0100 | [diff] [blame] | 94 | int ssl_used_frontend; /* non-zero if SSL is used in a frontend */ |
| 95 | int ssl_used_backend; /* non-zero if SSL is used in a backend */ |
| 96 | #ifdef USE_OPENSSL |
Emeric Brun | 76d8895 | 2012-10-05 15:47:31 +0200 | [diff] [blame] | 97 | char *listen_default_ciphers; |
| 98 | char *connect_default_ciphers; |
Emeric Brun | 2c86cbf | 2014-10-30 15:56:50 +0100 | [diff] [blame] | 99 | int listen_default_ssloptions; |
| 100 | int connect_default_ssloptions; |
Willy Tarreau | 403edff | 2012-09-06 11:58:37 +0200 | [diff] [blame] | 101 | #endif |
Emeric Brun | 850efd5 | 2014-01-29 12:24:34 +0100 | [diff] [blame] | 102 | unsigned int ssl_server_verify; /* default verify mode on servers side */ |
Willy Tarreau | 81c25d0 | 2011-09-07 15:17:21 +0200 | [diff] [blame] | 103 | struct freq_ctr conn_per_sec; |
Willy Tarreau | 93e7c00 | 2013-10-07 18:51:07 +0200 | [diff] [blame] | 104 | struct freq_ctr sess_per_sec; |
Willy Tarreau | e43d532 | 2013-10-07 20:01:52 +0200 | [diff] [blame] | 105 | struct freq_ctr ssl_per_sec; |
Willy Tarreau | 0c9c272 | 2014-05-28 12:28:58 +0200 | [diff] [blame] | 106 | struct freq_ctr ssl_fe_keys_per_sec; |
| 107 | struct freq_ctr ssl_be_keys_per_sec; |
William Lallemand | d85f917 | 2012-11-09 17:05:39 +0100 | [diff] [blame] | 108 | struct freq_ctr comp_bps_in; /* bytes per second, before http compression */ |
| 109 | struct freq_ctr comp_bps_out; /* bytes per second, after http compression */ |
Willy Tarreau | 81c25d0 | 2011-09-07 15:17:21 +0200 | [diff] [blame] | 110 | int cps_lim, cps_max; |
Willy Tarreau | 93e7c00 | 2013-10-07 18:51:07 +0200 | [diff] [blame] | 111 | int sps_lim, sps_max; |
Willy Tarreau | e43d532 | 2013-10-07 20:01:52 +0200 | [diff] [blame] | 112 | int ssl_lim, ssl_max; |
Willy Tarreau | 0c9c272 | 2014-05-28 12:28:58 +0200 | [diff] [blame] | 113 | int ssl_fe_keys_max, ssl_be_keys_max; |
Willy Tarreau | ce3f913 | 2014-05-28 16:47:01 +0200 | [diff] [blame] | 114 | unsigned int shctx_lookups, shctx_misses; |
William Lallemand | d85f917 | 2012-11-09 17:05:39 +0100 | [diff] [blame] | 115 | int comp_rate_lim; /* HTTP compression rate limit */ |
Willy Tarreau | 3ec79b9 | 2009-01-18 20:39:42 +0100 | [diff] [blame] | 116 | int maxpipes; /* max # of pipes */ |
Willy Tarreau | 77074d5 | 2006-11-12 23:57:19 +0100 | [diff] [blame] | 117 | int maxsock; /* max # of sockets */ |
| 118 | int rlimit_nofile; /* default ulimit-n value : 0=unset */ |
Willy Tarreau | 7006045 | 2015-12-14 12:46:07 +0100 | [diff] [blame] | 119 | int rlimit_memmax_all; /* default all-process memory limit in megs ; 0=unset */ |
| 120 | int rlimit_memmax; /* default per-process memory limit in megs ; 0=unset */ |
William Lallemand | e3a7d99 | 2012-11-20 11:25:20 +0100 | [diff] [blame] | 121 | long maxzlibmem; /* max RAM for zlib in bytes */ |
Willy Tarreau | 77074d5 | 2006-11-12 23:57:19 +0100 | [diff] [blame] | 122 | int mode; |
Willy Tarreau | 1f0da24 | 2014-01-25 11:01:50 +0100 | [diff] [blame] | 123 | unsigned int req_count; /* request counter (HTTP or TCP session) for logs and unique_id */ |
Willy Tarreau | 77074d5 | 2006-11-12 23:57:19 +0100 | [diff] [blame] | 124 | int last_checks; |
Krzysztof Oledzki | b304dc7 | 2007-10-14 23:40:01 +0200 | [diff] [blame] | 125 | int spread_checks; |
Willy Tarreau | 1746eec | 2014-04-25 10:46:47 +0200 | [diff] [blame] | 126 | int max_spread_checks; |
Willy Tarreau | 18324f5 | 2014-06-27 18:10:07 +0200 | [diff] [blame] | 127 | int max_syslog_len; |
Willy Tarreau | 77074d5 | 2006-11-12 23:57:19 +0100 | [diff] [blame] | 128 | char *chroot; |
| 129 | char *pidfile; |
Krzysztof Piotr Oledzki | 48cb2ae | 2009-10-02 22:51:14 +0200 | [diff] [blame] | 130 | char *node, *desc; /* node name & description */ |
Dragan Dosen | 43885c7 | 2015-10-01 13:18:13 +0200 | [diff] [blame] | 131 | struct chunk log_tag; /* name for syslog */ |
William Lallemand | 0f99e34 | 2011-10-12 17:50:54 +0200 | [diff] [blame] | 132 | struct list logsrvs; |
Joe Williams | df5b38f | 2010-12-29 17:05:48 +0100 | [diff] [blame] | 133 | char *log_send_hostname; /* set hostname in syslog header */ |
Baptiste Assmann | 6bc8936 | 2015-08-23 09:22:25 +0200 | [diff] [blame] | 134 | char *server_state_base; /* path to a directory where server state files can be found */ |
Baptiste Assmann | e088226 | 2015-08-23 09:54:31 +0200 | [diff] [blame] | 135 | char *server_state_file; /* path to the file where server states are loaded from */ |
Willy Tarreau | 1db3771 | 2007-06-03 17:16:49 +0200 | [diff] [blame] | 136 | struct { |
| 137 | int maxpollevents; /* max number of poll events at once */ |
Willy Tarreau | a0250ba | 2008-01-06 11:22:57 +0100 | [diff] [blame] | 138 | int maxaccept; /* max number of consecutive accept() */ |
Willy Tarreau | 43b7899 | 2009-01-25 15:42:27 +0100 | [diff] [blame] | 139 | int options; /* various tuning options */ |
Willy Tarreau | 6f4a82c | 2009-03-21 20:43:57 +0100 | [diff] [blame] | 140 | int recv_enough; /* how many input bytes at once are "enough" */ |
Willy Tarreau | 27a674e | 2009-08-17 07:23:33 +0200 | [diff] [blame] | 141 | int bufsize; /* buffer size in bytes, defaults to BUFSIZE */ |
| 142 | int maxrewrite; /* buffer max rewrite size in bytes, defaults to MAXREWRITE */ |
Willy Tarreau | a24adf0 | 2014-11-27 01:11:56 +0100 | [diff] [blame] | 143 | int reserved_bufs; /* how many buffers can only be allocated for response */ |
Willy Tarreau | 33cb065 | 2014-12-23 22:52:37 +0100 | [diff] [blame] | 144 | int buf_limit; /* if not null, how many total buffers may only be allocated */ |
Willy Tarreau | e803de2 | 2010-01-21 17:43:04 +0100 | [diff] [blame] | 145 | int client_sndbuf; /* set client sndbuf to this value if not null */ |
| 146 | int client_rcvbuf; /* set client rcvbuf to this value if not null */ |
| 147 | int server_sndbuf; /* set server sndbuf to this value if not null */ |
| 148 | int server_rcvbuf; /* set server rcvbuf to this value if not null */ |
Willy Tarreau | 43961d5 | 2010-10-04 20:39:20 +0200 | [diff] [blame] | 149 | int chksize; /* check buffer size in bytes, defaults to BUFSIZE */ |
Willy Tarreau | bd9a0a7 | 2011-10-23 21:14:29 +0200 | [diff] [blame] | 150 | int pipesize; /* pipe size in bytes, system defaults if zero */ |
Willy Tarreau | ac1932d | 2011-10-24 19:14:41 +0200 | [diff] [blame] | 151 | int max_http_hdr; /* max number of HTTP headers, use MAX_HTTP_HDR if zero */ |
Willy Tarreau | 193b8c6 | 2012-11-22 00:17:38 +0100 | [diff] [blame] | 152 | int cookie_len; /* max length of cookie captures */ |
Willy Tarreau | f3045d2 | 2015-04-29 16:24:50 +0200 | [diff] [blame] | 153 | int pattern_cache; /* max number of entries in the pattern cache. */ |
Emeric Brun | fc32aca | 2012-09-03 12:10:29 +0200 | [diff] [blame] | 154 | int sslcachesize; /* SSL cache size in session, defaults to 20000 */ |
Willy Tarreau | fce0311 | 2015-01-15 21:32:40 +0100 | [diff] [blame] | 155 | #ifdef USE_OPENSSL |
Emeric Brun | 8dc6039 | 2014-05-09 13:52:00 +0200 | [diff] [blame] | 156 | int sslprivatecache; /* Force to use a private session cache even if nbproc > 1 */ |
Emeric Brun | 4f65bff | 2012-11-16 15:11:00 +0100 | [diff] [blame] | 157 | unsigned int ssllifetime; /* SSL session lifetime in seconds */ |
Willy Tarreau | bfd5946 | 2013-02-21 07:46:09 +0100 | [diff] [blame] | 158 | unsigned int ssl_max_record; /* SSL max record size */ |
Remi Gacogne | f46cd6e | 2014-06-12 14:58:40 +0200 | [diff] [blame] | 159 | unsigned int ssl_default_dh_param; /* SSL maximum DH parameter size */ |
Christopher Faulet | 31af49d | 2015-06-09 17:29:50 +0200 | [diff] [blame] | 160 | int ssl_ctx_cache; /* max number of entries in the ssl_ctx cache. */ |
Emeric Brun | fc32aca | 2012-09-03 12:10:29 +0200 | [diff] [blame] | 161 | #endif |
William Lallemand | a509e4c | 2012-11-07 16:54:34 +0100 | [diff] [blame] | 162 | #ifdef USE_ZLIB |
| 163 | int zlibmemlevel; /* zlib memlevel */ |
| 164 | int zlibwindowsize; /* zlib window size */ |
| 165 | #endif |
William Lallemand | f374783 | 2012-11-09 12:33:10 +0100 | [diff] [blame] | 166 | int comp_maxlevel; /* max HTTP compression level */ |
Willy Tarreau | 7e31273 | 2014-02-12 16:35:14 +0100 | [diff] [blame] | 167 | unsigned short idle_timer; /* how long before an empty buffer is considered idle (ms) */ |
Willy Tarreau | 1db3771 | 2007-06-03 17:16:49 +0200 | [diff] [blame] | 168 | } tune; |
Emeric Brun | ed76092 | 2010-10-22 17:59:25 +0200 | [diff] [blame] | 169 | struct { |
| 170 | char *prefix; /* path prefix of unix bind socket */ |
| 171 | struct { /* UNIX socket permissions */ |
| 172 | uid_t uid; /* -1 to leave unchanged */ |
| 173 | gid_t gid; /* -1 to leave unchanged */ |
| 174 | mode_t mode; /* 0 to leave unchanged */ |
Emeric Brun | ed76092 | 2010-10-22 17:59:25 +0200 | [diff] [blame] | 175 | } ux; |
| 176 | } unix_bind; |
Willy Tarreau | fc6c032 | 2012-11-16 16:12:27 +0100 | [diff] [blame] | 177 | #ifdef USE_CPU_AFFINITY |
Willy Tarreau | a9db57e | 2013-01-18 11:29:29 +0100 | [diff] [blame] | 178 | unsigned long cpu_map[LONGBITS]; /* list of CPU masks for the 32/64 first processes */ |
Willy Tarreau | fc6c032 | 2012-11-16 16:12:27 +0100 | [diff] [blame] | 179 | #endif |
Willy Tarreau | 89a6313 | 2009-08-16 17:41:45 +0200 | [diff] [blame] | 180 | struct proxy *stats_fe; /* the frontend holding the stats settings */ |
David Carlier | 88d13cb | 2015-06-01 13:53:01 +0200 | [diff] [blame] | 181 | #ifdef USE_DEVICEATLAS |
| 182 | struct { |
| 183 | void *atlasimgptr; |
| 184 | char *jsonpath; |
David Carlier | 5801a82 | 2015-09-25 14:13:44 +0100 | [diff] [blame] | 185 | char *cookiename; |
| 186 | size_t cookienamelen; |
David Carlier | 88d13cb | 2015-06-01 13:53:01 +0200 | [diff] [blame] | 187 | da_atlas_t atlas; |
| 188 | da_evidence_id_t useragentid; |
| 189 | da_severity_t loglevel; |
| 190 | char separator; |
David Carlier | 5801a82 | 2015-09-25 14:13:44 +0100 | [diff] [blame] | 191 | unsigned char daset:1; |
David Carlier | 88d13cb | 2015-06-01 13:53:01 +0200 | [diff] [blame] | 192 | } deviceatlas; |
| 193 | #endif |
Thomas Holmes | eef3f9f | 2015-05-12 15:47:24 +0100 | [diff] [blame] | 194 | #ifdef USE_51DEGREES |
Dragan Dosen | 93b38d9 | 2015-06-29 16:43:25 +0200 | [diff] [blame] | 195 | struct { |
| 196 | char property_separator; /* the separator to use in the response for the values. this is taken from 51degrees-property-separator from config. */ |
| 197 | struct list property_names; /* list of properties to load into the data set. this is taken from 51degrees-property-name-list from config. */ |
| 198 | char *data_file_path; |
James Rosewell | 1079096 | 2015-09-18 17:13:47 +0100 | [diff] [blame] | 199 | int header_count; /* number of HTTP headers related to device detection. */ |
| 200 | struct chunk *header_names; /* array of HTTP header names. */ |
ben51degrees | 1f077eb | 2016-07-06 12:07:21 +0100 | [diff] [blame] | 201 | fiftyoneDegreesDataSet data_set; /* data set used with the pattern and trie detection methods. */ |
Thomas Holmes | 4d441a7 | 2015-05-29 12:54:25 +0100 | [diff] [blame] | 202 | #ifdef FIFTYONEDEGREES_H_PATTERN_INCLUDED |
James Rosewell | 1079096 | 2015-09-18 17:13:47 +0100 | [diff] [blame] | 203 | fiftyoneDegreesWorksetPool *pool; /* pool of worksets to avoid creating a new one for each request. */ |
| 204 | #endif |
| 205 | #ifdef FIFTYONEDEGREES_H_TRIE_INCLUDED |
| 206 | int32_t *header_offsets; /* offsets to the HTTP header name string. */ |
| 207 | fiftyoneDegreesDeviceOffsets device_offsets; /* Memory used for device offsets. */ |
Thomas Holmes | 4d441a7 | 2015-05-29 12:54:25 +0100 | [diff] [blame] | 208 | #endif |
Dragan Dosen | 105c8e6 | 2015-06-29 16:43:26 +0200 | [diff] [blame] | 209 | int cache_size; |
Dragan Dosen | 93b38d9 | 2015-06-29 16:43:25 +0200 | [diff] [blame] | 210 | } _51degrees; |
Thomas Holmes | eef3f9f | 2015-05-12 15:47:24 +0100 | [diff] [blame] | 211 | #endif |
scientiamobile | d0027ed | 2016-11-04 10:55:08 +0100 | [diff] [blame] | 212 | #ifdef USE_WURFL |
| 213 | struct { |
| 214 | char *data_file; /* the WURFL data file */ |
| 215 | char *cache_size; /* the WURFL cache parameters */ |
| 216 | int engine_mode; /* the WURFL engine mode */ |
| 217 | int useragent_priority; /* the WURFL ua priority */ |
| 218 | struct list patch_file_list; /* the list of WURFL patch file to use */ |
| 219 | char information_list_separator; /* the separator used in request to separate values */ |
| 220 | struct list information_list; /* the list of WURFL data to return into request */ |
Willy Tarreau | e5d3169 | 2016-11-08 18:47:25 +0100 | [diff] [blame^] | 221 | void *handle; /* the handle to WURFL engine */ |
scientiamobile | d0027ed | 2016-11-04 10:55:08 +0100 | [diff] [blame] | 222 | struct eb_root btree; /* btree containing info (name/type) on WURFL data to return */ |
| 223 | } wurfl; |
| 224 | #endif |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 225 | }; |
| 226 | |
| 227 | extern struct global global; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 228 | extern int pid; /* current process id */ |
Willy Tarreau | dcd4771 | 2007-11-04 23:35:08 +0100 | [diff] [blame] | 229 | extern int relative_pid; /* process id starting at 1 */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 230 | extern int actconn; /* # of active sessions */ |
Willy Tarreau | af7ad00 | 2010-08-31 15:39:26 +0200 | [diff] [blame] | 231 | extern int listeners; |
| 232 | extern int jobs; /* # of active jobs */ |
Willy Tarreau | 19d14ef | 2012-10-29 16:51:55 +0100 | [diff] [blame] | 233 | extern struct chunk trash; |
Willy Tarreau | 8096de9 | 2010-02-26 11:12:27 +0100 | [diff] [blame] | 234 | extern char *swap_buffer; |
Willy Tarreau | bb545b4 | 2010-08-25 12:58:59 +0200 | [diff] [blame] | 235 | extern int nb_oldpids; /* contains the number of old pids found */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 236 | extern const int zero; |
| 237 | extern const int one; |
Alexandre Cassen | 87ea548 | 2007-10-11 20:48:58 +0200 | [diff] [blame] | 238 | extern const struct linger nolinger; |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 239 | extern int stopping; /* non zero means stopping in progress */ |
Willy Tarreau | 3ad6a76 | 2009-08-16 10:08:02 +0200 | [diff] [blame] | 240 | extern char hostname[MAX_HOSTNAME_LEN]; |
Emeric Brun | 2b920a1 | 2010-09-23 18:30:22 +0200 | [diff] [blame] | 241 | extern char localpeer[MAX_HOSTNAME_LEN]; |
Willy Tarreau | 08ceb10 | 2011-07-24 22:58:00 +0200 | [diff] [blame] | 242 | extern struct list global_listener_queue; /* list of the temporarily limited listeners */ |
Willy Tarreau | e9b2602 | 2011-08-01 20:57:55 +0200 | [diff] [blame] | 243 | extern struct task *global_listener_queue_task; |
Willy Tarreau | ff05550 | 2014-04-28 22:27:06 +0200 | [diff] [blame] | 244 | extern unsigned int warned; /* bitfield of a few warnings to emit just once */ |
Baptiste Assmann | 325137d | 2015-04-13 23:40:55 +0200 | [diff] [blame] | 245 | extern struct list dns_resolvers; |
Willy Tarreau | ff05550 | 2014-04-28 22:27:06 +0200 | [diff] [blame] | 246 | |
| 247 | /* bit values to go with "warned" above */ |
Willy Tarreau | de9d2d7 | 2014-04-28 22:28:02 +0200 | [diff] [blame] | 248 | #define WARN_BLOCK_DEPRECATED 0x00000001 |
Willy Tarreau | 98d0485 | 2015-05-26 12:18:29 +0200 | [diff] [blame] | 249 | /* unassigned : 0x00000002 */ |
Willy Tarreau | a3c504c | 2014-04-28 22:37:32 +0200 | [diff] [blame] | 250 | #define WARN_REDISPATCH_DEPRECATED 0x00000004 |
Willy Tarreau | ed44649 | 2014-04-28 22:56:38 +0200 | [diff] [blame] | 251 | #define WARN_CLITO_DEPRECATED 0x00000008 |
| 252 | #define WARN_SRVTO_DEPRECATED 0x00000010 |
| 253 | #define WARN_CONTO_DEPRECATED 0x00000020 |
Willy Tarreau | ff05550 | 2014-04-28 22:27:06 +0200 | [diff] [blame] | 254 | |
| 255 | /* to be used with warned and WARN_* */ |
| 256 | static inline int already_warned(unsigned int warning) |
| 257 | { |
| 258 | if (warned & warning) |
| 259 | return 1; |
| 260 | warned |= warning; |
| 261 | return 0; |
| 262 | } |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 263 | |
| 264 | #endif /* _TYPES_GLOBAL_H */ |
| 265 | |
| 266 | /* |
| 267 | * Local variables: |
| 268 | * c-indent-level: 8 |
| 269 | * c-basic-offset: 8 |
| 270 | * End: |
| 271 | */ |