#include <haproxy/pipe.h>
#include <haproxy/proxy.h>
#include <haproxy/sample.h>
-#include <proto/server.h>
+#include <haproxy/server.h>
#include <haproxy/ssl_sock.h>
#include <haproxy/stats.h>
#include <proto/stream.h>
#include <haproxy/arg-t.h>
#include <haproxy/list-t.h>
#include <haproxy/pattern-t.h>
+#include <haproxy/server-t.h>
#include <haproxy/api-t.h>
-#include <types/server.h>
-
/* ACL test result.
*
#include <haproxy/lb_fwlc-t.h>
#include <haproxy/lb_fwrr-t.h>
#include <haproxy/lb_map-t.h>
+#include <haproxy/server-t.h>
#include <haproxy/thread-t.h>
#include <haproxy/api-t.h>
-#include <types/server.h>
/* Parameters for lbprm.algo */
#include <haproxy/backend-t.h>
#include <haproxy/api.h>
#include <haproxy/proxy-t.h>
+#include <haproxy/server-t.h>
#include <haproxy/time.h>
-#include <types/server.h>
#include <types/stream.h>
int assign_server(struct stream *s);
#include <haproxy/list-t.h>
#include <haproxy/mailers.h>
#include <haproxy/proxy-t.h>
-#include <types/server.h>
+#include <haproxy/server-t.h>
const char *get_check_status_description(short check_status);
const char *get_check_status_info(short check_status);
#include <haproxy/list-t.h>
#include <haproxy/proxy-t.h>
#include <haproxy/regex-t.h>
+#include <haproxy/server-t.h>
#include <haproxy/xref-t.h>
-#include <types/server.h>
#include <haproxy/stick_table-t.h>
#define CLASS_CORE "Core"
#include <haproxy/api.h>
#include <haproxy/lb_fas-t.h>
#include <haproxy/proxy-t.h>
-#include <types/server.h>
+#include <haproxy/server-t.h>
struct server *fas_get_next_server(struct proxy *p, struct server *srvtoavoid);
void fas_init_server_tree(struct proxy *p);
#include <haproxy/api.h>
#include <haproxy/lb_fwlc-t.h>
#include <haproxy/proxy-t.h>
-#include <types/server.h>
+#include <haproxy/server-t.h>
struct server *fwlc_get_next_server(struct proxy *p, struct server *srvtoavoid);
void fwlc_init_server_tree(struct proxy *p);
#include <haproxy/api.h>
#include <haproxy/lb_fwrr-t.h>
#include <haproxy/proxy-t.h>
-#include <types/server.h>
+#include <haproxy/server-t.h>
void fwrr_init_server_groups(struct proxy *p);
struct server *fwrr_get_next_server(struct proxy *p, struct server *srvtoavoid);
#ifndef _HAPROXY_LB_MAP_T_H
#define _HAPROXY_LB_MAP_T_H
+#include <haproxy/server-t.h>
#include <haproxy/api-t.h>
-#include <types/server.h>
struct lb_map {
struct server **srv; /* the server map used to apply weights */
#include <haproxy/api.h>
#include <haproxy/proxy-t.h>
-#include <types/server.h>
+#include <haproxy/server-t.h>
void recalc_server_map(struct proxy *px);
void init_server_map(struct proxy *p);
#include <haproxy/obj_type-t.h>
#include <haproxy/pool.h>
#include <haproxy/proxy-t.h>
-#include <types/server.h>
+#include <haproxy/server-t.h>
#include <types/stream.h>
#include <haproxy/stream_interface-t.h>
#include <haproxy/freq_ctr-t.h>
#include <haproxy/list-t.h>
#include <haproxy/obj_type-t.h>
+#include <haproxy/server-t.h>
#include <haproxy/thread-t.h>
#include <haproxy/api-t.h>
-#include <types/server.h>
/* values for proxy->state */
enum pr_state {
#include <haproxy/freq_ctr.h>
#include <haproxy/listener-t.h>
#include <haproxy/proxy-t.h>
+#include <haproxy/server-t.h>
#include <haproxy/ticks.h>
#include <haproxy/time.h>
-#include <types/server.h>
extern struct proxy *proxies_list;
extern struct eb_root used_proxy_id; /* list of proxy IDs in use */
#include <haproxy/pool.h>
#include <haproxy/proxy-t.h>
#include <haproxy/queue-t.h>
-#include <types/server.h>
+#include <haproxy/server-t.h>
#include <types/stream.h>
extern struct pool_head *pool_head_pendconn;
/*
- * include/types/server.h
+ * include/haproxy/server-t.h
* This file defines everything related to servers.
*
* Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _TYPES_SERVER_H
-#define _TYPES_SERVER_H
+#ifndef _HAPROXY_SERVER_T_H
+#define _HAPROXY_SERVER_T_H
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <import/eb32tree.h>
+#include <import/ebmbtree.h>
+
#include <haproxy/check-t.h>
+#include <haproxy/connection-t.h>
#include <haproxy/counters-t.h>
#include <haproxy/dns-t.h>
-#include <haproxy/api-t.h>
+#include <haproxy/freq_ctr-t.h>
#include <haproxy/list-t.h>
#include <haproxy/listener-t.h>
#include <haproxy/obj_type-t.h>
-#include <haproxy/ssl_sock-t.h>
-#include <haproxy/thread.h>
#include <haproxy/openssl-compat.h>
-
-#include <import/eb32tree.h>
-
-#include <haproxy/connection-t.h>
-#include <haproxy/freq_ctr-t.h>
+#include <haproxy/ssl_sock-t.h>
#include <haproxy/task-t.h>
+#include <haproxy/thread-t.h>
+#include <haproxy/api-t.h>
/* server states. Only SRV_ST_STOPPED indicates a down server. */
#define SRV_EWGHT_RANGE (SRV_UWGHT_RANGE * BE_WEIGHT_SCALE)
#define SRV_EWGHT_MAX (SRV_UWGHT_MAX * BE_WEIGHT_SCALE)
-#ifdef USE_OPENSSL
/* server ssl options */
-#define SRV_SSL_O_NONE 0x0000
+#define SRV_SSL_O_NONE 0x0000
#define SRV_SSL_O_NO_TLS_TICKETS 0x0100 /* disable session resumption tickets */
-#define SRV_SSL_O_NO_REUSE 0x200 /* disable session reuse */
-#define SRV_SSL_O_EARLY_DATA 0x400 /* Allow using early data */
-#endif
+#define SRV_SSL_O_NO_REUSE 0x200 /* disable session reuse */
+#define SRV_SSL_O_EARLY_DATA 0x400 /* Allow using early data */
/* log servers ring's protocols options */
enum srv_log_proto {
SRV_LOG_PROTO_OCTET_COUNTING, // TCP frames: MSGLEN SP MSG
};
-/* The server names dictionary */
-extern struct dict server_name_dict;
-
struct pid_list {
struct list list;
pid_t pid;
struct srv_kw kw[VAR_ARRAY];
};
-#endif /* _TYPES_SERVER_H */
+#endif /* _HAPROXY_SERVER_T_H */
/*
* Local variables:
/*
- * include/proto/server.h
+ * include/haproxy/server.h
* This file defines everything related to servers.
*
* Copyright (C) 2000-2009 Willy Tarreau - w@1wt.eu
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _PROTO_SERVER_H
-#define _PROTO_SERVER_H
+#ifndef _HAPROXY_SERVER_H
+#define _HAPROXY_SERVER_H
#include <unistd.h>
+
#include <haproxy/applet-t.h>
#include <haproxy/api.h>
#include <haproxy/dns-t.h>
+#include <haproxy/freq_ctr.h>
#include <haproxy/proxy-t.h>
+#include <haproxy/server-t.h>
#include <haproxy/task.h>
+#include <haproxy/thread-t.h>
#include <haproxy/time.h>
-#include <types/server.h>
-
-#include <haproxy/freq_ctr.h>
__decl_thread(extern HA_SPINLOCK_T idle_conn_srv_lock);
extern struct task *idle_conn_task;
extern struct task *idle_conn_cleanup[MAX_THREADS];
extern struct mt_list toremove_connections[MAX_THREADS];
+extern struct dict server_name_dict;
int srv_downtime(const struct server *s);
int srv_lastsession(const struct server *s);
struct task *srv_cleanup_idle_connections(struct task *task, void *ctx, unsigned short state);
struct task *srv_cleanup_toremove_connections(struct task *task, void *context, unsigned short state);
-/* increase the number of cumulated connections on the designated server */
-static inline void srv_inc_sess_ctr(struct server *s)
-{
- _HA_ATOMIC_ADD(&s->counters.cum_sess, 1);
- HA_ATOMIC_UPDATE_MAX(&s->counters.sps_max,
- update_freq_ctr(&s->sess_per_sec, 1));
-}
-
-/* set the time of last session on the designated server */
-static inline void srv_set_sess_last(struct server *s)
-{
- s->counters.last_sess = now.tv_sec;
-}
-
/*
* Registers the server keyword list <kwl> as a list of valid keywords for next
* parsing sessions.
*/
void server_recalc_eweight(struct server *sv, int must_update);
-/* returns the current server throttle rate between 0 and 100% */
-static inline unsigned int server_throttle_rate(struct server *sv)
-{
- struct proxy *px = sv->proxy;
-
- /* when uweight is 0, we're in soft-stop so that cannot be a slowstart,
- * thus the throttle is 100%.
- */
- if (!sv->uweight)
- return 100;
-
- return (100U * px->lbprm.wmult * sv->cur_eweight + px->lbprm.wdiv - 1) / (px->lbprm.wdiv * sv->uweight);
-}
-
/*
* Parses weight_str and configures sv accordingly.
* Returns NULL on success, error message string otherwise.
const char *server_parse_maxconn_change_request(struct server *sv,
const char *maxconn_str);
-/*
- * Return true if the server has a zero user-weight, meaning it's in draining
- * mode (ie: not taking new non-persistent connections).
- */
-static inline int server_is_draining(const struct server *s)
-{
- return !s->uweight || (s->cur_admin & SRV_ADMF_DRAIN);
-}
-
/* Shutdown all connections of a server. The caller must pass a termination
* code in <why>, which must be one of SF_ERR_* indicating the reason for the
* shutdown.
*/
void srv_set_dyncookie(struct server *s);
+/* increase the number of cumulated connections on the designated server */
+static inline void srv_inc_sess_ctr(struct server *s)
+{
+ _HA_ATOMIC_ADD(&s->counters.cum_sess, 1);
+ HA_ATOMIC_UPDATE_MAX(&s->counters.sps_max,
+ update_freq_ctr(&s->sess_per_sec, 1));
+}
+
+/* set the time of last session on the designated server */
+static inline void srv_set_sess_last(struct server *s)
+{
+ s->counters.last_sess = now.tv_sec;
+}
+
+/* returns the current server throttle rate between 0 and 100% */
+static inline unsigned int server_throttle_rate(struct server *sv)
+{
+ struct proxy *px = sv->proxy;
+
+ /* when uweight is 0, we're in soft-stop so that cannot be a slowstart,
+ * thus the throttle is 100%.
+ */
+ if (!sv->uweight)
+ return 100;
+
+ return (100U * px->lbprm.wmult * sv->cur_eweight + px->lbprm.wdiv - 1) / (px->lbprm.wdiv * sv->uweight);
+}
+
+/*
+ * Return true if the server has a zero user-weight, meaning it's in draining
+ * mode (ie: not taking new non-persistent connections).
+ */
+static inline int server_is_draining(const struct server *s)
+{
+ return !s->uweight || (s->cur_admin & SRV_ADMF_DRAIN);
+}
+
/* Puts server <s> into maintenance mode, and propagate that status down to all
* tracking servers.
*/
return 0;
}
-#endif /* _PROTO_SERVER_H */
+#endif /* _HAPROXY_SERVER_H */
/*
* Local variables:
#include <haproxy/global-t.h>
#include <haproxy/obj_type-t.h>
#include <haproxy/pool.h>
+#include <haproxy/server.h>
#include <haproxy/session-t.h>
#include <haproxy/stick_table.h>
-#include <proto/server.h>
extern struct pool_head *pool_head_session;
extern struct pool_head *pool_head_sess_srv_list;
#include <haproxy/obj_type-t.h>
#include <haproxy/proxy-t.h>
#include <haproxy/queue-t.h>
+#include <haproxy/server-t.h>
#include <haproxy/session-t.h>
#include <haproxy/stream_interface-t.h>
#include <haproxy/vars-t.h>
-#include <types/server.h>
#include <haproxy/task-t.h>
#include <haproxy/stick_table-t.h>
#include <haproxy/payload.h>
#include <haproxy/proxy.h>
#include <haproxy/queue.h>
+#include <haproxy/server.h>
#include <haproxy/session.h>
#include <haproxy/ssl_sock.h>
#include <haproxy/stream_interface.h>
#include <haproxy/protocol.h>
#include <haproxy/proto_tcp.h>
#include <haproxy/sample.h>
-#include <proto/server.h>
#include <proto/stream.h>
#define TRACE_SOURCE &trace_strm
#include <haproxy/peers.h>
#include <haproxy/proxy.h>
#include <haproxy/sample.h>
+#include <haproxy/server.h>
#include <haproxy/stats-t.h>
#include <haproxy/protocol.h>
-#include <proto/server.h>
#include <haproxy/stick_table.h>
/* Report a warning if a rule is placed after a 'tcp-request session' rule.
#include <haproxy/time.h>
#include <haproxy/uri_auth-t.h>
#include <haproxy/namespace.h>
+#include <haproxy/server.h>
#include <haproxy/task.h>
#include <haproxy/thread.h>
#include <haproxy/protocol.h>
#include <haproxy/peers.h>
#include <haproxy/sample.h>
-#include <proto/server.h>
#include <proto/stream.h>
#include <haproxy/stick_table.h>
#include <haproxy/tcp_rules.h>
#include <haproxy/htx.h>
#include <haproxy/log.h>
#include <haproxy/proxy.h>
+#include <haproxy/server.h>
#include <haproxy/signal.h>
#include <haproxy/ssl_sock.h>
#include <haproxy/stats-t.h>
#include <haproxy/port_range.h>
#include <haproxy/proto_tcp.h>
#include <haproxy/protocol.h>
-#include <proto/server.h>
#include <haproxy/proto_udp.h>
#include <haproxy/sample.h>
#include <haproxy/peers.h>
#include <haproxy/proxy.h>
#include <haproxy/sample-t.h>
+#include <haproxy/server.h>
#include <haproxy/session.h>
#include <haproxy/stats-t.h>
#include <haproxy/stream_interface.h>
#include <haproxy/pipe.h>
#include <haproxy/protocol.h>
#include <proto/stream.h>
-#include <proto/server.h>
#define PAYLOAD_PATTERN "<<"
#include <haproxy/log.h>
#include <haproxy/proxy.h>
#include <haproxy/sample.h>
+#include <haproxy/server.h>
#include <haproxy/stats-t.h>
#include <haproxy/stream_interface.h>
#include <haproxy/task.h>
#include <haproxy/global.h>
#include <haproxy/fd.h>
-#include <proto/server.h>
#include <haproxy/proto_udp.h>
struct list dns_resolvers = LIST_HEAD_INIT(dns_resolvers);
#include <haproxy/proxy-t.h>
#include <haproxy/regex.h>
#include <haproxy/sample.h>
+#include <haproxy/server-t.h>
#include <haproxy/session.h>
#include <haproxy/tools.h>
#include <haproxy/global.h>
-#include <proto/server.h>
-
/* Global list of all FCGI applications */
static struct fcgi_app *fcgi_apps = NULL;
#include <haproxy/proxy.h>
#include <haproxy/sample.h>
#include <haproxy/regex.h>
+#include <haproxy/server.h>
#include <haproxy/session.h>
#include <haproxy/signal.h>
#include <haproxy/ssl_sock.h>
#include <haproxy/arg.h>
#include <haproxy/fd.h>
#include <haproxy/protocol.h>
-#include <proto/server.h>
#include <proto/stream.h>
/* array of init calls for older platforms */
#include <haproxy/payload.h>
#include <haproxy/proxy-t.h>
#include <haproxy/sample.h>
+#include <haproxy/server-t.h>
#include <haproxy/session.h>
#include <haproxy/stats-t.h>
#include <haproxy/stream_interface.h>
#include <haproxy/vars.h>
#include <haproxy/arg.h>
-#include <proto/server.h>
#include <proto/stream.h>
/* Lua uses longjmp to perform yield or throwing errors. This
#include <haproxy/pattern-t.h>
#include <haproxy/proxy.h>
#include <haproxy/regex.h>
+#include <haproxy/server.h>
#include <haproxy/stats.h>
#include <haproxy/time.h>
-#include <proto/server.h>
#include <haproxy/stick_table.h>
/* Contains the class reference of the concat object. */
#include <haproxy/net_helper.h>
#include <haproxy/proxy.h>
#include <haproxy/regex.h>
+#include <haproxy/server-t.h>
#include <haproxy/stats.h>
#include <haproxy/stream_interface.h>
#include <haproxy/uri_auth-t.h>
#include <haproxy/capture-t.h>
-#include <proto/server.h>
#include <proto/stream.h>
#define TRACE_SOURCE &trace_strm
*
*/
+#include <import/eb32tree.h>
#include <haproxy/backend.h>
#include <haproxy/api.h>
#include <haproxy/queue.h>
+#include <haproxy/server-t.h>
#include <haproxy/tools.h>
-#include <import/eb32tree.h>
-
-#include <types/server.h>
/* Return next tree node after <node> which must still be in the tree, or be
* NULL. Lookup wraps around the end to the beginning. If the next node is the
*
*/
+#include <import/eb32tree.h>
#include <haproxy/backend.h>
#include <haproxy/api.h>
#include <haproxy/queue.h>
-#include <import/eb32tree.h>
-
-#include <types/server.h>
+#include <haproxy/server-t.h>
/* Remove a server from a tree. It must have previously been dequeued. This
*
*/
+#include <import/eb32tree.h>
#include <haproxy/backend.h>
#include <haproxy/api.h>
#include <haproxy/queue.h>
-#include <import/eb32tree.h>
-
-#include <types/server.h>
+#include <haproxy/server-t.h>
/* Remove a server from a tree. It must have previously been dequeued. This
*
*/
+#include <import/eb32tree.h>
#include <haproxy/backend.h>
#include <haproxy/api.h>
#include <haproxy/queue.h>
-#include <import/eb32tree.h>
+#include <haproxy/server-t.h>
-#include <types/server.h>
static inline void fwrr_remove_from_tree(struct server *s);
static inline void fwrr_queue_by_weight(struct eb_root *root, struct server *s);
*
*/
+#include <import/eb32tree.h>
#include <haproxy/backend.h>
#include <haproxy/api.h>
#include <haproxy/lb_map.h>
#include <haproxy/queue.h>
-#include <import/eb32tree.h>
-
-#include <types/server.h>
+#include <haproxy/server-t.h>
/* this function updates the map according to server <srv>'s new state.
*
#include <haproxy/log.h>
#include <haproxy/proxy-t.h>
#include <haproxy/sample.h>
+#include <haproxy/server.h>
#include <haproxy/tools.h>
#include <haproxy/namespace.h>
#include <haproxy/port_range.h>
#include <haproxy/protocol.h>
#include <haproxy/proto_tcp.h>
-#include <proto/server.h>
#include <haproxy/tcp_rules.h>
static int tcp_bind_listeners(struct protocol *proto, char *errmsg, int errlen);
#include <haproxy/peers.h>
#include <haproxy/pool.h>
#include <haproxy/proxy.h>
+#include <haproxy/server-t.h>
#include <haproxy/stats-t.h>
#include <haproxy/stream_interface.h>
#include <haproxy/task.h>
#include <haproxy/fd.h>
#include <haproxy/proto_tcp.h>
-#include <proto/server.h>
#include <haproxy/signal.h>
#include <proto/stream.h>
#include <haproxy/pool.h>
#include <haproxy/queue.h>
#include <haproxy/sample.h>
+#include <haproxy/server-t.h>
#include <haproxy/stream_interface.h>
#include <haproxy/task.h>
#include <haproxy/tcp_rules.h>
#include <haproxy/thread.h>
#include <import/eb32tree.h>
-#include <proto/server.h>
#include <proto/stream.h>
#include <haproxy/namespace.h>
#include <haproxy/queue.h>
#include <haproxy/sample.h>
+#include <haproxy/server.h>
#include <haproxy/stats-t.h>
#include <haproxy/stream_interface.h>
#include <haproxy/task.h>
#include <haproxy/port_range.h>
#include <haproxy/protocol.h>
-#include <proto/server.h>
#include <proto/stream.h>
#include <netinet/tcp.h>
#include <haproxy/openssl-compat.h>
#include <haproxy/pattern-t.h>
#include <haproxy/proxy.h>
+#include <haproxy/server.h>
#include <haproxy/shctx.h>
#include <haproxy/ssl_ckch.h>
#include <haproxy/ssl_crtlist.h>
#include <haproxy/fd.h>
#include <haproxy/freq_ctr.h>
#include <haproxy/proto_tcp.h>
-#include <proto/server.h>
#include <proto/stream.h>
/* ***** READ THIS before adding code here! *****
#include <haproxy/map-t.h>
#include <haproxy/pattern-t.h>
#include <haproxy/proxy.h>
+#include <haproxy/server.h>
#include <haproxy/session.h>
#include <haproxy/ssl_sock.h>
#include <haproxy/stats.h>
#include <haproxy/freq_ctr.h>
#include <haproxy/pipe.h>
#include <proto/stream.h>
-#include <proto/server.h>
/* status codes available for the stats admin page (strictly 4 chars length) */
const char *stat_status_codes[STAT_STATUS_SIZE] = {
#include <haproxy/pool.h>
#include <haproxy/proxy.h>
#include <haproxy/queue.h>
+#include <haproxy/server.h>
#include <haproxy/session.h>
#include <haproxy/stats-t.h>
#include <haproxy/stream_interface.h>
#include <haproxy/freq_ctr.h>
#include <proto/stream.h>
#include <haproxy/pipe.h>
-#include <proto/server.h>
#include <haproxy/stick_table.h>
DECLARE_POOL(pool_head_stream, "stream", sizeof(struct stream));