25
25
#include <common/config.h>
27
/* bits for proxy->options */
28
#define PR_O_REDISP 0x00000001 /* allow reconnection to dispatch in case of errors */
29
#define PR_O_TRANSP 0x00000002 /* transparent mode : use original DEST as dispatch */
30
#define PR_O_COOK_RW 0x00000004 /* rewrite all direct cookies with the right serverid */
31
#define PR_O_COOK_IND 0x00000008 /* keep only indirect cookies */
32
#define PR_O_COOK_INS 0x00000010 /* insert cookies when not accessing a server directly */
33
#define PR_O_COOK_PFX 0x00000020 /* rewrite all cookies by prefixing the right serverid */
34
#define PR_O_COOK_ANY (PR_O_COOK_RW | PR_O_COOK_IND | PR_O_COOK_INS | PR_O_COOK_PFX)
35
#define PR_O_BALANCE_RR 0x00000040 /* balance in round-robin mode */
36
#define PR_O_KEEPALIVE 0x00000080 /* follow keep-alive sessions */
37
#define PR_O_FWDFOR 0x00000100 /* insert x-forwarded-for with client address */
38
#define PR_O_BIND_SRC 0x00000200 /* bind to a specific source address when connect()ing */
39
#define PR_O_NULLNOLOG 0x00000400 /* a connect without request will not be logged */
40
#define PR_O_COOK_NOC 0x00000800 /* add a 'Cache-control' header with the cookie */
41
#define PR_O_COOK_POST 0x00001000 /* don't insert cookies for requests other than a POST */
42
#define PR_O_HTTP_CHK 0x00002000 /* use HTTP 'OPTIONS' method to check server health */
43
#define PR_O_PERSIST 0x00004000 /* server persistence stays effective even when server is down */
44
#define PR_O_LOGASAP 0x00008000 /* log as soon as possible, without waiting for the session to complete */
45
#define PR_O_HTTP_CLOSE 0x00010000 /* force 'connection: close' in both directions */
46
#define PR_O_CHK_CACHE 0x00020000 /* require examination of cacheability of the 'set-cookie' field */
47
#define PR_O_TCP_CLI_KA 0x00040000 /* enable TCP keep-alive on client-side sessions */
48
#define PR_O_TCP_SRV_KA 0x00080000 /* enable TCP keep-alive on server-side sessions */
49
#define PR_O_USE_ALL_BK 0x00100000 /* load-balance between backup servers */
50
#define PR_O_FORCE_CLO 0x00200000 /* enforce the connection close immediately after server response */
51
#define PR_O_BALANCE_SH 0x00400000 /* balance on source IP hash */
52
#define PR_O_ABRT_CLOSE 0x00800000 /* immediately abort request when client closes */
53
#define PR_O_SSL3_CHK 0x01000000 /* use SSLv3 CLIENT_HELLO packets for server health */
55
#define PR_O_TPXY_ADDR 0x02000000 /* bind to this non-local address when connect()ing */
56
#define PR_O_TPXY_CIP 0x04000000 /* bind to the client's IP address when connect()ing */
57
#define PR_O_TPXY_CLI 0x06000000 /* bind to the client's IP+port when connect()ing */
58
#define PR_O_TPXY_MASK 0x06000000 /* bind to a non-local address when connect()ing */
59
#define PR_O_TCPSPLICE 0x08000000 /* delegate data transfer to linux kernel's tcp_splice */
60
#define PR_O_BALANCE_UH 0x10000000 /* balance on URI hash */
61
#define PR_O_BALANCE (PR_O_BALANCE_RR | PR_O_BALANCE_SH | PR_O_BALANCE_UH)
62
#define PR_O_SMTP_CHK 0x20000000 /* use SMTP EHLO check for server health - pvandijk@vision6.com.au */
27
/* Parameters for proxy->lbprm.algo.
28
* The low part of the value is unique for each algo so that applying the mask
29
* BE_LB_ALGO returns a unique algorithm.
30
* The high part indicates specific properties.
33
/* Masks to extract algorithm properties */
34
#define BE_LB_ALGO 0x000007FF /* mask to extract all algorithm flags */
35
#define BE_LB_PROP_DYN 0x00000100 /* mask to match dynamic algorithms */
36
#define BE_LB_PROP_L4 0x00000200 /* mask to match layer4-based algorithms */
37
#define BE_LB_PROP_L7 0x00000400 /* mask to match layer7-based algorithms */
39
/* the algorithms themselves */
40
#define BE_LB_ALGO_NONE 0x00000000 /* dispatch or transparent mode */
41
#define BE_LB_ALGO_RR (BE_LB_PROP_DYN | 0x01) /* fast weighted round-robin mode (dynamic) */
42
#define BE_LB_ALGO_SH (BE_LB_PROP_L4 | 0x02) /* balance on source IP hash */
43
#define BE_LB_ALGO_UH (BE_LB_PROP_L7 | 0x03) /* balance on URI hash */
44
#define BE_LB_ALGO_PH (BE_LB_PROP_L7 | 0x04) /* balance on URL parameter hash */
46
/* various constants */
48
/* The scale factor between user weight an effective weight allows smooth
49
* weight modulation even with small weights (eg: 1). It should not be too high
50
* though because it limits the number of servers in FWRR mode in order to
51
* prevent any integer overflow. The max number of servers per backend is
52
* limited to about 2^32/255^2/scale ~= 66051/scale. A scale of 16 looks like
53
* a good value, as it allows more than 4000 servers per backend while leaving
54
* modulation steps of about 6% for servers with the lowest weight (1).
56
#define BE_WEIGHT_SCALE 16
65
58
#endif /* _TYPES_BACKEND_H */