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

This one is particularly difficult to split because it provides all the
functions used to manipulate a proxy state and to retrieve names or IDs
for error reporting, and as such, it was included in 73 files (down to
68 after cleanup). It would deserve a small cleanup though the cut points
are not obvious at the moment given the number of structs involved in
the struct proxy itself.
diff --git a/include/common/cfgparse.h b/include/common/cfgparse.h
index 9dd6363..86bceb6 100644
--- a/include/common/cfgparse.h
+++ b/include/common/cfgparse.h
@@ -25,7 +25,7 @@
 #include <haproxy/api.h>
 #include <haproxy/list-t.h>
 #include <haproxy/log.h>
-#include <proto/proxy.h>
+#include <haproxy/proxy.h>
 
 /* configuration sections */
 #define CFG_NONE	0
diff --git a/include/haproxy/acl-t.h b/include/haproxy/acl-t.h
index 3e3762c..d2b0e31 100644
--- a/include/haproxy/acl-t.h
+++ b/include/haproxy/acl-t.h
@@ -24,11 +24,11 @@
 
 #include <import/ebmbtree.h>
 
+#include <haproxy/arg-t.h>
 #include <haproxy/list-t.h>
 #include <haproxy/pattern-t.h>
 #include <haproxy/api-t.h>
 
-#include <types/proxy.h>
 #include <types/server.h>
 
 
diff --git a/include/haproxy/applet-t.h b/include/haproxy/applet-t.h
index 4323905..7ce112a 100644
--- a/include/haproxy/applet-t.h
+++ b/include/haproxy/applet-t.h
@@ -27,10 +27,10 @@
 #include <haproxy/freq_ctr-t.h>
 #include <haproxy/hlua-t.h>
 #include <haproxy/obj_type-t.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/api-t.h>
 #include <haproxy/xref-t.h>
 
-#include <types/proxy.h>
 #include <types/stream.h>
 
 /* flags for appctx->state */
diff --git a/include/haproxy/check.h b/include/haproxy/check.h
index 85fc49b..f38ba2a 100644
--- a/include/haproxy/check.h
+++ b/include/haproxy/check.h
@@ -26,7 +26,7 @@
 #include <haproxy/check-t.h>
 #include <haproxy/list-t.h>
 #include <haproxy/mailers.h>
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 #include <types/server.h>
 
 const char *get_check_status_description(short check_status);
diff --git a/include/haproxy/fcgi-app.h b/include/haproxy/fcgi-app.h
index becfdde..23f29f1 100644
--- a/include/haproxy/fcgi-app.h
+++ b/include/haproxy/fcgi-app.h
@@ -23,7 +23,7 @@
 #define _HAPROXY_HTTP_FCGI_H
 
 #include <haproxy/fcgi-app-t.h>
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 #include <types/stream.h>
 
 struct fcgi_app *fcgi_app_find_by_name(const char *name);
diff --git a/include/haproxy/filters.h b/include/haproxy/filters.h
index b9f24bf..74b4ce9 100644
--- a/include/haproxy/filters.h
+++ b/include/haproxy/filters.h
@@ -24,7 +24,7 @@
 #include <haproxy/channel.h>
 #include <haproxy/filters-t.h>
 #include <haproxy/http_ana-t.h>
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 #include <types/stream.h>
 
 extern const char *trace_flt_id;
diff --git a/include/haproxy/flt_http_comp.h b/include/haproxy/flt_http_comp.h
index 4ba5ebb..56f984a 100644
--- a/include/haproxy/flt_http_comp.h
+++ b/include/haproxy/flt_http_comp.h
@@ -21,7 +21,7 @@
 #ifndef _HAPROXY_FLT_HTTP_COMP_H
 #define _HAPROXY_FLT_HTTP_COMP_H
 
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 
 int check_implicit_http_comp_flt(struct proxy *proxy);
 
