blob: 407fbff60067d332af6f848fee08bf8de59fd37d [file] [log] [blame]
Willy Tarreaubaaee002006-06-26 02:48:02 +02001/*
Willy Tarreau8096de92010-02-26 11:12:27 +01002 * include/types/global.h
3 * Global variables.
4 *
Willy Tarreaue9f49e72012-11-11 17:42:00 +01005 * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu
Willy Tarreau8096de92010-02-26 11:12:27 +01006 *
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 Tarreaubaaee002006-06-26 02:48:02 +020021
22#ifndef _TYPES_GLOBAL_H
23#define _TYPES_GLOBAL_H
24
25#include <netinet/in.h>
26
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020027#include <common/config.h>
Willy Tarreau80713382018-11-26 10:19:54 +010028#include <common/initcall.h>
Christopher Faulet6adad112017-04-21 16:47:03 +020029#include <common/hathreads.h>
30
Willy Tarreauf23e0292020-03-06 18:44:07 +010031#include <types/freq_ctr.h>
Willy Tarreaud1d54542012-09-12 22:58:11 +020032#include <types/listener.h>
Willy Tarreau89a63132009-08-16 17:41:45 +020033#include <types/proxy.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020034#include <types/task.h>
Christopher Fauletff2613e2016-11-09 11:36:17 +010035#include <types/vars.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020036
Emeric Brunc8e8d122012-10-02 18:42:10 +020037#ifndef UNIX_MAX_PATH
38#define UNIX_MAX_PATH 108
39#endif
40
Willy Tarreaubaaee002006-06-26 02:48:02 +020041/* modes of operation (global.mode) */
Willy Tarreaufbee7132007-10-18 13:53:22 +020042#define MODE_DEBUG 0x01
43#define MODE_DAEMON 0x02
44#define MODE_QUIET 0x04
45#define MODE_CHECK 0x08
46#define MODE_VERBOSE 0x10
47#define MODE_STARTING 0x20
48#define MODE_FOREGROUND 0x40
William Lallemand095ba4c2017-06-01 17:38:50 +020049#define MODE_MWORKER 0x80 /* Master Worker */
William Lallemand944e6192018-11-21 15:48:31 +010050#define MODE_MWORKER_WAIT 0x100 /* Master Worker wait mode */
Willy Tarreau3eb10b82020-04-15 16:42:39 +020051#define MODE_ZERO_WARNING 0x200 /* warnings cause a failure */
Willy Tarreaubaaee002006-06-26 02:48:02 +020052
Willy Tarreau77074d52006-11-12 23:57:19 +010053/* 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 Tarreau29fbe512015-08-20 19:35:14 +020055#define LSTCHK_NETADM 0x00000002 /* check that we have CAP_NET_ADMIN */
Willy Tarreaubaaee002006-06-26 02:48:02 +020056
Willy Tarreau43b78992009-01-25 15:42:27 +010057/* 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 Tarreau3ab68cf2009-01-25 16:03:28 +010063/* platform-specific options */
Willy Tarreaue9f49e72012-11-11 17:42:00 +010064#define GTUNE_USE_SPLICE (1<<4)
Nenad Merdanovic88afe032014-04-14 15:56:58 +020065#define GTUNE_USE_GAI (1<<5)
Lukas Tribusa0bcbdc2016-09-12 21:42:20 +000066#define GTUNE_USE_REUSEPORT (1<<6)
Willy Tarreau3eed10e2016-11-07 21:03:16 +010067#define GTUNE_RESOLVE_DONTFAIL (1<<7)
Willy Tarreau43b78992009-01-25 15:42:27 +010068
Olivier Houchard1fc05162017-04-06 01:05:05 +020069#define GTUNE_SOCKET_TRANSFER (1<<8)
William Lallemand4cfede82017-11-24 22:02:34 +010070#define GTUNE_NOEXIT_ONFAILURE (1<<9)
Tim Duesterhusd6942c82017-11-20 15:58:35 +010071#define GTUNE_USE_SYSTEMD (1<<10)
Olivier Houchard1fc05162017-04-06 01:05:05 +020072
Willy Tarreaubeb859a2018-11-22 18:07:59 +010073#define GTUNE_BUSY_POLLING (1<<11)
Willy Tarreau7ac908b2019-02-27 12:02:18 +010074#define GTUNE_LISTENER_MQ (1<<12)
Willy Tarreau636848a2019-04-15 19:38:50 +020075#define GTUNE_SET_DUMPABLE (1<<13)
Emmanuel Hocdet0ba4f482019-04-08 16:53:32 +000076#define GTUNE_USE_EVPORTS (1<<14)
William Dauchy0fec3ab2019-10-27 20:08:11 +010077#define GTUNE_STRICT_LIMITS (1<<15)
Willy Tarreaud96f1122019-12-03 07:07:36 +010078#define GTUNE_INSECURE_FORK (1<<16)
Willy Tarreaua45a8b52019-12-06 16:31:45 +010079#define GTUNE_INSECURE_SETUID (1<<17)
Emmanuel Hocdet0ba4f482019-04-08 16:53:32 +000080
Emeric Brun850efd52014-01-29 12:24:34 +010081/* SSL server verify mode */
82enum {
83 SSL_SERVER_VERIFY_NONE = 0,
84 SSL_SERVER_VERIFY_REQUIRED = 1,
85};
86
Willy Tarreaubaaee002006-06-26 02:48:02 +020087/* FIXME : this will have to be redefined correctly */
88struct global {
Willy Tarreau77074d52006-11-12 23:57:19 +010089 int uid;
90 int gid;
Simon Horman98637e52014-06-20 12:30:16 +090091 int external_check;
Willy Tarreau77074d52006-11-12 23:57:19 +010092 int nbproc;
Christopher Fauletbe0faa22017-08-29 15:37:10 +020093 int nbthread;
Cyril Bonté203ec5a2017-03-23 22:44:13 +010094 unsigned int hard_stop_after; /* maximum time allowed to perform a soft-stop */
Willy Tarreau91886b62011-09-07 14:38:31 +020095 int maxconn, hardmaxconn;
Willy Tarreau403edff2012-09-06 11:58:37 +020096 int maxsslconn;
Willy Tarreaud92aa5c2015-01-15 21:34:39 +010097 int ssl_session_max_cost; /* how many bytes an SSL session may cost */
98 int ssl_handshake_max_cost; /* how many bytes an SSL handshake may use */
Willy Tarreaufce03112015-01-15 21:32:40 +010099 int ssl_used_frontend; /* non-zero if SSL is used in a frontend */
100 int ssl_used_backend; /* non-zero if SSL is used in a backend */
Emeric Brunece0c332017-12-06 13:51:49 +0100101 int ssl_used_async_engines; /* number of used async engines */
Emeric Brun850efd52014-01-29 12:24:34 +0100102 unsigned int ssl_server_verify; /* default verify mode on servers side */
Willy Tarreau81c25d02011-09-07 15:17:21 +0200103 struct freq_ctr conn_per_sec;
Willy Tarreau93e7c002013-10-07 18:51:07 +0200104 struct freq_ctr sess_per_sec;
Willy Tarreaue43d5322013-10-07 20:01:52 +0200105 struct freq_ctr ssl_per_sec;
Willy Tarreau0c9c2722014-05-28 12:28:58 +0200106 struct freq_ctr ssl_fe_keys_per_sec;
107 struct freq_ctr ssl_be_keys_per_sec;
William Lallemandd85f9172012-11-09 17:05:39 +0100108 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 Tarreau7cf0e452019-05-23 11:39:14 +0200110 struct freq_ctr out_32bps; /* #of 32-byte blocks emitted per second */
111 unsigned long long out_bytes; /* total #of bytes emitted */
Willy Tarreau81c25d02011-09-07 15:17:21 +0200112 int cps_lim, cps_max;
Willy Tarreau93e7c002013-10-07 18:51:07 +0200113 int sps_lim, sps_max;
Willy Tarreaue43d5322013-10-07 20:01:52 +0200114 int ssl_lim, ssl_max;
Willy Tarreau0c9c2722014-05-28 12:28:58 +0200115 int ssl_fe_keys_max, ssl_be_keys_max;
Willy Tarreauce3f9132014-05-28 16:47:01 +0200116 unsigned int shctx_lookups, shctx_misses;
William Lallemandd85f9172012-11-09 17:05:39 +0100117 int comp_rate_lim; /* HTTP compression rate limit */
Willy Tarreau3ec79b92009-01-18 20:39:42 +0100118 int maxpipes; /* max # of pipes */
Willy Tarreau77074d52006-11-12 23:57:19 +0100119 int maxsock; /* max # of sockets */
120 int rlimit_nofile; /* default ulimit-n value : 0=unset */
Willy Tarreau70060452015-12-14 12:46:07 +0100121 int rlimit_memmax_all; /* default all-process memory limit in megs ; 0=unset */
122 int rlimit_memmax; /* default per-process memory limit in megs ; 0=unset */
William Lallemande3a7d992012-11-20 11:25:20 +0100123 long maxzlibmem; /* max RAM for zlib in bytes */
Willy Tarreau77074d52006-11-12 23:57:19 +0100124 int mode;
Willy Tarreau1f0da242014-01-25 11:01:50 +0100125 unsigned int req_count; /* request counter (HTTP or TCP session) for logs and unique_id */
Willy Tarreau77074d52006-11-12 23:57:19 +0100126 int last_checks;
Krzysztof Oledzkib304dc72007-10-14 23:40:01 +0200127 int spread_checks;
Willy Tarreau1746eec2014-04-25 10:46:47 +0200128 int max_spread_checks;
Willy Tarreau18324f52014-06-27 18:10:07 +0200129 int max_syslog_len;
Willy Tarreau77074d52006-11-12 23:57:19 +0100130 char *chroot;
131 char *pidfile;
Krzysztof Piotr Oledzki48cb2ae2009-10-02 22:51:14 +0200132 char *node, *desc; /* node name & description */
Willy Tarreau83061a82018-07-13 11:56:34 +0200133 struct buffer log_tag; /* name for syslog */
William Lallemand0f99e342011-10-12 17:50:54 +0200134 struct list logsrvs;
Joe Williamsdf5b38f2010-12-29 17:05:48 +0100135 char *log_send_hostname; /* set hostname in syslog header */
Baptiste Assmann6bc89362015-08-23 09:22:25 +0200136 char *server_state_base; /* path to a directory where server state files can be found */
Baptiste Assmanne0882262015-08-23 09:54:31 +0200137 char *server_state_file; /* path to the file where server states are loaded from */
Willy Tarreau1db37712007-06-03 17:16:49 +0200138 struct {
139 int maxpollevents; /* max number of poll events at once */
Willy Tarreaua0250ba2008-01-06 11:22:57 +0100140 int maxaccept; /* max number of consecutive accept() */
Willy Tarreau43b78992009-01-25 15:42:27 +0100141 int options; /* various tuning options */
Olivier Houchard1599b802018-05-24 18:59:04 +0200142 int runqueue_depth;/* max number of tasks to run at once */
Willy Tarreau6f4a82c2009-03-21 20:43:57 +0100143 int recv_enough; /* how many input bytes at once are "enough" */
Willy Tarreau27a674e2009-08-17 07:23:33 +0200144 int bufsize; /* buffer size in bytes, defaults to BUFSIZE */
145 int maxrewrite; /* buffer max rewrite size in bytes, defaults to MAXREWRITE */
Willy Tarreaua24adf02014-11-27 01:11:56 +0100146 int reserved_bufs; /* how many buffers can only be allocated for response */
Willy Tarreau33cb0652014-12-23 22:52:37 +0100147 int buf_limit; /* if not null, how many total buffers may only be allocated */
Willy Tarreaue803de22010-01-21 17:43:04 +0100148 int client_sndbuf; /* set client sndbuf to this value if not null */
149 int client_rcvbuf; /* set client rcvbuf to this value if not null */
150 int server_sndbuf; /* set server sndbuf to this value if not null */
151 int server_rcvbuf; /* set server rcvbuf to this value if not null */
Willy Tarreau43961d52010-10-04 20:39:20 +0200152 int chksize; /* check buffer size in bytes, defaults to BUFSIZE */
Willy Tarreaubd9a0a72011-10-23 21:14:29 +0200153 int pipesize; /* pipe size in bytes, system defaults if zero */
Willy Tarreauac1932d2011-10-24 19:14:41 +0200154 int max_http_hdr; /* max number of HTTP headers, use MAX_HTTP_HDR if zero */
Stéphane Cottin23e9e932017-05-18 08:58:41 +0200155 int requri_len; /* max len of request URI, use REQURI_LEN if zero */
Willy Tarreau193b8c62012-11-22 00:17:38 +0100156 int cookie_len; /* max length of cookie captures */
Willy Tarreauf3045d22015-04-29 16:24:50 +0200157 int pattern_cache; /* max number of entries in the pattern cache. */
Emeric Brunfc32aca2012-09-03 12:10:29 +0200158 int sslcachesize; /* SSL cache size in session, defaults to 20000 */
William Lallemandf3747832012-11-09 12:33:10 +0100159 int comp_maxlevel; /* max HTTP compression level */
Olivier Houchard88698d92019-04-16 19:07:22 +0200160 int pool_low_ratio; /* max ratio of FDs used before we stop using new idle connections */
161 int pool_high_ratio; /* max ratio of FDs used before we start killing idle connections when creating new connections */
162 int pool_low_count; /* max number of opened fd before we stop using new idle connections */
163 int pool_high_count; /* max number of opened fd before we start killing idle connections when creating new connections */
Willy Tarreau7e312732014-02-12 16:35:14 +0100164 unsigned short idle_timer; /* how long before an empty buffer is considered idle (ms) */
Willy Tarreau1db37712007-06-03 17:16:49 +0200165 } tune;
Emeric Bruned760922010-10-22 17:59:25 +0200166 struct {
167 char *prefix; /* path prefix of unix bind socket */
168 struct { /* UNIX socket permissions */
169 uid_t uid; /* -1 to leave unchanged */
170 gid_t gid; /* -1 to leave unchanged */
171 mode_t mode; /* 0 to leave unchanged */
Emeric Bruned760922010-10-22 17:59:25 +0200172 } ux;
173 } unix_bind;
Willy Tarreauf4571a02018-01-20 18:12:15 +0100174 struct proxy *stats_fe; /* the frontend holding the stats settings */
175 struct vars vars; /* list of variables for the process scope. */
Willy Tarreaufc6c0322012-11-16 16:12:27 +0100176#ifdef USE_CPU_AFFINITY
Christopher Fauletcb6a9452017-11-22 16:50:41 +0100177 struct {
Willy Tarreau81492c92019-05-03 09:41:23 +0200178 unsigned long proc[MAX_PROCS]; /* list of CPU masks for the 32/64 first processes */
Willy Tarreau7764a572019-07-16 15:10:34 +0200179 unsigned long proc_t1[MAX_PROCS]; /* list of CPU masks for the 1st thread of each process */
180 unsigned long thread[MAX_THREADS]; /* list of CPU masks for the 32/64 first threads of the 1st process */
Christopher Fauletcb6a9452017-11-22 16:50:41 +0100181 } cpu_map;
Willy Tarreaufc6c0322012-11-16 16:12:27 +0100182#endif
Willy Tarreaubaaee002006-06-26 02:48:02 +0200183};
184
William Lallemand45286112019-04-12 16:09:21 +0200185/* options for mworker_proc */
186
187#define PROC_O_TYPE_MASTER 0x00000001
188#define PROC_O_TYPE_WORKER 0x00000002
189#define PROC_O_TYPE_PROG 0x00000004
190/* 0x00000008 unused */
191#define PROC_O_LEAVING 0x00000010 /* this process should be leaving */
William Lallemandbd3de3e2019-04-12 16:09:22 +0200192/* 0x00000020 to 0x00000080 unused */
193#define PROC_O_START_RELOAD 0x00000100 /* Start the process even if the master was re-executed */
William Lallemand45286112019-04-12 16:09:21 +0200194
William Lallemand7e1299b2018-10-26 14:47:31 +0200195/*
196 * Structure used to describe the processes in master worker mode
197 */
198struct mworker_proc {
199 int pid;
William Lallemand45286112019-04-12 16:09:21 +0200200 int options;
William Lallemand9a1ee7a2019-04-01 11:30:02 +0200201 char *id;
202 char **command;
203 char *path;
William Lallemand1dc69632019-06-12 19:11:33 +0200204 char *version;
William Lallemand7e1299b2018-10-26 14:47:31 +0200205 int ipc_fd[2]; /* 0 is master side, 1 is worker side */
206 int relative_pid;
207 int reloads;
William Lallemande3683302018-11-19 18:46:17 +0100208 int timestamp;
William Lallemand291810d2018-10-26 14:47:38 +0200209 struct server *srv; /* the server entry in the master proxy */
William Lallemand7e1299b2018-10-26 14:47:31 +0200210 struct list list;
Andrew Heberle97236962019-07-12 11:50:26 +0800211 int uid;
212 int gid;
William Lallemand7e1299b2018-10-26 14:47:31 +0200213};
214
Willy Tarreaubaaee002006-06-26 02:48:02 +0200215extern struct global global;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200216extern int pid; /* current process id */
Willy Tarreaudcd47712007-11-04 23:35:08 +0100217extern int relative_pid; /* process id starting at 1 */
Willy Tarreau387bd4f2017-11-10 19:08:14 +0100218extern unsigned long pid_bit; /* bit corresponding to the process id */
Willy Tarreaua38a7172019-02-02 17:11:28 +0100219extern unsigned long all_proc_mask; /* mask of all processes */
Willy Tarreaubaaee002006-06-26 02:48:02 +0200220extern int actconn; /* # of active sessions */
Willy Tarreauaf7ad002010-08-31 15:39:26 +0200221extern int listeners;
Willy Tarreau2cc5bae2017-09-15 08:18:11 +0200222extern int jobs; /* # of active jobs (listeners, sessions, open devices) */
William Lallemanda7199262018-11-16 16:57:20 +0100223extern int unstoppable_jobs; /* # of active jobs that can't be stopped during a soft stop */
Willy Tarreau199ad242018-11-05 16:31:22 +0100224extern int active_peers; /* # of active peers (connection attempts and successes) */
Willy Tarreau2d372c22018-11-05 17:12:27 +0100225extern int connected_peers; /* # of really connected peers */
Willy Tarreau83061a82018-07-13 11:56:34 +0200226extern THREAD_LOCAL struct buffer trash;
Willy Tarreaubb545b42010-08-25 12:58:59 +0200227extern int nb_oldpids; /* contains the number of old pids found */
Willy Tarreaubaaee002006-06-26 02:48:02 +0200228extern const int zero;
229extern const int one;
Alexandre Cassen87ea5482007-10-11 20:48:58 +0200230extern const struct linger nolinger;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200231extern int stopping; /* non zero means stopping in progress */
Willy Tarreau7067b3a2019-06-02 11:11:29 +0200232extern int killed; /* >0 means a hard-stop is triggered, >1 means hard-stop immediately */
Willy Tarreau3ad6a762009-08-16 10:08:02 +0200233extern char hostname[MAX_HOSTNAME_LEN];
Emeric Brun2b920a12010-09-23 18:30:22 +0200234extern char localpeer[MAX_HOSTNAME_LEN];
Willy Tarreauff055502014-04-28 22:27:06 +0200235extern unsigned int warned; /* bitfield of a few warnings to emit just once */
Olivier Houchard79321b92018-07-26 17:55:11 +0200236extern volatile unsigned long sleeping_thread_mask;
William Lallemand6e0db2f2018-10-26 14:47:34 +0200237extern struct list proc_list; /* list of process in mworker mode */
William Lallemand16dd1b32018-11-19 18:46:18 +0100238extern struct mworker_proc *proc_self; /* process structure of current process */
William Lallemand4b58c802018-11-27 12:02:38 +0100239extern int master; /* 1 if in master, 0 otherwise */
Willy Tarreaubf696402019-03-01 10:09:28 +0100240extern unsigned int rlim_fd_cur_at_boot;
241extern unsigned int rlim_fd_max_at_boot;
William Lallemande25473c2019-04-01 11:29:56 +0200242extern int atexit_flag;
Willy Tarreau6c3a6812020-03-06 18:57:15 +0100243extern unsigned char boot_seed[20]; // per-boot random seed (160 bits initially)
Willy Tarreau522cfbc2019-05-03 10:16:39 +0200244
Willy Tarreauff055502014-04-28 22:27:06 +0200245/* bit values to go with "warned" above */
Willy Tarreaubebd2122020-04-15 16:06:11 +0200246#define WARN_ANY 0x00000001 /* any warning was emitted */
247#define WARN_FORCECLOSE_DEPRECATED 0x00000002
Willy Tarreauff055502014-04-28 22:27:06 +0200248
Willy Tarreau96d51952019-05-22 20:34:35 +0200249
Willy Tarreauff055502014-04-28 22:27:06 +0200250/* to be used with warned and WARN_* */
251static inline int already_warned(unsigned int warning)
252{
253 if (warned & warning)
254 return 1;
255 warned |= warning;
256 return 0;
257}
Willy Tarreaubaaee002006-06-26 02:48:02 +0200258
Willy Tarreau24157272019-02-02 17:22:19 +0100259/* returns a mask if set, otherwise all_proc_mask */
260static inline unsigned long proc_mask(unsigned long mask)
261{
262 return mask ? mask : all_proc_mask;
263}
264
265/* returns a mask if set, otherwise all_threads_mask */
266static inline unsigned long thread_mask(unsigned long mask)
267{
268 return mask ? mask : all_threads_mask;
269}
270
William Lallemande25473c2019-04-01 11:29:56 +0200271int tell_old_pids(int sig);
272int delete_oldpid(int pid);
273
Willy Tarreau18278452020-03-03 15:25:10 +0100274int main(int argc, char **argv);
Cyril Bonté203ec5a2017-03-23 22:44:13 +0100275void deinit(void);
Willy Tarreau3ebd55e2020-03-03 14:59:56 +0100276void run_poll_loop(void);
Willy Tarreaucdb737e2016-12-21 18:43:10 +0100277void hap_register_build_opts(const char *str, int must_free);
Willy Tarreaue6945732016-12-21 19:57:00 +0100278void hap_register_post_check(int (*fct)());
Christopher Fauletc1692962019-08-12 09:51:07 +0200279void hap_register_post_proxy_check(int (*fct)(struct proxy *));
280void hap_register_post_server_check(int (*fct)(struct server *));
Willy Tarreau05554e62016-12-21 20:46:26 +0100281void hap_register_post_deinit(void (*fct)());
Christopher Faulet3ea5cbe2019-07-31 08:44:12 +0200282void hap_register_proxy_deinit(void (*fct)(struct proxy *));
283void hap_register_server_deinit(void (*fct)(struct server *));
Willy Tarreaucdb737e2016-12-21 18:43:10 +0100284
Willy Tarreau082b6282019-05-22 14:42:12 +0200285void hap_register_per_thread_alloc(int (*fct)());
Christopher Faulet415f6112017-07-25 16:52:58 +0200286void hap_register_per_thread_init(int (*fct)());
287void hap_register_per_thread_deinit(void (*fct)());
Willy Tarreau082b6282019-05-22 14:42:12 +0200288void hap_register_per_thread_free(int (*fct)());
Christopher Faulet415f6112017-07-25 16:52:58 +0200289
William Lallemanddb6bdfb2018-11-20 17:36:51 +0100290void mworker_accept_wrapper(int fd);
William Lallemanda57b7e32018-12-14 21:11:31 +0100291void mworker_reload();
William Lallemanddb6bdfb2018-11-20 17:36:51 +0100292
Willy Tarreau80713382018-11-26 10:19:54 +0100293/* simplified way to declare static build options in a file */
294#define REGISTER_BUILD_OPTS(str) \
295 INITCALL2(STG_REGISTER, hap_register_build_opts, (str), 0)
296
Willy Tarreau172f5ce2018-11-26 11:21:50 +0100297/* simplified way to declare a post-check callback in a file */
298#define REGISTER_POST_CHECK(fct) \
299 INITCALL1(STG_REGISTER, hap_register_post_check, (fct))
300
Christopher Fauletc1692962019-08-12 09:51:07 +0200301/* simplified way to declare a post-proxy-check callback in a file */
302#define REGISTER_POST_PROXY_CHECK(fct) \
303 INITCALL1(STG_REGISTER, hap_register_post_proxy_check, (fct))
304
305/* simplified way to declare a post-server-check callback in a file */
306#define REGISTER_POST_SERVER_CHECK(fct) \
307 INITCALL1(STG_REGISTER, hap_register_post_server_check, (fct))
308
Willy Tarreau172f5ce2018-11-26 11:21:50 +0100309/* simplified way to declare a post-deinit callback in a file */
310#define REGISTER_POST_DEINIT(fct) \
311 INITCALL1(STG_REGISTER, hap_register_post_deinit, (fct))
312
Christopher Faulet3ea5cbe2019-07-31 08:44:12 +0200313/* simplified way to declare a proxy-deinit callback in a file */
314#define REGISTER_PROXY_DEINIT(fct) \
315 INITCALL1(STG_REGISTER, hap_register_proxy_deinit, (fct))
316
317/* simplified way to declare a proxy-deinit callback in a file */
318#define REGISTER_SERVER_DEINIT(fct) \
319 INITCALL1(STG_REGISTER, hap_register_server_deinit, (fct))
320
Willy Tarreau082b6282019-05-22 14:42:12 +0200321/* simplified way to declare a per-thread allocation callback in a file */
322#define REGISTER_PER_THREAD_ALLOC(fct) \
323 INITCALL1(STG_REGISTER, hap_register_per_thread_alloc, (fct))
324
Willy Tarreau172f5ce2018-11-26 11:21:50 +0100325/* simplified way to declare a per-thread init callback in a file */
326#define REGISTER_PER_THREAD_INIT(fct) \
327 INITCALL1(STG_REGISTER, hap_register_per_thread_init, (fct))
328
329/* simplified way to declare a per-thread deinit callback in a file */
330#define REGISTER_PER_THREAD_DEINIT(fct) \
331 INITCALL1(STG_REGISTER, hap_register_per_thread_deinit, (fct))
332
Willy Tarreau082b6282019-05-22 14:42:12 +0200333/* simplified way to declare a per-thread free callback in a file */
334#define REGISTER_PER_THREAD_FREE(fct) \
335 INITCALL1(STG_REGISTER, hap_register_per_thread_free, (fct))
336
Willy Tarreaubaaee002006-06-26 02:48:02 +0200337#endif /* _TYPES_GLOBAL_H */
338
339/*
340 * Local variables:
341 * c-indent-level: 8
342 * c-basic-offset: 8
343 * End:
344 */