REORG: include: move server.h to haproxy/server{,-t}.h

extern struct dict server_name_dict was moved from the type file to the
main file. A handful of inlined functions were moved at the bottom of
the file. Call places were updated to use server-t.h when relevant, or
to simply drop the entry when not needed.
diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c
index c3f9f95..52cac08 100644
--- a/contrib/prometheus-exporter/service-prometheus.c
+++ b/contrib/prometheus-exporter/service-prometheus.c
@@ -31,7 +31,7 @@
 #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>
diff --git a/include/haproxy/acl-t.h b/include/haproxy/acl-t.h
index d2b0e31..8418ca9 100644
--- a/include/haproxy/acl-t.h
+++ b/include/haproxy/acl-t.h
@@ -27,10 +27,9 @@
 #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.
  *
diff --git a/include/haproxy/backend-t.h b/include/haproxy/backend-t.h
index 757bb2f..af05cc8 100644
--- a/include/haproxy/backend-t.h
+++ b/include/haproxy/backend-t.h
@@ -27,9 +27,9 @@
 #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 */
 
diff --git a/include/haproxy/backend.h b/include/haproxy/backend.h
index 6662d59..5f6acaa 100644
--- a/include/haproxy/backend.h
+++ b/include/haproxy/backend.h
@@ -25,8 +25,8 @@
 #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);
diff --git a/include/haproxy/check.h b/include/haproxy/check.h
index f38ba2a..66023ce 100644
--- a/include/haproxy/check.h
+++ b/include/haproxy/check.h
@@ -27,7 +27,7 @@
 #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);
diff --git a/include/haproxy/hlua-t.h b/include/haproxy/hlua-t.h
index 35a7a81..75a4753 100644
--- a/include/haproxy/hlua-t.h
+++ b/include/haproxy/hlua-t.h
@@ -32,9 +32,9 @@
 #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"
diff --git a/include/haproxy/lb_fas.h b/include/haproxy/lb_fas.h
index fa2a507..b12831c 100644
--- a/include/haproxy/lb_fas.h
+++ b/include/haproxy/lb_fas.h
@@ -25,7 +25,7 @@
 #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);
diff --git a/include/haproxy/lb_fwlc.h b/include/haproxy/lb_fwlc.h
index 24c7d74..a598af9 100644
--- a/include/haproxy/lb_fwlc.h
+++ b/include/haproxy/lb_fwlc.h
@@ -25,7 +25,7 @@
 #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);
diff --git a/include/haproxy/lb_fwrr.h b/include/haproxy/lb_fwrr.h
index 0accf06..27b0a94 100644
--- a/include/haproxy/lb_fwrr.h
+++ b/include/haproxy/lb_fwrr.h
@@ -25,7 +25,7 @@
 #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);
diff --git a/include/haproxy/lb_map-t.h b/include/haproxy/lb_map-t.h
index b2c556c..0c45c25 100644
--- a/include/haproxy/lb_map-t.h
+++ b/include/haproxy/lb_map-t.h
@@ -22,8 +22,8 @@
 #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 */
diff --git a/include/haproxy/lb_map.h b/include/haproxy/lb_map.h
index 1e390f7..ca483b2 100644
--- a/include/haproxy/lb_map.h
+++ b/include/haproxy/lb_map.h
@@ -24,7 +24,7 @@
 
 #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);
diff --git a/include/haproxy/obj_type.h b/include/haproxy/obj_type.h
index 0f932dd..d42b250 100644
--- a/include/haproxy/obj_type.h
+++ b/include/haproxy/obj_type.h
@@ -30,7 +30,7 @@
 #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>
 
diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h
index b89fb21..f7b0997 100644
--- a/include/haproxy/proxy-t.h
+++ b/include/haproxy/proxy-t.h
@@ -37,9 +37,9 @@
 #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 {
diff --git a/include/haproxy/proxy.h b/include/haproxy/proxy.h
index 0cfea6a..2263c26 100644
--- a/include/haproxy/proxy.h
+++ b/include/haproxy/proxy.h
@@ -27,9 +27,9 @@
 #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 */