diff --git a/include/haproxy/global.h b/include/haproxy/global.h
index a3f952c..5cfe0b9 100644
--- a/include/haproxy/global.h
+++ b/include/haproxy/global.h
@@ -28,7 +28,7 @@
 #include <haproxy/vars-t.h>
 #include <haproxy/mworker-t.h>
 
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 
 extern struct global global;
 extern int  pid;                /* current process id */
diff --git a/include/haproxy/hlua-t.h b/include/haproxy/hlua-t.h
index f363326..35a7a81 100644
--- a/include/haproxy/hlua-t.h
+++ b/include/haproxy/hlua-t.h
@@ -30,10 +30,10 @@
 #include <import/ebpttree.h>
 
 #include <haproxy/list-t.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/regex-t.h>
 #include <haproxy/xref-t.h>
 
-#include <types/proxy.h>
 #include <types/server.h>
 #include <haproxy/stick_table-t.h>
 
diff --git a/include/haproxy/http_htx.h b/include/haproxy/http_htx.h
index 775037b..4b0f097 100644
--- a/include/haproxy/http_htx.h
+++ b/include/haproxy/http_htx.h
@@ -26,8 +26,8 @@
 #include <import/ist.h>
 #include <haproxy/buf-t.h>
 #include <haproxy/http_htx-t.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/regex-t.h>
-#include <types/proxy.h>
 
 extern struct buffer http_err_chunks[HTTP_ERR_SIZE];
 extern struct http_reply http_err_replies[HTTP_ERR_SIZE];
diff --git a/include/haproxy/http_rules.h b/include/haproxy/http_rules.h
index cc480f8..2006742 100644
--- a/include/haproxy/http_rules.h
+++ b/include/haproxy/http_rules.h
@@ -25,7 +25,7 @@
 #include <haproxy/api.h>
 #include <haproxy/list.h>
 #include <haproxy/action-t.h>
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 
 extern struct action_kw_list http_req_keywords;
 extern struct action_kw_list http_res_keywords;
diff --git a/include/haproxy/lb_fas.h b/include/haproxy/lb_fas.h
index 3293db8..fa2a507 100644
--- a/include/haproxy/lb_fas.h
+++ b/include/haproxy/lb_fas.h
@@ -24,7 +24,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/lb_fas-t.h>
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 #include <types/server.h>
 
 struct server *fas_get_next_server(struct proxy *p, struct server *srvtoavoid);
diff --git a/include/haproxy/lb_fwlc.h b/include/haproxy/lb_fwlc.h
index 5a549e3..24c7d74 100644
--- a/include/haproxy/lb_fwlc.h
+++ b/include/haproxy/lb_fwlc.h
@@ -24,7 +24,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/lb_fwlc-t.h>
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 #include <types/server.h>
 
 struct server *fwlc_get_next_server(struct proxy *p, struct server *srvtoavoid);
diff --git a/include/haproxy/lb_fwrr.h b/include/haproxy/lb_fwrr.h
index af38996..0accf06 100644
--- a/include/haproxy/lb_fwrr.h
+++ b/include/haproxy/lb_fwrr.h
@@ -24,7 +24,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/lb_fwrr-t.h>
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 #include <types/server.h>
 
 void fwrr_init_server_groups(struct proxy *p);
diff --git a/include/haproxy/lb_map.h b/include/haproxy/lb_map.h
index 2ab7158..1e390f7 100644
--- a/include/haproxy/lb_map.h
+++ b/include/haproxy/lb_map.h
@@ -23,7 +23,7 @@
 #define _HAPROXY_LB_MAP_H
 
 #include <haproxy/api.h>
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 #include <types/server.h>
 
 void recalc_server_map(struct proxy *px);
diff --git a/include/haproxy/log.h b/include/haproxy/log.h
index caddd95..1092920 100644
--- a/include/haproxy/log.h
+++ b/include/haproxy/log.h
@@ -27,9 +27,9 @@
 #include <haproxy/api.h>
 #include <haproxy/log-t.h>
 #include <haproxy/pool-t.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/thread-t.h>
 #include <proto/stream.h>
