23
23
#define _PROTO_PROXY_H
25
25
#include <common/config.h>
26
#include <common/ticks.h>
26
27
#include <common/time.h>
27
28
#include <types/proxy.h>
29
#include <proto/freq_ctr.h>
29
31
int start_proxies(int verbose);
30
void maintain_proxies(struct timeval *next);
32
void maintain_proxies(int *next);
31
33
void soft_stop(void);
32
34
void pause_proxy(struct proxy *p);
33
35
void stop_proxy(struct proxy *p);
38
40
const char *proxy_mode_str(int mode);
39
41
struct proxy *findproxy(const char *name, int mode, int cap);
40
42
struct server *findserver(const struct proxy *px, const char *name);
41
int proxy_parse_timeout(const char **args, struct proxy *proxy,
42
struct proxy *defpx, char *err, int errlen);
43
int proxy_cfg_ensure_no_http(struct proxy *curproxy, const char *file);
45
46
* This function returns a string containing the type of the proxy in a format
53
54
/* this function initializes all timeouts for proxy p */
54
55
static inline void proxy_reset_timeouts(struct proxy *proxy)
56
tv_eternity(&proxy->timeout.client);
57
tv_eternity(&proxy->timeout.tarpit);
58
tv_eternity(&proxy->timeout.queue);
59
tv_eternity(&proxy->timeout.connect);
60
tv_eternity(&proxy->timeout.server);
61
tv_eternity(&proxy->timeout.appsession);
62
tv_eternity(&proxy->timeout.httpreq);
63
tv_eternity(&proxy->timeout.check);
57
proxy->timeout.client = TICK_ETERNITY;
58
proxy->timeout.tarpit = TICK_ETERNITY;
59
proxy->timeout.queue = TICK_ETERNITY;
60
proxy->timeout.connect = TICK_ETERNITY;
61
proxy->timeout.server = TICK_ETERNITY;
62
proxy->timeout.appsession = TICK_ETERNITY;
63
proxy->timeout.httpreq = TICK_ETERNITY;
64
proxy->timeout.check = TICK_ETERNITY;
67
/* increase the number of cumulated connections on the designated frontend */
68
static void inline proxy_inc_fe_ctr(struct proxy *fe)
71
update_freq_ctr(&fe->fe_sess_per_sec, 1);
72
if (fe->fe_sess_per_sec.curr_ctr > fe->fe_sps_max)
73
fe->fe_sps_max = fe->fe_sess_per_sec.curr_ctr;
76
/* increase the number of cumulated connections on the designated backend */
77
static void inline proxy_inc_be_ctr(struct proxy *be)
80
update_freq_ctr(&be->be_sess_per_sec, 1);
81
if (be->be_sess_per_sec.curr_ctr > be->be_sps_max)
82
be->be_sps_max = be->be_sess_per_sec.curr_ctr;
66
85
#endif /* _PROTO_PROXY_H */