1 /*
2  * include/haproxy/mworker-t.h
3  * Master Worker type definitions.
4  *
5  * Copyright HAProxy Technologies 2019 - William Lallemand <wlallemand@haproxy.com>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version
10  * 2 of the License, or (at your option) any later version.
11  *
12  */
13 
14 #ifndef _HAPROXY_MWORKER_T_H_
15 #define _HAPROXY_MWORKER_T_H_
16 
17 #include <haproxy/list.h>
18 #include <haproxy/signal-t.h>
19 
20 /* options for mworker_proc */
21 
22 #define PROC_O_TYPE_MASTER           0x00000001
23 #define PROC_O_TYPE_WORKER           0x00000002
24 #define PROC_O_TYPE_PROG             0x00000004
25 /* 0x00000008 unused */
26 #define PROC_O_LEAVING               0x00000010  /* this process should be leaving */
27 /* 0x00000020 to 0x00000080 unused */
28 #define PROC_O_START_RELOAD          0x00000100  /* Start the process even if the master was re-executed */
29 
30 /*
31  * Structure used to describe the processes in master worker mode
32  */
33 struct server;
34 struct mworker_proc {
35 	int pid;
36 	int options;
37 	char *id;
38 	char **command;
39 	char *path;
40 	char *version;
41 	int ipc_fd[2]; /* 0 is master side, 1 is worker side */
42 	int relative_pid;
43 	int reloads;
44 	int timestamp;
45 	struct server *srv; /* the server entry in the master proxy */
46 	struct list list;
47 	int uid;
48 	int gid;
49 };
50 
51 #endif /* _HAPROXY_MWORKER_T_H_ */
52