-#include <types/proxy.h>
 
 extern struct pool_head *pool_head_requri;
 extern struct pool_head *pool_head_uniqueid;
diff --git a/include/haproxy/obj_type.h b/include/haproxy/obj_type.h
index f59cf0a..0f932dd 100644
--- a/include/haproxy/obj_type.h
+++ b/include/haproxy/obj_type.h
@@ -29,7 +29,7 @@
 #include <haproxy/listener-t.h>
 #include <haproxy/obj_type-t.h>
 #include <haproxy/pool.h>
-#include <types/proxy.h>
+#include <haproxy/proxy-t.h>
 #include <types/server.h>
 #include <types/stream.h>
 #include <haproxy/stream_interface-t.h>
diff --git a/include/haproxy/peers.h b/include/haproxy/peers.h
index c07ee6d..958123a 100644
--- a/include/haproxy/peers.h
+++ b/include/haproxy/peers.h
@@ -26,9 +26,9 @@
 #include <haproxy/connection.h>
 #include <haproxy/obj_type.h>
 #include <haproxy/peers-t.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/time.h>
 
-#include <types/proxy.h>
 #include <haproxy/stick_table-t.h>
 #include <types/stream.h>
 
diff --git a/include/types/proxy.h b/include/haproxy/proxy-t.h
similarity index 98%
rename from include/types/proxy.h
rename to include/haproxy/proxy-t.h
index 6bcad16..d66ab34 100644
--- a/include/types/proxy.h
+++ b/include/haproxy/proxy-t.h
@@ -1,5 +1,5 @@
 /*
- * include/types/proxy.h
+ * include/haproxy/proxy-t.h
  * This file defines everything related to proxies.
  *
  * Copyright (C) 2000-2011 Willy Tarreau - w@1wt.eu
@@ -19,33 +19,27 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _TYPES_PROXY_H
-#define _TYPES_PROXY_H
+#ifndef _HAPROXY_PROXY_T_H
+#define _HAPROXY_PROXY_T_H
 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
+#include <import/eb32tree.h>
+#include <import/ebpttree.h>
+
 #include <haproxy/arg-t.h>
-#include <haproxy/api-t.h>
 #include <haproxy/check-t.h>
-#include <haproxy/chunk.h>
 #include <haproxy/counters-t.h>
-#include <haproxy/http-t.h>
+#include <haproxy/freq_ctr-t.h>
 #include <haproxy/list-t.h>
 #include <haproxy/obj_type-t.h>
-#include <haproxy/thread.h>
-
-#include <import/eb32tree.h>
-#include <import/ebistree.h>
-
-#include <haproxy/acl-t.h>
+#include <haproxy/thread-t.h>
+#include <haproxy/api-t.h>
 #include <types/backend.h>
-#include <haproxy/freq_ctr-t.h>
-#include <haproxy/sample-t.h>
 #include <types/server.h>
-#include <haproxy/stick_table-t.h>
 
 /* values for proxy->state */
 enum pr_state {
@@ -532,7 +526,7 @@
 	unsigned int mode;
 };
 
-#endif /* _TYPES_PROXY_H */
+#endif /* _HAPROXY_PROXY_T_H */
 
 /*
  * Local variables:
diff --git a/include/proto/proxy.h b/include/haproxy/proxy.h
similarity index 97%
rename from include/proto/proxy.h
rename to include/haproxy/proxy.h
index f5f0bf3..0cfea6a 100644
--- a/include/proto/proxy.h
+++ b/include/haproxy/proxy.h
@@ -1,5 +1,5 @@
 /*
- * include/proto/proxy.h
+ * include/haproxy/proxy.h
  * This file defines function prototypes for proxy management.
  *
  * Copyright (C) 2000-2011 Willy Tarreau - w@1wt.eu
@@ -19,17 +19,17 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _PROTO_PROXY_H
-#define _PROTO_PROXY_H
+#ifndef _HAPROXY_PROXY_H
+#define _HAPROXY_PROXY_H
 
 #include <haproxy/applet-t.h>
 #include <haproxy/api.h>
+#include <haproxy/freq_ctr.h>
 #include <haproxy/listener-t.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
-#include <haproxy/global-t.h>
-#include <types/proxy.h>
-#include <haproxy/freq_ctr.h>
+#include <types/server.h>
 
 extern struct proxy *proxies_list;
 extern struct eb_root used_proxy_id;	/* list of proxy IDs in use */