diff --git a/include/haproxy/queue.h b/include/haproxy/queue.h
index bded676..ef61c0d 100644
--- a/include/haproxy/queue.h
+++ b/include/haproxy/queue.h
@@ -27,7 +27,7 @@
 #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;
diff --git a/include/types/server.h b/include/haproxy/server-t.h
similarity index 97%
rename from include/types/server.h
rename to include/haproxy/server-t.h
index dcf5c40..564619d 100644
--- a/include/types/server.h
+++ b/include/haproxy/server-t.h
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -19,28 +19,28 @@
  * 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. */
@@ -168,13 +168,11 @@
 #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 {
@@ -182,9 +180,6 @@
         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;
@@ -394,7 +389,7 @@
 	struct srv_kw kw[VAR_ARRAY];
 };
 
-#endif /* _TYPES_SERVER_H */
+#endif /* _HAPROXY_SERVER_T_H */
 
 /*
  * Local variables:
diff --git a/include/proto/server.h b/include/haproxy/server.h
similarity index 97%
rename from include/proto/server.h
rename to include/haproxy/server.h
index 066faeb..3d47cb0 100644
--- a/include/proto/server.h
+++ b/include/haproxy/server.h
@@ -1,5 +1,5 @@
 /*
- * include/proto/server.h
+ * include/haproxy/server.h
  * This file defines everything related to servers.
  *
  * Copyright (C) 2000-2009 Willy Tarreau - w@1wt.eu
@@ -19,27 +19,29 @@
  * 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 eb_root idle_conn_srv;
 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);
@@ -66,20 +68,6 @@
 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.
@@ -98,20 +86,6 @@
  */
 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.
@@ -134,15 +108,6 @@
 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.
@@ -185,6 +150,43 @@
  */
 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.
  */
@@ -294,7 +296,7 @@
 	return 0;
 }
 
-#endif /* _PROTO_SERVER_H */
+#endif /* _HAPROXY_SERVER_H */
 
 /*
  * Local variables:
diff --git a/include/haproxy/session.h b/include/haproxy/session.h
index 6b5bfff..c687c39 100644
--- a/include/haproxy/session.h
+++ b/include/haproxy/session.h
@@ -26,9 +26,9 @@
 #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;
diff --git a/include/types/stream.h b/include/types/stream.h
index 550a7ea..8e71049 100644
--- a/include/types/stream.h
+++ b/include/types/stream.h
@@ -38,11 +38,11 @@
 #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>
 
diff --git a/src/backend.c b/src/backend.c
index 26e36ae..e4b677a 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -40,6 +40,7 @@
 #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>
@@ -54,7 +55,6 @@
 #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
diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c
index 425b57c..cdb6840 100644
--- a/src/cfgparse-listen.c
+++ b/src/cfgparse-listen.c
@@ -25,10 +25,10 @@
 #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.
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 631f100..49ef69d 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -68,6 +68,7 @@
 #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>
 
@@ -76,7 +77,6 @@
 #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>
diff --git a/src/check.c b/src/check.c
index 1adbf56..308a86e 100644
--- a/src/check.c
+++ b/src/check.c
@@ -49,6 +49,7 @@
 #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>
@@ -63,7 +64,6 @@
 #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>
 
diff --git a/src/cli.c b/src/cli.c
index 321a974..07d3631 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -42,6 +42,7 @@
 #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>
@@ -61,7 +62,6 @@
 #include <haproxy/pipe.h>
 #include <haproxy/protocol.h>
 #include <proto/stream.h>
-#include <proto/server.h>
 
 #define PAYLOAD_PATTERN "<<"
 
diff --git a/src/dns.c b/src/dns.c
index dd29d27..8eddde9 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -31,6 +31,7 @@
 #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>
@@ -43,7 +44,6 @@
 #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);
diff --git a/src/fcgi-app.c b/src/fcgi-app.c
index 5d7aeff..434fc02 100644
--- a/src/fcgi-app.c
+++ b/src/fcgi-app.c
@@ -23,13 +23,12 @@
 #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;
 
diff --git a/src/haproxy.c b/src/haproxy.c
index a9e264f..f1478b2 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -107,6 +107,7 @@
 #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>
@@ -125,7 +126,6 @@
 #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 */