@@ -191,7 +191,7 @@
 	return 0;
 }
 
-#endif /* _PROTO_PROXY_H */
+#endif /* _HAPROXY_PROXY_H */
 
 /*
  * Local variables:
diff --git a/include/haproxy/ssl_sock.h b/include/haproxy/ssl_sock.h
index 1c4acd9..f15b1ce 100644
--- a/include/haproxy/ssl_sock.h
+++ b/include/haproxy/ssl_sock.h
@@ -28,10 +28,9 @@
 #include <haproxy/openssl-compat.h>
 #include <haproxy/ssl_sock-t.h>
 #include <haproxy/pool-t.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/thread.h>
 
-#include <types/proxy.h>
-
 extern struct list tlskeys_reference;
 extern int sslconns;
 extern int totalsslconns;
diff --git a/include/proto/backend.h b/include/proto/backend.h
index f702be9..57d606e 100644
--- a/include/proto/backend.h
+++ b/include/proto/backend.h
@@ -23,10 +23,10 @@
 #define _PROTO_BACKEND_H
 
 #include <haproxy/api.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/time.h>
 
 #include <types/backend.h>
-#include <types/proxy.h>
 #include <types/server.h>
 #include <types/stream.h>
 
diff --git a/include/proto/queue.h b/include/proto/queue.h
index 4397d60..735a1f1 100644
--- a/include/proto/queue.h
+++ b/include/proto/queue.h
@@ -24,8 +24,8 @@
 
 #include <haproxy/api.h>
 #include <haproxy/pool.h>
+#include <haproxy/proxy-t.h>
 
-#include <types/proxy.h>
 #include <types/queue.h>
 #include <types/stream.h>
 #include <types/server.h>
diff --git a/include/proto/server.h b/include/proto/server.h
index 3431423..383e832 100644
--- a/include/proto/server.h
+++ b/include/proto/server.h
@@ -27,9 +27,9 @@
 #include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <haproxy/dns-t.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/task.h>
 #include <haproxy/time.h>
-#include <types/proxy.h>
 #include <types/queue.h>
 #include <types/server.h>
 
diff --git a/include/types/spoe.h b/include/types/spoe.h
index 1f0a84a..f3edf86 100644
--- a/include/types/spoe.h
+++ b/include/types/spoe.h
@@ -27,10 +27,10 @@
 #include <haproxy/dynbuf-t.h>
 #include <haproxy/filters-t.h>
 #include <haproxy/list-t.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/thread.h>
 
 #include <haproxy/freq_ctr-t.h>
-#include <types/proxy.h>
 #include <haproxy/sample-t.h>
 #include <types/stream.h>
 #include <haproxy/task-t.h>
diff --git a/include/types/stream.h b/include/types/stream.h
index 41b800c..8f87ad5 100644
--- a/include/types/stream.h
+++ b/include/types/stream.h
@@ -36,11 +36,11 @@
 #include <haproxy/http_ana-t.h>
 #include <haproxy/list-t.h>
 #include <haproxy/obj_type-t.h>
+#include <haproxy/proxy-t.h>
 #include <haproxy/session-t.h>
 #include <haproxy/stream_interface-t.h>
 #include <haproxy/vars-t.h>
 
-#include <types/proxy.h>
 #include <types/queue.h>
 #include <types/server.h>
 #include <haproxy/task-t.h>