diff --git a/src/hlua.c b/src/hlua.c
index 1ab6f5a..57e015c 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -45,6 +45,7 @@
 #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>
@@ -54,7 +55,6 @@
 #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
diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
index 34577b5..cfcbcea 100644
--- a/src/hlua_fcn.c
+++ b/src/hlua_fcn.c
@@ -26,10 +26,10 @@
 #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. */
diff --git a/src/http_ana.c b/src/http_ana.c
index c6b292e..c0b3dd4 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -27,6 +27,7 @@
 #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>
@@ -34,7 +35,6 @@
 
 #include <haproxy/capture-t.h>
 
-#include <proto/server.h>
 #include <proto/stream.h>
 
 #define TRACE_SOURCE &trace_strm
diff --git a/src/lb_chash.c b/src/lb_chash.c
index aaaef89..1fb44f4 100644
--- a/src/lb_chash.c
+++ b/src/lb_chash.c
@@ -16,13 +16,12 @@
  *
  */
 
+#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
diff --git a/src/lb_fas.c b/src/lb_fas.c
index fc9ae51..be2ce47 100644
--- a/src/lb_fas.c
+++ b/src/lb_fas.c
@@ -16,12 +16,11 @@
  *
  */
 
+#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
diff --git a/src/lb_fwlc.c b/src/lb_fwlc.c
index d7c6953..a835f01 100644
--- a/src/lb_fwlc.c
+++ b/src/lb_fwlc.c
@@ -10,12 +10,11 @@
  *
  */
 
+#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
diff --git a/src/lb_fwrr.c b/src/lb_fwrr.c
index 145d097..6183433 100644
--- a/src/lb_fwrr.c
+++ b/src/lb_fwrr.c
@@ -10,12 +10,12 @@
  *
  */
 
+#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);
diff --git a/src/lb_map.c b/src/lb_map.c
index c963180..61debf8 100644
--- a/src/lb_map.c
+++ b/src/lb_map.c
@@ -10,13 +10,12 @@
  *
  */
 
+#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.
  *
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index c2a1869..4ca4100 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -42,6 +42,7 @@
 #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>
 
@@ -52,7 +53,6 @@
 #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);
diff --git a/src/proxy.c b/src/proxy.c
index 173f17d..12cbd46 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -31,6 +31,7 @@
 #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>
@@ -43,7 +44,6 @@
 
 #include <haproxy/fd.h>
 #include <haproxy/proto_tcp.h>
-#include <proto/server.h>
 #include <haproxy/signal.h>
 #include <proto/stream.h>
 
diff --git a/src/queue.c b/src/queue.c
index ea0b64a..c2853a9 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -75,6 +75,7 @@
 #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>
@@ -82,7 +83,6 @@
 #include <haproxy/thread.h>
 #include <import/eb32tree.h>
 
-#include <proto/server.h>
 #include <proto/stream.h>
 
 
diff --git a/src/server.c b/src/server.c
index 4751065..63aa6ea 100644
--- a/src/server.c
+++ b/src/server.c
@@ -30,6 +30,7 @@
 #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>
@@ -37,7 +38,6 @@
 
 #include <haproxy/port_range.h>
 #include <haproxy/protocol.h>
-#include <proto/server.h>
 #include <proto/stream.h>
 #include <netinet/tcp.h>
 
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 3a0918f..4cbe2dc 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -57,6 +57,7 @@
 #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>
@@ -78,7 +79,6 @@
 #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! *****
diff --git a/src/stats.c b/src/stats.c
index 4f6f6c0..21d8dad 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -46,6 +46,7 @@
 #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>
@@ -62,7 +63,6 @@
 #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] = {
diff --git a/src/stream.c b/src/stream.c
index 45c1bc8..52fcf9b 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -43,6 +43,7 @@
 #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>
@@ -56,7 +57,6 @@
 #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));