CLEANUP: include: tree-wide alphabetical sort of include files

This patch fixes all the leftovers from the include cleanup campaign. There
were not that many (~400 entries in ~150 files) but it was definitely worth
doing it as it revealed a few duplicates.
diff --git a/src/51d.c b/src/51d.c
index 54e9a1e..b49695b 100644
--- a/src/51d.c
+++ b/src/51d.c
@@ -1,20 +1,20 @@
 #include <stdio.h>
 
+#include <import/lru.h>
+#include <import/xxhash.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
+#include <haproxy/buf-t.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/chunk.h>
-#include <haproxy/buf-t.h>
 #include <haproxy/errors.h>
+#include <haproxy/global.h>
 #include <haproxy/http_ana.h>
 #include <haproxy/http_fetch.h>
 #include <haproxy/http_htx.h>
-#include <haproxy/thread.h>
-#include <haproxy/global.h>
-#include <haproxy/arg.h>
 #include <haproxy/sample.h>
+#include <haproxy/thread.h>
 #include <haproxy/tools.h>
-#include <import/xxhash.h>
-#include <import/lru.h>
 #include <51Degrees.h>
 
 struct _51d_property_names {
diff --git a/src/acl.c b/src/acl.c
index b1409bd..c328844 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -14,22 +14,20 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <import/ebsttree.h>
+
 #include <haproxy/acl.h>
-#include <haproxy/auth.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
+#include <haproxy/auth.h>
 #include <haproxy/errors.h>
+#include <haproxy/global.h>
 #include <haproxy/list.h>
 #include <haproxy/pattern.h>
 #include <haproxy/proxy-t.h>
-#include <haproxy/tools.h>
-
-#include <haproxy/global.h>
-
-#include <haproxy/arg.h>
 #include <haproxy/sample.h>
 #include <haproxy/stick_table.h>
-
-#include <import/ebsttree.h>
+#include <haproxy/tools.h>
 
 /* List head of all known ACL keywords */
 static struct acl_kw_list acl_keywords = {
diff --git a/src/action.c b/src/action.c
index 16e96dd..6c4aa62 100644
--- a/src/action.c
+++ b/src/action.c
@@ -13,15 +13,14 @@
 #include <haproxy/action.h>
 #include <haproxy/api.h>
 #include <haproxy/errors.h>
+#include <haproxy/list.h>
 #include <haproxy/obj_type.h>
 #include <haproxy/pool.h>
-#include <haproxy/list.h>
 #include <haproxy/proxy.h>
+#include <haproxy/stick_table.h>
 #include <haproxy/task.h>
 #include <haproxy/tools.h>
 
-#include <haproxy/stick_table.h>
-
 
 /* Find and check the target table used by an action track-sc*. This
  * function should be called during the configuration validity check.
diff --git a/src/activity.c b/src/activity.c
index 5ef38c9..53721ef 100644
--- a/src/activity.c
+++ b/src/activity.c
@@ -10,14 +10,14 @@
  *
  */
 
+#include <haproxy/activity-t.h>
 #include <haproxy/api.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/channel.h>
 #include <haproxy/cli.h>
+#include <haproxy/freq_ctr.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/tools.h>
-#include <haproxy/activity-t.h>
-#include <haproxy/freq_ctr.h>
 
 
 /* bit field of profiling options. Beware, may be modified at runtime! */
diff --git a/src/applet.c b/src/applet.c
index 3ec106c..a806eca 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -13,8 +13,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <haproxy/applet.h>
 #include <haproxy/api.h>
+#include <haproxy/applet.h>
 #include <haproxy/channel.h>
 #include <haproxy/list.h>
 #include <haproxy/stream.h>
diff --git a/src/arg.c b/src/arg.c
index a0f9a59..2676ce8 100644
--- a/src/arg.c
+++ b/src/arg.c
@@ -14,10 +14,10 @@
 #include <sys/socket.h>
 #include <arpa/inet.h>
 
-#include <haproxy/tools.h>
+#include <haproxy/arg.h>
 #include <haproxy/chunk.h>
 #include <haproxy/global.h>
-#include <haproxy/arg.h>
+#include <haproxy/tools.h>
 
 const char *arg_type_names[ARGT_NBTYPES] = {
 	[ARGT_STOP] = "end of arguments",
diff --git a/src/auth.c b/src/auth.c
index a84e891..bcb4a8e 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -25,10 +25,10 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <haproxy/auth-t.h>
 #include <haproxy/api.h>
-#include <haproxy/global.h>
+#include <haproxy/auth-t.h>
 #include <haproxy/errors.h>
+#include <haproxy/global.h>
 #include <haproxy/pattern-t.h>
 #include <haproxy/sample-t.h>
 #include <haproxy/thread.h>
diff --git a/src/backend.c b/src/backend.c
index 4927b01..915adc5 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -20,11 +20,13 @@
 #include <sys/types.h>
 
 #include <haproxy/acl.h>
-#include <haproxy/backend.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
+#include <haproxy/backend.h>
 #include <haproxy/channel.h>
 #include <haproxy/check.h>
 #include <haproxy/frontend.h>
+#include <haproxy/global.h>
 #include <haproxy/hash.h>
 #include <haproxy/http.h>
 #include <haproxy/http_ana.h>
@@ -36,10 +38,14 @@
 #include <haproxy/lb_fwrr.h>
 #include <haproxy/lb_map.h>
 #include <haproxy/log.h>
+#include <haproxy/namespace.h>
 #include <haproxy/obj_type.h>
 #include <haproxy/payload.h>
+#include <haproxy/proto_tcp.h>
+#include <haproxy/protocol.h>
 #include <haproxy/proxy.h>
 #include <haproxy/queue.h>
+#include <haproxy/sample.h>
 #include <haproxy/server.h>
 #include <haproxy/session.h>
 #include <haproxy/ssl_sock.h>
@@ -49,14 +55,6 @@
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 #include <haproxy/trace.h>
-#include <haproxy/namespace.h>
-
-#include <haproxy/global.h>
-
-#include <haproxy/arg.h>
-#include <haproxy/protocol.h>
-#include <haproxy/proto_tcp.h>
-#include <haproxy/sample.h>
 
 #define TRACE_SOURCE &trace_strm
 
diff --git a/src/buffer.c b/src/buffer.c
index e0db429..0b3b69c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -16,11 +16,10 @@
 
 #include <haproxy/api.h>
 #include <haproxy/dynbuf.h>
+#include <haproxy/global.h>
 #include <haproxy/list.h>
 #include <haproxy/pool.h>
 
-#include <haproxy/global.h>
-
 struct pool_head *pool_head_buffer;
 
 /* list of objects waiting for at least one buffer */
diff --git a/src/cache.c b/src/cache.c
index 6e8d8d2..6fc1c14 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -10,6 +10,9 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#include <import/eb32tree.h>
+#include <import/sha1.h>
+
 #include <haproxy/action-t.h>
 #include <haproxy/api.h>
 #include <haproxy/cfgparse.h>
@@ -17,20 +20,16 @@
 #include <haproxy/cli.h>
 #include <haproxy/errors.h>
 #include <haproxy/filters.h>
+#include <haproxy/hash.h>
 #include <haproxy/http_ana.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/http_rules.h>
+#include <haproxy/htx.h>
+#include <haproxy/net_helper.h>
 #include <haproxy/proxy.h>
 #include <haproxy/shctx.h>
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
-#include <import/eb32tree.h>
-#include <import/sha1.h>
-
-
-#include <haproxy/hash.h>
-#include <haproxy/htx.h>
-#include <haproxy/net_helper.h>
 
 #define CACHE_FLT_F_IMPLICIT_DECL  0x00000001 /* The cache filtre was implicitly declared (ie without
 					       * the filter keyword) */
diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c
index 45ac8c3..34cf346 100644
--- a/src/cfgparse-listen.c
+++ b/src/cfgparse-listen.c
@@ -11,8 +11,6 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include <haproxy/uri_auth.h>
-
 #include <haproxy/acl.h>
 #include <haproxy/capture-t.h>
 #include <haproxy/cfgparse.h>
@@ -25,14 +23,14 @@
 #include <haproxy/listener.h>
 #include <haproxy/log.h>
 #include <haproxy/peers.h>
+#include <haproxy/protocol.h>
 #include <haproxy/proxy.h>
 #include <haproxy/sample.h>
 #include <haproxy/server.h>
 #include <haproxy/stats-t.h>
-#include <haproxy/tcpcheck.h>
-
-#include <haproxy/protocol.h>
 #include <haproxy/stick_table.h>
+#include <haproxy/tcpcheck.h>
+#include <haproxy/uri_auth.h>
 
 /* Report a warning if a rule is placed after a 'tcp-request session' rule.
  * Return 1 if the warning has been emitted, otherwise 0.
diff --git a/src/cfgparse.c b/src/cfgparse.c
index fa85401..a9d863e 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -35,9 +35,9 @@
 
 #include <haproxy/acl.h>
 #include <haproxy/action-t.h>
+#include <haproxy/api.h>
 #include <haproxy/auth.h>
 #include <haproxy/backend.h>
-#include <haproxy/api.h>
 #include <haproxy/capture.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/channel.h>
@@ -48,6 +48,7 @@
 #include <haproxy/errors.h>
 #include <haproxy/filters.h>
 #include <haproxy/frontend.h>
+#include <haproxy/global.h>
 #include <haproxy/http_ana.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/lb_chash.h>
@@ -58,28 +59,25 @@
 #include <haproxy/listener.h>
 #include <haproxy/log.h>
 #include <haproxy/mailers.h>
+#include <haproxy/namespace.h>
 #include <haproxy/obj_type-t.h>
 #include <haproxy/peers-t.h>
+#include <haproxy/peers.h>
 #include <haproxy/pool.h>
+#include <haproxy/protocol.h>
 #include <haproxy/proxy.h>
+#include <haproxy/sample.h>
+#include <haproxy/server.h>
 #include <haproxy/session.h>
 #include <haproxy/stats-t.h>
-#include <haproxy/tools.h>
-#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/global.h>
-
-#include <haproxy/protocol.h>
-#include <haproxy/peers.h>
-#include <haproxy/sample.h>
 #include <haproxy/stick_table.h>
 #include <haproxy/stream.h>
+#include <haproxy/task.h>
 #include <haproxy/tcp_rules.h>
+#include <haproxy/thread.h>
+#include <haproxy/time.h>
+#include <haproxy/tools.h>
+#include <haproxy/uri_auth-t.h>
 
 
 /* Used to chain configuration sections definitions. This list
diff --git a/src/check.c b/src/check.c
index 7e8a1d9..1a9938d 100644
--- a/src/check.c
+++ b/src/check.c
@@ -31,42 +31,41 @@
 
 #include <haproxy/action.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/check.h>
 #include <haproxy/chunk.h>
 #include <haproxy/dns.h>
 #include <haproxy/extcheck.h>
-#include <haproxy/istbuf.h>
-#include <haproxy/list.h>
-#include <haproxy/mailers.h>
-#include <haproxy/queue.h>
-#include <haproxy/regex.h>
-#include <haproxy/tools.h>
-#include <haproxy/time.h>
-#include <haproxy/thread.h>
+#include <haproxy/fd.h>
+#include <haproxy/global.h>
+#include <haproxy/h1.h>
 #include <haproxy/http.h>
 #include <haproxy/http_htx.h>
-#include <haproxy/h1.h>
 #include <haproxy/htx.h>
+#include <haproxy/istbuf.h>
+#include <haproxy/list.h>
 #include <haproxy/log.h>
+#include <haproxy/mailers.h>
+#include <haproxy/port_range.h>
+#include <haproxy/proto_tcp.h>
+#include <haproxy/proto_udp.h>
+#include <haproxy/protocol.h>
 #include <haproxy/proxy.h>
+#include <haproxy/queue.h>
+#include <haproxy/regex.h>
+#include <haproxy/sample.h>
 #include <haproxy/server.h>
 #include <haproxy/ssl_sock.h>
 #include <haproxy/stats-t.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/tcpcheck.h>
+#include <haproxy/thread.h>
+#include <haproxy/time.h>
+#include <haproxy/tools.h>
 #include <haproxy/vars.h>
 
-#include <haproxy/global.h>
-
-#include <haproxy/arg.h>
-#include <haproxy/fd.h>
-#include <haproxy/port_range.h>
-#include <haproxy/proto_tcp.h>
-#include <haproxy/protocol.h>
-#include <haproxy/proto_udp.h>
-#include <haproxy/sample.h>
 
 static int wake_srv_chk(struct conn_stream *cs);
 struct data_cb check_conn_cb = {
diff --git a/src/chunk.c b/src/chunk.c
index 6f9aa39..ade0323 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -17,9 +17,8 @@
 
 #include <haproxy/api.h>
 #include <haproxy/chunk.h>
-#include <haproxy/tools.h>
-
 #include <haproxy/global.h>
+#include <haproxy/tools.h>
 
 /* trash chunks used for various conversions */
 static THREAD_LOCAL struct buffer *trash_chunk;
diff --git a/src/cli.c b/src/cli.c
index 6ca0a1f..f850dd7 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -26,21 +26,29 @@
 
 #include <net/if.h>
 
-#include <haproxy/applet-t.h>
+#include <haproxy/activity.h>
 #include <haproxy/api.h>
+#include <haproxy/applet-t.h>
+#include <haproxy/base64.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/channel.h>
 #include <haproxy/check.h>
 #include <haproxy/cli.h>
+#include <haproxy/compression.h>
 #include <haproxy/dns-t.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
+#include <haproxy/freq_ctr.h>
 #include <haproxy/frontend.h>
+#include <haproxy/global.h>
 #include <haproxy/list.h>
 #include <haproxy/listener.h>
 #include <haproxy/log.h>
 #include <haproxy/mworker-t.h>
 #include <haproxy/pattern-t.h>
 #include <haproxy/peers.h>
+#include <haproxy/pipe.h>
+#include <haproxy/protocol.h>
 #include <haproxy/proxy.h>
 #include <haproxy/sample-t.h>
 #include <haproxy/server.h>
@@ -49,20 +57,10 @@
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
-#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
+#include <haproxy/tools.h>
 #include <haproxy/version.h>
-#include <haproxy/base64.h>
-
-#include <haproxy/global.h>
-
-#include <haproxy/activity.h>
-#include <haproxy/compression.h>
-#include <haproxy/fd.h>
-#include <haproxy/freq_ctr.h>
-#include <haproxy/pipe.h>
-#include <haproxy/protocol.h>
 
 #define PAYLOAD_PATTERN "<<"
 
diff --git a/src/compression.c b/src/compression.c
index 7d4720e..ffe5b0b 100644
--- a/src/compression.c
+++ b/src/compression.c
@@ -28,16 +28,14 @@
 
 #include <haproxy/api.h>
 #include <haproxy/cfgparse.h>
-#include <haproxy/dynbuf.h>
-#include <haproxy/stream.h>
-#include <haproxy/thread.h>
-#include <haproxy/pool.h>
-
-#include <haproxy/global.h>
 #include <haproxy/compression-t.h>
-
 #include <haproxy/compression.h>
+#include <haproxy/dynbuf.h>
 #include <haproxy/freq_ctr.h>
+#include <haproxy/global.h>
+#include <haproxy/pool.h>
+#include <haproxy/stream.h>
+#include <haproxy/thread.h>
 
 
 #if defined(USE_ZLIB)
diff --git a/src/connection.c b/src/connection.c
index f9741ef..63c511b 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -15,13 +15,12 @@
 #include <haproxy/api.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/connection.h>
+#include <haproxy/fd.h>
 #include <haproxy/frontend.h>
+#include <haproxy/hash.h>
 #include <haproxy/log-t.h>
 #include <haproxy/namespace.h>
-#include <haproxy/hash.h>
 #include <haproxy/net_helper.h>
-
-#include <haproxy/fd.h>
 #include <haproxy/proto_tcp.h>
 #include <haproxy/sample.h>
 #include <haproxy/ssl_sock.h>
diff --git a/src/da.c b/src/da.c
index 9b12cc5..98dbe6c 100644
--- a/src/da.c
+++ b/src/da.c
@@ -1,15 +1,15 @@
 #include <stdio.h>
 
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/errors.h>
+#include <haproxy/global.h>
 #include <haproxy/http.h>
 #include <haproxy/http_ana.h>
 #include <haproxy/http_fetch.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/htx.h>
-#include <haproxy/global.h>
-#include <haproxy/arg.h>
 #include <haproxy/sample.h>
 #include <haproxy/tools.h>
 #include <dac.h>
diff --git a/src/debug.c b/src/debug.c
index 6829eb2..b4475f3 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -24,18 +24,17 @@
 #include <haproxy/buf.h>
 #include <haproxy/cli.h>
 #include <haproxy/debug.h>
+#include <haproxy/fd.h>
+#include <haproxy/global.h>
 #include <haproxy/hlua.h>
 #include <haproxy/log.h>
+#include <haproxy/net_helper.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/thread.h>
-#include <import/ist.h>
-#include <haproxy/net_helper.h>
 #include <haproxy/tools.h>
-
-#include <haproxy/global.h>
+#include <import/ist.h>
 
-#include <haproxy/fd.h>
 
 /* mask of threads still having to dump, used to respect ordering. Only used
  * when USE_THREAD_DUMP is set.
diff --git a/src/dns.c b/src/dns.c
index 9ba1873..55b5a37 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -22,13 +22,17 @@
 #include <haproxy/action.h>
 #include <haproxy/api.h>
 #include <haproxy/cfgparse.h>
-#include <haproxy/check.h>
 #include <haproxy/channel.h>
+#include <haproxy/check.h>
 #include <haproxy/cli.h>
 #include <haproxy/dns.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
+#include <haproxy/global.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/log.h>
+#include <haproxy/net_helper.h>
+#include <haproxy/proto_udp.h>
 #include <haproxy/proxy.h>
 #include <haproxy/sample.h>
 #include <haproxy/server.h>
@@ -36,15 +40,10 @@
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/tcp_rules.h>
-#include <haproxy/time.h>
 #include <haproxy/ticks.h>
-#include <haproxy/net_helper.h>
+#include <haproxy/time.h>
 #include <haproxy/vars.h>
 
-#include <haproxy/global.h>
-
-#include <haproxy/fd.h>
-#include <haproxy/proto_udp.h>
 
 struct list dns_resolvers  = LIST_HEAD_INIT(dns_resolvers);
 struct list dns_srvrq_list = LIST_HEAD_INIT(dns_srvrq_list);
diff --git a/src/ebimtree.c b/src/ebimtree.c
index e6b82cc..1ac444a 100644
--- a/src/ebimtree.c
+++ b/src/ebimtree.c
@@ -20,8 +20,8 @@
 
 /* Consult ebimtree.h for more details about those functions */
 
-#include <import/ebpttree.h>
 #include <import/ebimtree.h>
+#include <import/ebpttree.h>
 
 /* Find the first occurrence of a key of <len> bytes in the tree <root>.
  * If none can be found, return NULL.
diff --git a/src/ev_epoll.c b/src/ev_epoll.c
index 8096988..2501dd5 100644
--- a/src/ev_epoll.c
+++ b/src/ev_epoll.c
@@ -14,15 +14,14 @@
 #include <sys/time.h>
 #include <sys/types.h>
 
+#include <haproxy/activity.h>
 #include <haproxy/api.h>
+#include <haproxy/fd.h>
 #include <haproxy/global.h>
 #include <haproxy/signal.h>
-#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
-
-#include <haproxy/activity.h>
-#include <haproxy/fd.h>
+#include <haproxy/tools.h>
 
 
 /* private data */
diff --git a/src/ev_evports.c b/src/ev_evports.c
index cbb1bc8..6b14ea0 100644
--- a/src/ev_evports.c
+++ b/src/ev_evports.c
@@ -18,16 +18,14 @@
 #include <errno.h>
 #include <syslog.h>
 
+#include <haproxy/activity.h>
 #include <haproxy/api.h>
+#include <haproxy/fd.h>
+#include <haproxy/global.h>
 #include <haproxy/signal.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 
-#include <haproxy/global.h>
-
-#include <haproxy/activity.h>
-#include <haproxy/fd.h>
-
 /*
  * Private data:
  */
diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c
index c699fe2..3a0b0a3 100644
--- a/src/ev_kqueue.c
+++ b/src/ev_kqueue.c
@@ -17,16 +17,14 @@
 #include <sys/event.h>
 #include <sys/time.h>
 
+#include <haproxy/activity.h>
 #include <haproxy/api.h>
+#include <haproxy/fd.h>
+#include <haproxy/global.h>
 #include <haproxy/signal.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 
-#include <haproxy/global.h>
-
-#include <haproxy/activity.h>
-#include <haproxy/fd.h>
-
 
 /* private data */
 static int kqueue_fd[MAX_THREADS]; // per-thread kqueue_fd
diff --git a/src/ev_poll.c b/src/ev_poll.c
index 53ae81f..03d32b0 100644
--- a/src/ev_poll.c
+++ b/src/ev_poll.c
@@ -17,15 +17,13 @@
 #include <sys/time.h>
 #include <sys/types.h>
 
+#include <haproxy/activity.h>
 #include <haproxy/api.h>
+#include <haproxy/fd.h>
+#include <haproxy/global.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 
-#include <haproxy/global.h>
-
-#include <haproxy/activity.h>
-#include <haproxy/fd.h>
-
 
 #ifndef POLLRDHUP
 /* POLLRDHUP was defined late in libc, and it appeared in kernel 2.6.17 */
diff --git a/src/ev_select.c b/src/ev_select.c
index bf69f35..adc8160 100644
--- a/src/ev_select.c
+++ b/src/ev_select.c
@@ -14,15 +14,13 @@
 #include <sys/time.h>
 #include <sys/types.h>
 
+#include <haproxy/activity.h>
 #include <haproxy/api.h>
+#include <haproxy/fd.h>
+#include <haproxy/global.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 
-#include <haproxy/global.h>
-
-#include <haproxy/activity.h>
-#include <haproxy/fd.h>
-
 
 /* private data */
 static int maxfd;   /* # of the highest fd + 1 */
diff --git a/src/fcgi-app.c b/src/fcgi-app.c
index 1833557..964cc7d 100644
--- a/src/fcgi-app.c
+++ b/src/fcgi-app.c
@@ -17,6 +17,7 @@
 #include <haproxy/errors.h>
 #include <haproxy/fcgi-app.h>
 #include <haproxy/filters.h>
+#include <haproxy/global.h>
 #include <haproxy/http_fetch.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/log.h>
@@ -27,7 +28,6 @@
 #include <haproxy/session.h>
 #include <haproxy/tools.h>
 
-#include <haproxy/global.h>
 
 /* Global list of all FCGI applications */
 static struct fcgi_app *fcgi_apps = NULL;
diff --git a/src/fcgi.c b/src/fcgi.c
index 455cc22..1c2543d 100644
--- a/src/fcgi.c
+++ b/src/fcgi.c
@@ -24,8 +24,8 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <haproxy/fcgi.h>
 #include <haproxy/buf.h>
+#include <haproxy/fcgi.h>
 #include <haproxy/istbuf.h>
 
 /* Encodes header of a FCGI record into the chunk <out>. It returns non-zero on
diff --git a/src/fd.c b/src/fd.c
index d3940bb..2356a90 100644
--- a/src/fd.c
+++ b/src/fd.c
@@ -87,13 +87,12 @@
 #include <errno.h>
 #endif
 
-
 #include <haproxy/api.h>
-#include <haproxy/global.h>
-
 #include <haproxy/fd.h>
+#include <haproxy/global.h>
 #include <haproxy/port_range.h>
 
+
 struct fdtab *fdtab = NULL;     /* array of all the file descriptors */
 struct polled_mask *polled_mask = NULL; /* Array for the polled_mask of each fd */
 struct fdinfo *fdinfo = NULL;   /* less-often used infos for file descriptors */
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index a53bcd9..6302fc8 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -14,8 +14,8 @@
 
 #include <haproxy/acl.h>
 #include <haproxy/action-t.h>
-#include <haproxy/arg.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/filters.h>
 #include <haproxy/freq_ctr.h>
@@ -23,17 +23,17 @@
 #include <haproxy/global.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/log.h>
-#include <haproxy/sample.h>
-#include <haproxy/signal.h>
-#include <haproxy/thread.h>
 #include <haproxy/pool.h>
 #include <haproxy/proxy.h>
+#include <haproxy/sample.h>
 #include <haproxy/session.h>
+#include <haproxy/signal.h>
 #include <haproxy/spoe.h>
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/tcp_rules.h>
+#include <haproxy/thread.h>
 #include <haproxy/time.h>
 #include <haproxy/vars.h>
 
diff --git a/src/flt_trace.c b/src/flt_trace.c
index 910f5c4..f9fd248 100644
--- a/src/flt_trace.c
+++ b/src/flt_trace.c
@@ -22,8 +22,8 @@
 #include <haproxy/htx.h>
 #include <haproxy/proxy-t.h>
 #include <haproxy/stream.h>
-#include <haproxy/tools.h>
 #include <haproxy/time.h>
+#include <haproxy/tools.h>
 
 const char *trace_flt_id = "trace filter";
 
diff --git a/src/freq_ctr.c b/src/freq_ctr.c
index 17d2772..ad032a3 100644
--- a/src/freq_ctr.c
+++ b/src/freq_ctr.c
@@ -11,9 +11,9 @@
  */
 
 #include <haproxy/api.h>
-#include <haproxy/tools.h>
-#include <haproxy/time.h>
 #include <haproxy/freq_ctr.h>
+#include <haproxy/time.h>
+#include <haproxy/tools.h>
 
 /* Read a frequency counter taking history into account for missing time in
  * current period. Current second is sub-divided in 1000 chunks of one ms,
diff --git a/src/frontend.c b/src/frontend.c
index b819f5b..5658a5f 100644
--- a/src/frontend.c
+++ b/src/frontend.c
@@ -24,23 +24,22 @@
 
 #include <haproxy/acl.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/chunk.h>
+#include <haproxy/fd.h>
 #include <haproxy/frontend.h>
+#include <haproxy/global.h>
 #include <haproxy/http_ana.h>
 #include <haproxy/log.h>
+#include <haproxy/proto_tcp.h>
 #include <haproxy/proxy.h>
 #include <haproxy/sample.h>
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
-#include <haproxy/tools.h>
 #include <haproxy/time.h>
-
-#include <haproxy/global.h>
+#include <haproxy/tools.h>
 
-#include <haproxy/arg.h>
-#include <haproxy/fd.h>
-#include <haproxy/proto_tcp.h>
 
 /* Finish a stream accept() for a proxy (TCP or HTTP). It returns a negative
  * value in case of a critical failure which must cause the listener to be
diff --git a/src/h2.c b/src/h2.c
index bd46ffc..6684610 100644
--- a/src/h2.c
+++ b/src/h2.c
@@ -27,12 +27,13 @@
 
 #include <inttypes.h>
 #include <haproxy/api.h>
-#include <haproxy/http.h>
+#include <haproxy/global.h>
 #include <haproxy/h2.h>
 #include <haproxy/http-hdr-t.h>
+#include <haproxy/http.h>
 #include <haproxy/htx.h>
 #include <import/ist.h>
-#include <haproxy/global.h>
+
 
 struct h2_frame_definition h2_frame_definition[H2_FT_ENTRIES] =	{
 	 [H2_FT_DATA         ] = { .dir = 3, .min_id = 1, .max_id = H2_MAX_STREAM_ID, .min_len = 0, .max_len = H2_MAX_FRAME_LEN, },
diff --git a/src/haproxy.c b/src/haproxy.c
index f066f5f..dcde0c1 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -78,12 +78,15 @@
 #include <systemd/sd-daemon.h>
 #endif
 
-#include <haproxy/acl.h>
-#include <haproxy/auth.h>
-#include <haproxy/api.h>
 #include <import/sha1.h>
 
+#include <haproxy/acl.h>
+#include <haproxy/activity.h>
+#include <haproxy/api.h>
+#include <haproxy/arg.h>
+#include <haproxy/auth.h>
 #include <haproxy/base64.h>
+#include <haproxy/capture-t.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/chunk.h>
 #include <haproxy/cli.h>
@@ -91,10 +94,11 @@
 #include <haproxy/dns.h>
 #include <haproxy/dynbuf.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
 #include <haproxy/filters.h>
+#include <haproxy/global.h>
 #include <haproxy/hlua.h>
 #include <haproxy/http_rules.h>
-#include <haproxy/pool.h>
 #include <haproxy/list.h>
 #include <haproxy/listener.h>
 #include <haproxy/log.h>
@@ -104,29 +108,24 @@
 #include <haproxy/openssl-compat.h>
 #include <haproxy/pattern.h>
 #include <haproxy/peers.h>
+#include <haproxy/pool.h>
+#include <haproxy/protocol.h>
 #include <haproxy/proxy.h>
-#include <haproxy/sample.h>
 #include <haproxy/regex.h>
+#include <haproxy/sample.h>
 #include <haproxy/server.h>
 #include <haproxy/session.h>
 #include <haproxy/signal.h>
 #include <haproxy/ssl_sock.h>
 #include <haproxy/stream.h>
-#include <haproxy/tools.h>
-#include <haproxy/time.h>
-#include <haproxy/uri_auth-t.h>
-#include <haproxy/version.h>
 #include <haproxy/task.h>
 #include <haproxy/thread.h>
+#include <haproxy/time.h>
+#include <haproxy/tools.h>
+#include <haproxy/uri_auth-t.h>
 #include <haproxy/vars.h>
-
-#include <haproxy/capture-t.h>
-#include <haproxy/global.h>
+#include <haproxy/version.h>
 
-#include <haproxy/activity.h>
-#include <haproxy/arg.h>
-#include <haproxy/fd.h>
-#include <haproxy/protocol.h>
 
 /* array of init calls for older platforms */
 DECLARE_INIT_STAGES;
diff --git a/src/hlua.c b/src/hlua.c
index f2d471d..6a75e88 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -21,24 +21,21 @@
 #error "Requires Lua 5.3 or later."
 #endif
 
-#include <haproxy/applet.h>
-#include <haproxy/api.h>
 #include <import/ebpttree.h>
 
+#include <haproxy/api.h>
+#include <haproxy/applet.h>
 #include <haproxy/arg.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/channel.h>
 #include <haproxy/cli.h>
 #include <haproxy/connection.h>
-#include <haproxy/http_htx.h>
-#include <haproxy/thread.h>
-#include <haproxy/regex.h>
-#include <haproxy/xref.h>
 #include <haproxy/h1.h>
 #include <haproxy/hlua.h>
 #include <haproxy/hlua_fcn.h>
 #include <haproxy/http_ana.h>
 #include <haproxy/http_fetch.h>
+#include <haproxy/http_htx.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/log.h>
 #include <haproxy/map.h>
@@ -46,6 +43,7 @@
 #include <haproxy/pattern.h>
 #include <haproxy/payload.h>
 #include <haproxy/proxy-t.h>
+#include <haproxy/regex.h>
 #include <haproxy/sample.h>
 #include <haproxy/server-t.h>
 #include <haproxy/session.h>
@@ -54,8 +52,11 @@
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/tcp_rules.h>
+#include <haproxy/thread.h>
 #include <haproxy/tools.h>
 #include <haproxy/vars.h>
+#include <haproxy/xref.h>
+
 
 /* Lua uses longjmp to perform yield or throwing errors. This
  * macro is used only for identifying the function that can
diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c
index 78b9495..ed094b7 100644
--- a/src/hlua_fcn.c
+++ b/src/hlua_fcn.c
@@ -28,9 +28,8 @@
 #include <haproxy/regex.h>
 #include <haproxy/server.h>
 #include <haproxy/stats.h>
-#include <haproxy/time.h>
-
 #include <haproxy/stick_table.h>
+#include <haproxy/time.h>
 
 /* Contains the class reference of the concat object. */
 static int class_concat_ref;
diff --git a/src/hpack-dec.c b/src/hpack-dec.c
index 987165c..debd611 100644
--- a/src/hpack-dec.c
+++ b/src/hpack-dec.c
@@ -30,13 +30,13 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <haproxy/tools.h>
+#include <import/ist.h>
+#include <haproxy/chunk.h>
+#include <haproxy/h2.h>
 #include <haproxy/hpack-dec.h>
 #include <haproxy/hpack-huff.h>
 #include <haproxy/hpack-tbl.h>
-#include <haproxy/chunk.h>
-#include <haproxy/h2.h>
-#include <import/ist.h>
+#include <haproxy/tools.h>
 
 
 #if defined(DEBUG_HPACK)
diff --git a/src/hpack-enc.c b/src/hpack-enc.c
index 64cca78..3ab21bc 100644
--- a/src/hpack-enc.c
+++ b/src/hpack-enc.c
@@ -30,9 +30,9 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <import/ist.h>
 #include <haproxy/hpack-enc.h>
 #include <haproxy/http-hdr-t.h>
-#include <import/ist.h>
 
 /*
  * HPACK encoding: these tables were generated using gen-enc.c
diff --git a/src/hpack-tbl.c b/src/hpack-tbl.c
index e7c3d33..da81d29 100644
--- a/src/hpack-tbl.c
+++ b/src/hpack-tbl.c
@@ -30,9 +30,9 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <import/ist.h>
 #include <haproxy/hpack-huff.h>
 #include <haproxy/hpack-tbl.h>
-#include <import/ist.h>
 
 /* static header table as in RFC7541 Appendix A. [0] unused. */
 const struct http_hdr hpack_sht[HPACK_SHT_SIZE] = {
diff --git a/src/http_acl.c b/src/http_acl.c
index 17a818e..a81fb03 100644
--- a/src/http_acl.c
+++ b/src/http_acl.c
@@ -17,8 +17,9 @@
 #include <time.h>
 
 #include <haproxy/acl.h>
-#include <haproxy/auth.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
+#include <haproxy/auth.h>
 #include <haproxy/chunk.h>
 #include <haproxy/http.h>
 #include <haproxy/pattern.h>
@@ -26,8 +27,6 @@
 #include <haproxy/tools.h>
 #include <haproxy/version.h>
 
-#include <haproxy/arg.h>
-
 
 /* We use the pre-parsed method if it is known, and store its number as an
  * integer. If it is unknown, we use the pointer and the length.
diff --git a/src/http_act.c b/src/http_act.c
index 9db12de..76e6d2b 100644
--- a/src/http_act.c
+++ b/src/http_act.c
@@ -19,6 +19,8 @@
 #include <haproxy/acl.h>
 #include <haproxy/action.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
+#include <haproxy/capture-t.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/chunk.h>
 #include <haproxy/global.h>
@@ -36,9 +38,6 @@
 #include <haproxy/uri_auth-t.h>
 #include <haproxy/version.h>
 
-#include <haproxy/capture-t.h>
-
-#include <haproxy/arg.h>
 
 /* Release memory allocated by most of HTTP actions. Concretly, it releases
  * <arg.http>.
diff --git a/src/http_ana.c b/src/http_ana.c
index a95f079..6be34bb 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -12,8 +12,8 @@
 
 #include <haproxy/acl.h>
 #include <haproxy/action-t.h>
-#include <haproxy/backend.h>
 #include <haproxy/api.h>
+#include <haproxy/backend.h>
 #include <haproxy/base64.h>
 #include <haproxy/capture-t.h>
 #include <haproxy/channel.h>
diff --git a/src/http_conv.c b/src/http_conv.c
index c9f0ffa..390d85a 100644
--- a/src/http_conv.c
+++ b/src/http_conv.c
@@ -16,8 +16,8 @@
 #include <string.h>
 #include <time.h>
 
-#include <haproxy/arg.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/capture-t.h>
 #include <haproxy/chunk.h>
 #include <haproxy/http.h>
diff --git a/src/http_fetch.c b/src/http_fetch.c
index c2b8288..585743e 100644
--- a/src/http_fetch.c
+++ b/src/http_fetch.c
@@ -16,9 +16,9 @@
 #include <string.h>
 #include <time.h>
 
+#include <haproxy/api.h>
 #include <haproxy/arg.h>
 #include <haproxy/auth.h>
-#include <haproxy/api.h>
 #include <haproxy/base64.h>
 #include <haproxy/channel.h>
 #include <haproxy/chunk.h>
diff --git a/src/http_htx.c b/src/http_htx.c
index 8b61562..0af9f51 100644
--- a/src/http_htx.c
+++ b/src/http_htx.c
@@ -15,19 +15,18 @@
 #include <unistd.h>
 
 #include <haproxy/api.h>
-#include <haproxy/global.h>
-#include <haproxy/http_fetch.h>
-#include <haproxy/log.h>
-#include <haproxy/regex.h>
-#include <haproxy/sample.h>
-
+#include <haproxy/arg.h>
 #include <haproxy/cfgparse.h>
+#include <haproxy/global.h>
 #include <haproxy/h1.h>
 #include <haproxy/http.h>
+#include <haproxy/http_fetch.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/htx.h>
+#include <haproxy/log.h>
+#include <haproxy/regex.h>
+#include <haproxy/sample.h>
 
-#include <haproxy/arg.h>
 
 struct buffer http_err_chunks[HTTP_ERR_SIZE];
 struct http_reply http_err_replies[HTTP_ERR_SIZE];
diff --git a/src/http_rules.c b/src/http_rules.c
index 79aa39c..87d32f3 100644
--- a/src/http_rules.c
+++ b/src/http_rules.c
@@ -19,6 +19,8 @@
 #include <haproxy/acl.h>
 #include <haproxy/action.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
+#include <haproxy/capture-t.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/chunk.h>
 #include <haproxy/global.h>
@@ -26,14 +28,10 @@
 #include <haproxy/http_rules.h>
 #include <haproxy/log.h>
 #include <haproxy/pool.h>
+#include <haproxy/sample.h>
 #include <haproxy/tools.h>
 #include <haproxy/version.h>
 
-#include <haproxy/capture-t.h>
-
-#include <haproxy/arg.h>
-#include <haproxy/sample.h>
-
 
 /* List head of all known action keywords for "http-request" */
 struct action_kw_list http_req_keywords = {
diff --git a/src/lb_chash.c b/src/lb_chash.c
index 1fb44f4..9f7ad5c 100644
--- a/src/lb_chash.c
+++ b/src/lb_chash.c
@@ -17,8 +17,8 @@
  */
 
 #include <import/eb32tree.h>
-#include <haproxy/backend.h>
 #include <haproxy/api.h>
+#include <haproxy/backend.h>
 #include <haproxy/queue.h>
 #include <haproxy/server-t.h>
 #include <haproxy/tools.h>
diff --git a/src/lb_fas.c b/src/lb_fas.c
index be2ce47..0fcd5e3 100644
--- a/src/lb_fas.c
+++ b/src/lb_fas.c
@@ -17,8 +17,8 @@
  */
 
 #include <import/eb32tree.h>
-#include <haproxy/backend.h>
 #include <haproxy/api.h>
+#include <haproxy/backend.h>
 #include <haproxy/queue.h>
 #include <haproxy/server-t.h>
 
diff --git a/src/lb_fwlc.c b/src/lb_fwlc.c
index a835f01..8eac2c9 100644
--- a/src/lb_fwlc.c
+++ b/src/lb_fwlc.c
@@ -11,8 +11,8 @@
  */
 
 #include <import/eb32tree.h>
-#include <haproxy/backend.h>
 #include <haproxy/api.h>
+#include <haproxy/backend.h>
 #include <haproxy/queue.h>
 #include <haproxy/server-t.h>
 
diff --git a/src/lb_fwrr.c b/src/lb_fwrr.c
index 6183433..05ae5f6 100644
--- a/src/lb_fwrr.c
+++ b/src/lb_fwrr.c
@@ -11,8 +11,8 @@
  */
 
 #include <import/eb32tree.h>
-#include <haproxy/backend.h>
 #include <haproxy/api.h>
+#include <haproxy/backend.h>
 #include <haproxy/queue.h>
 #include <haproxy/server-t.h>
 
diff --git a/src/lb_map.c b/src/lb_map.c
index 61debf8..b863d5f 100644
--- a/src/lb_map.c
+++ b/src/lb_map.c
@@ -11,8 +11,8 @@
  */
 
 #include <import/eb32tree.h>
-#include <haproxy/backend.h>
 #include <haproxy/api.h>
+#include <haproxy/backend.h>
 #include <haproxy/lb_map.h>
 #include <haproxy/queue.h>
 #include <haproxy/server-t.h>
diff --git a/src/listener.c b/src/listener.c
index 82eb2e7..cc49c70 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -23,22 +23,21 @@
 #include <haproxy/cfgparse.h>
 #include <haproxy/connection.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
+#include <haproxy/freq_ctr.h>
 #include <haproxy/global.h>
 #include <haproxy/list.h>
 #include <haproxy/listener.h>
 #include <haproxy/log.h>
+#include <haproxy/proto_sockpair.h>
+#include <haproxy/protocol-t.h>
+#include <haproxy/protocol.h>
+#include <haproxy/sample.h>
 #include <haproxy/stream.h>
 #include <haproxy/task.h>
-#include <haproxy/tools.h>
 #include <haproxy/time.h>
-
-#include <haproxy/protocol-t.h>
+#include <haproxy/tools.h>
 
-#include <haproxy/fd.h>
-#include <haproxy/freq_ctr.h>
-#include <haproxy/protocol.h>
-#include <haproxy/proto_sockpair.h>
-#include <haproxy/sample.h>
 
 /* List head of all known bind keywords */
 static struct bind_kw_list bind_keywords = {
diff --git a/src/log.c b/src/log.c
index 8c2334a..385bfc7 100644
--- a/src/log.c
+++ b/src/log.c
@@ -24,25 +24,24 @@
 #include <sys/time.h>
 #include <sys/uio.h>
 
-#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
+#include <haproxy/applet-t.h>
 #include <haproxy/cli.h>
+#include <haproxy/fd.h>
 #include <haproxy/frontend.h>
+#include <haproxy/global.h>
 #include <haproxy/http.h>
 #include <haproxy/log.h>
+#include <haproxy/ring.h>
+#include <haproxy/sample.h>
+#include <haproxy/sink.h>
 #include <haproxy/ssl_sock.h>
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
-#include <haproxy/tools.h>
 #include <haproxy/time.h>
+#include <haproxy/tools.h>
 #include <haproxy/version.h>
 
-#include <haproxy/global.h>
-
-#include <haproxy/fd.h>
-#include <haproxy/ring.h>
-#include <haproxy/sample.h>
-#include <haproxy/sink.h>
 
 struct log_fmt {
 	char *name;
diff --git a/src/mailers.c b/src/mailers.c
index 94ed5b4..76d6a69 100644
--- a/src/mailers.c
+++ b/src/mailers.c
@@ -20,13 +20,13 @@
 #include <haproxy/list.h>
 #include <haproxy/mailers.h>
 #include <haproxy/pool.h>
-#include <haproxy/tools.h>
-#include <haproxy/time.h>
-#include <haproxy/thread.h>
 #include <haproxy/proxy-t.h>
 #include <haproxy/server-t.h>
 #include <haproxy/task.h>
 #include <haproxy/tcpcheck.h>
+#include <haproxy/thread.h>
+#include <haproxy/time.h>
+#include <haproxy/tools.h>
 
 
 struct mailers *mailers = NULL;
diff --git a/src/map.c b/src/map.c
index 243676d..adc857b 100644
--- a/src/map.c
+++ b/src/map.c
@@ -12,18 +12,18 @@
 
 #include <stdio.h>
 
-#include <haproxy/applet-t.h>
 #include <haproxy/api.h>
+#include <haproxy/applet-t.h>
+#include <haproxy/arg.h>
 #include <haproxy/cli.h>
 #include <haproxy/map.h>
 #include <haproxy/pattern.h>
 #include <haproxy/regex.h>
+#include <haproxy/sample.h>
 #include <haproxy/stats-t.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/tools.h>
 
-#include <haproxy/arg.h>
-#include <haproxy/sample.h>
 
 /* Parse an IPv4 or IPv6 address and store it into the sample.
  * The output type is IPv4 or IPv6.
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index 03e5b9c..b116121 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -10,17 +10,18 @@
  *
  */
 
+#include <import/ist.h>
+
 #include <haproxy/api.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/connection.h>
 #include <haproxy/errors.h>
-#include <haproxy/fcgi.h>
 #include <haproxy/fcgi-app.h>
+#include <haproxy/fcgi.h>
 #include <haproxy/h1.h>
 #include <haproxy/h1_htx.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/htx.h>
-#include <import/ist.h>
 #include <haproxy/list.h>
 #include <haproxy/log.h>
 #include <haproxy/net_helper.h>
@@ -32,6 +33,7 @@
 #include <haproxy/stream_interface.h>
 #include <haproxy/trace.h>
 
+
 /* FCGI Connection flags (32 bits) */
 #define FCGI_CF_NONE           0x00000000
 
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 5a66f7d..8bd43c9 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -9,22 +9,20 @@
  * 2 of the License, or (at your option) any later version.
  *
  */
+#include <import/ebistree.h>
+
 #include <haproxy/api.h>
-#include <haproxy/istbuf.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/connection.h>
 #include <haproxy/h1.h>
 #include <haproxy/h1_htx.h>
 #include <haproxy/h2.h>
+#include <haproxy/http_htx.h>
 #include <haproxy/htx.h>
-
-#include <import/ebistree.h>
-
+#include <haproxy/istbuf.h>
+#include <haproxy/log.h>
 #include <haproxy/pipe-t.h>
 #include <haproxy/proxy-t.h>
-
-#include <haproxy/http_htx.h>
-#include <haproxy/log.h>
 #include <haproxy/session-t.h>
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 1a31811..9928b32 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -12,7 +12,6 @@
 
 #include <import/eb32tree.h>
 #include <haproxy/api.h>
-#include <haproxy/istbuf.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/connection.h>
 #include <haproxy/h1.h>
@@ -22,6 +21,7 @@
 #include <haproxy/hpack-tbl.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/htx.h>
+#include <haproxy/istbuf.h>
 #include <haproxy/log.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/session-t.h>
diff --git a/src/mworker.c b/src/mworker.c
index 14c0e57..1caec10 100644
--- a/src/mworker.c
+++ b/src/mworker.c
@@ -17,6 +17,10 @@
 #include <string.h>
 #include <sys/wait.h>
 
+#if defined(USE_SYSTEMD)
+#include <systemd/sd-daemon.h>
+#endif
+
 #include <haproxy/api.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/cli.h>
@@ -34,10 +38,6 @@
 #include <haproxy/version.h>
 
 
-#if defined(USE_SYSTEMD)
-#include <systemd/sd-daemon.h>
-#endif
-
 static int exitcode = -1;
 static int max_reloads = -1; /* number max of reloads a worker can have until they are killed */
 
diff --git a/src/pattern.c b/src/pattern.c
index bbd7faa..274e773 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -14,19 +14,19 @@
 #include <stdio.h>
 #include <errno.h>
 
+#include <import/ebsttree.h>
+#include <import/lru.h>
+#include <import/xxhash.h>
+
 #include <haproxy/api.h>
 #include <haproxy/global.h>
 #include <haproxy/log.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/pattern.h>
 #include <haproxy/regex.h>
-#include <haproxy/tools.h>
-
 #include <haproxy/sample.h>
+#include <haproxy/tools.h>
 
-#include <import/ebsttree.h>
-#include <import/lru.h>
-#include <import/xxhash.h>
 
 char *pat_match_names[PAT_MATCH_NUM] = {
 	[PAT_MATCH_FOUND] = "found",
diff --git a/src/payload.c b/src/payload.c
index d9b3107..7feea16 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -15,13 +15,13 @@
 
 #include <haproxy/acl.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/channel.h>
 #include <haproxy/connection.h>
+#include <haproxy/htx.h>
 #include <haproxy/net_helper.h>
-#include <haproxy/payload.h>
 #include <haproxy/pattern.h>
-#include <haproxy/htx.h>
-#include <haproxy/arg.h>
+#include <haproxy/payload.h>
 #include <haproxy/sample.h>
 
 
diff --git a/src/peers.c b/src/peers.c
index fa444a9..478cbd2 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -20,8 +20,8 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#include <haproxy/applet.h>
 #include <haproxy/api.h>
+#include <haproxy/applet.h>
 #include <haproxy/channel.h>
 #include <haproxy/cli.h>
 #include <haproxy/dict.h>
@@ -32,16 +32,16 @@
 #include <haproxy/obj_type-t.h>
 #include <haproxy/peers.h>
 #include <haproxy/proxy.h>
-#include <haproxy/task.h>
 #include <haproxy/session-t.h>
 #include <haproxy/signal.h>
 #include <haproxy/stats-t.h>
 #include <haproxy/stick_table.h>
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
+#include <haproxy/task.h>
+#include <haproxy/thread.h>
 #include <haproxy/time.h>
 #include <haproxy/tools.h>
-#include <haproxy/thread.h>
 
 
 /*******************************/
diff --git a/src/pipe.c b/src/pipe.c
index 59b8312..efab2b4 100644
--- a/src/pipe.c
+++ b/src/pipe.c
@@ -15,10 +15,10 @@
 
 #include <haproxy/api.h>
 #include <haproxy/global.h>
-#include <haproxy/thread.h>
+#include <haproxy/pipe-t.h>
 #include <haproxy/pool.h>
+#include <haproxy/thread.h>
 
-#include <haproxy/pipe-t.h>
 
 DECLARE_STATIC_POOL(pool_head_pipe, "pipe", sizeof(struct pipe));
 
diff --git a/src/pool.c b/src/pool.c
index c185069..89c2ba4 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -11,23 +11,21 @@
  */
 #include <errno.h>
 
-#include <haproxy/applet-t.h>
+#include <haproxy/activity-t.h>
 #include <haproxy/api.h>
+#include <haproxy/applet-t.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/channel.h>
 #include <haproxy/cli.h>
 #include <haproxy/errors.h>
 #include <haproxy/global.h>
-
-#include <haproxy/thread.h>
-#include <haproxy/pool.h>
 #include <haproxy/list.h>
+#include <haproxy/pool.h>
 #include <haproxy/stats-t.h>
 #include <haproxy/stream_interface.h>
+#include <haproxy/thread.h>
 #include <haproxy/tools.h>
 
-#include <haproxy/activity-t.h>
-
 
 #ifdef CONFIG_HAP_LOCAL_POOLS
 /* These are the most common pools, expected to be initialized first. These
diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c
index 7d5a507..835ce8f 100644
--- a/src/proto_sockpair.c
+++ b/src/proto_sockpair.c
@@ -29,16 +29,16 @@
 #include <haproxy/api.h>
 #include <haproxy/connection.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
+#include <haproxy/freq_ctr.h>
 #include <haproxy/global.h>
 #include <haproxy/list.h>
 #include <haproxy/listener.h>
-#include <haproxy/tools.h>
+#include <haproxy/protocol.h>
 #include <haproxy/time.h>
+#include <haproxy/tools.h>
 #include <haproxy/version.h>
 
-#include <haproxy/fd.h>
-#include <haproxy/freq_ctr.h>
-#include <haproxy/protocol.h>
 
 static void sockpair_add_listener(struct listener *listener, int port);
 static int sockpair_bind_listener(struct listener *listener, char *errmsg, int errlen);
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 2a259f8..2d30ce4 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -32,27 +32,27 @@
 
 #include <haproxy/action-t.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/channel.h>
 #include <haproxy/connection.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
 #include <haproxy/global.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/list.h>
 #include <haproxy/listener.h>
 #include <haproxy/log.h>
+#include <haproxy/namespace.h>
+#include <haproxy/port_range.h>
+#include <haproxy/proto_tcp.h>
+#include <haproxy/protocol.h>
 #include <haproxy/proxy-t.h>
 #include <haproxy/sample.h>
 #include <haproxy/server.h>
 #include <haproxy/stream-t.h>
+#include <haproxy/tcp_rules.h>
 #include <haproxy/tools.h>
-#include <haproxy/namespace.h>
 
-#include <haproxy/arg.h>
-#include <haproxy/fd.h>
-#include <haproxy/port_range.h>
-#include <haproxy/protocol.h>
-#include <haproxy/proto_tcp.h>
-#include <haproxy/tcp_rules.h>
 
 static int tcp_bind_listeners(struct protocol *proto, char *errmsg, int errlen);
 static int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen);
diff --git a/src/proto_udp.c b/src/proto_udp.c
index 617df1a..f5202f8 100644
--- a/src/proto_udp.c
+++ b/src/proto_udp.c
@@ -10,10 +10,8 @@
  *
  */
 
-#include <haproxy/fd-t.h>
-#include <haproxy/proto_udp-t.h>
-
 #include <haproxy/fd.h>
+#include <haproxy/proto_udp-t.h>
 
 /* datagram handler callback */
 void dgram_fd_handler(int fd)
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index ea516ba..663f59a 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -29,16 +29,16 @@
 #include <haproxy/api.h>
 #include <haproxy/connection.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
 #include <haproxy/global.h>
 #include <haproxy/list.h>
 #include <haproxy/listener.h>
 #include <haproxy/log.h>
-#include <haproxy/tools.h>
+#include <haproxy/protocol.h>
 #include <haproxy/time.h>
+#include <haproxy/tools.h>
 #include <haproxy/version.h>
 
-#include <haproxy/fd.h>
-#include <haproxy/protocol.h>
 
 static int uxst_bind_listener(struct listener *listener, char *errmsg, int errlen);
 static int uxst_bind_listeners(struct protocol *proto, char *errmsg, int errlen);
diff --git a/src/protocol.c b/src/protocol.c
index f739444..af13f42 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -16,9 +16,9 @@
 #include <haproxy/api.h>
 #include <haproxy/errors.h>
 #include <haproxy/list.h>
+#include <haproxy/protocol.h>
 #include <haproxy/tools.h>
 
-#include <haproxy/protocol.h>
 
 /* List head of all registered protocols */
 static struct list protocols = LIST_HEAD_INIT(protocols);
diff --git a/src/proxy.c b/src/proxy.c
index ba8a07d..52f0c9d 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -17,11 +17,16 @@
 #include <sys/socket.h>
 #include <sys/stat.h>
 
-#include <haproxy/applet-t.h>
+#include <import/eb32tree.h>
+#include <import/ebistree.h>
+
 #include <haproxy/api.h>
+#include <haproxy/applet-t.h>
+#include <haproxy/capture-t.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/cli.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
 #include <haproxy/filters.h>
 #include <haproxy/global.h>
 #include <haproxy/http_ana.h>
@@ -30,23 +35,16 @@
 #include <haproxy/obj_type-t.h>
 #include <haproxy/peers.h>
 #include <haproxy/pool.h>
+#include <haproxy/proto_tcp.h>
 #include <haproxy/proxy.h>
 #include <haproxy/server-t.h>
+#include <haproxy/signal.h>
 #include <haproxy/stats-t.h>
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/time.h>
 
-#include <import/eb32tree.h>
-#include <import/ebistree.h>
-
-#include <haproxy/capture-t.h>
-
-#include <haproxy/fd.h>
-#include <haproxy/proto_tcp.h>
-#include <haproxy/signal.h>
-
 
 int listeners;	/* # of proxy listeners, set by cfgparse */
 struct proxy *proxies_list  = NULL;	/* list of all existing proxies */
diff --git a/src/queue.c b/src/queue.c
index 3cc8aea..afc2ab8 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -70,8 +70,8 @@
  */
 
 #include <import/eb32tree.h>
-#include <haproxy/backend.h>
 #include <haproxy/api.h>
+#include <haproxy/backend.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/pool.h>
 #include <haproxy/queue.h>
@@ -81,8 +81,8 @@
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/tcp_rules.h>
-#include <haproxy/time.h>
 #include <haproxy/thread.h>
+#include <haproxy/time.h>
 
 
 #define NOW_OFFSET_BOUNDARY()          ((now_ms - (TIMER_LOOK_BACK >> 12)) & 0xfffff)
diff --git a/src/raw_sock.c b/src/raw_sock.c
index 9e7f0c5..2d31b18 100644
--- a/src/raw_sock.c
+++ b/src/raw_sock.c
@@ -19,22 +19,20 @@
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-
 #include <netinet/tcp.h>
 
 #include <haproxy/api.h>
 #include <haproxy/buf.h>
 #include <haproxy/connection.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
+#include <haproxy/freq_ctr.h>
 #include <haproxy/global.h>
+#include <haproxy/pipe.h>
 #include <haproxy/stream_interface.h>
-#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
-
-#include <haproxy/fd.h>
-#include <haproxy/freq_ctr.h>
-#include <haproxy/pipe.h>
+#include <haproxy/tools.h>
 
 
 #if defined(USE_LINUX_SPLICE)
diff --git a/src/ring.c b/src/ring.c
index 437ee39..7c7d58e 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -19,13 +19,13 @@
  */
 
 #include <stdlib.h>
-#include <haproxy/applet.h>
 #include <haproxy/api.h>
+#include <haproxy/applet.h>
 #include <haproxy/buf.h>
 #include <haproxy/cli.h>
-#include <haproxy/thread.h>
 #include <haproxy/ring.h>
 #include <haproxy/stream_interface.h>
+#include <haproxy/thread.h>
 
 /* Creates and returns a ring buffer of size <size> bytes. Returns NULL on
  * allocation failure.
diff --git a/src/sample.c b/src/sample.c
index 4ee44cf..faf6471 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -16,9 +16,13 @@
 #include <arpa/inet.h>
 #include <stdio.h>
 
-#include <haproxy/api.h>
+#include <import/sha1.h>
+#include <import/xxhash.h>
 
+#include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/auth.h>
+#include <haproxy/base64.h>
 #include <haproxy/buf.h>
 #include <haproxy/chunk.h>
 #include <haproxy/errors.h>
@@ -30,17 +34,11 @@
 #include <haproxy/proxy.h>
 #include <haproxy/regex.h>
 #include <haproxy/sample.h>
+#include <haproxy/sink.h>
+#include <haproxy/stick_table.h>
 #include <haproxy/tools.h>
 #include <haproxy/uri_auth-t.h>
 #include <haproxy/vars.h>
-#include <haproxy/base64.h>
-
-#include <haproxy/arg.h>
-#include <haproxy/sink.h>
-#include <haproxy/stick_table.h>
-
-#include <import/sha1.h>
-#include <import/xxhash.h>
 
 /* sample type names */
 const char *smp_to_type[SMP_TYPES] = {
diff --git a/src/server.c b/src/server.c
index a0fd10f..4427569 100644
--- a/src/server.c
+++ b/src/server.c
@@ -11,14 +11,16 @@
  *
  */
 
+#include <netinet/tcp.h>
 #include <ctype.h>
 #include <errno.h>
 
+#include <import/ebsttree.h>
 #include <import/xxhash.h>
 
+#include <haproxy/api.h>
 #include <haproxy/applet-t.h>
 #include <haproxy/backend.h>
-#include <haproxy/api.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/check.h>
 #include <haproxy/cli.h>
@@ -30,6 +32,8 @@
 #include <haproxy/log.h>
 #include <haproxy/mailers.h>
 #include <haproxy/namespace.h>
+#include <haproxy/port_range.h>
+#include <haproxy/protocol.h>
 #include <haproxy/queue.h>
 #include <haproxy/sample.h>
 #include <haproxy/server.h>
@@ -40,11 +44,6 @@
 #include <haproxy/tcpcheck.h>
 #include <haproxy/time.h>
 
-#include <haproxy/port_range.h>
-#include <haproxy/protocol.h>
-#include <netinet/tcp.h>
-
-#include <import/ebsttree.h>
 
 static void srv_update_status(struct server *s);
 static void srv_update_state(struct server *srv, int version, char **params);
diff --git a/src/sink.c b/src/sink.c
index 8128775..a8fd018 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -25,11 +25,11 @@
 #include <haproxy/errors.h>
 #include <haproxy/list.h>
 #include <haproxy/log.h>
-#include <haproxy/time.h>
 #include <haproxy/ring.h>
 #include <haproxy/signal.h>
 #include <haproxy/sink.h>
 #include <haproxy/stream_interface.h>
+#include <haproxy/time.h>
 
 struct list sink_list = LIST_HEAD_INIT(sink_list);
 
diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c
index d2fd4e1..7a92934 100644
--- a/src/ssl_ckch.c
+++ b/src/ssl_ckch.c
@@ -22,6 +22,8 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include <import/ebsttree.h>
+
 #include <haproxy/base64.h>
 #include <haproxy/channel.h>
 #include <haproxy/cli.h>
@@ -32,8 +34,6 @@
 #include <haproxy/stream_interface.h>
 #include <haproxy/tools.h>
 
-#include <import/ebsttree.h>
-
 /* Uncommitted CKCH transaction */
 
 static struct {
diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c
index 8e6a2e4..266949e 100644
--- a/src/ssl_crtlist.c
+++ b/src/ssl_crtlist.c
@@ -8,13 +8,17 @@
  * 2 of the License, or (at your option) any later version.
  *
  */
+#include <sys/stat.h>
+#include <sys/types.h>
 
+#include <dirent.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
 #include <syslog.h>
-#include <sys/stat.h>
-#include <sys/types.h>
+
+#include <import/ebpttree.h>
+#include <import/ebsttree.h>
 
 #include <haproxy/channel.h>
 #include <haproxy/cli.h>
@@ -25,9 +29,6 @@
 #include <haproxy/stream_interface.h>
 #include <haproxy/tools.h>
 
-#include <dirent.h>
-#include <import/ebpttree.h>
-#include <import/ebsttree.h>
 
 /* release ssl bind conf */
 void ssl_sock_free_ssl_conf(struct ssl_bind_conf *conf)
diff --git a/src/ssl_sample.c b/src/ssl_sample.c
index 70b35b2..cc6f537 100644
--- a/src/ssl_sample.c
+++ b/src/ssl_sample.c
@@ -22,6 +22,7 @@
 
 #include <haproxy/acl.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/buf-t.h>
 #include <haproxy/obj_type.h>
 #include <haproxy/openssl-compat.h>
@@ -30,8 +31,6 @@
 #include <haproxy/ssl_utils.h>
 #include <haproxy/tools.h>
 
-#include <haproxy/arg.h>
-
 
 /***** Below are some sample fetching functions for ACL/patterns *****/
 
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index be3cd16..81a862d 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -40,22 +40,29 @@
 #include <netdb.h>
 #include <netinet/tcp.h>
 
-#include <haproxy/api.h>
+#include <import/ebpttree.h>
+#include <import/ebsttree.h>
 #include <import/lru.h>
 #include <import/xxhash.h>
 
-#include <haproxy/dynbuf.h>
+#include <haproxy/api.h>
+#include <haproxy/arg.h>
+#include <haproxy/base64.h>
 #include <haproxy/channel.h>
 #include <haproxy/chunk.h>
 #include <haproxy/cli.h>
 #include <haproxy/connection.h>
+#include <haproxy/dynbuf.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
+#include <haproxy/freq_ctr.h>
 #include <haproxy/frontend.h>
 #include <haproxy/global.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/log.h>
 #include <haproxy/openssl-compat.h>
 #include <haproxy/pattern-t.h>
+#include <haproxy/proto_tcp.h>
 #include <haproxy/proxy.h>
 #include <haproxy/server.h>
 #include <haproxy/shctx.h>
@@ -67,19 +74,11 @@
 #include <haproxy/stream-t.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
-#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
-#include <haproxy/base64.h>
+#include <haproxy/tools.h>
 #include <haproxy/vars.h>
 
-#include <import/ebpttree.h>
-#include <import/ebsttree.h>
-
-#include <haproxy/arg.h>
-#include <haproxy/fd.h>
-#include <haproxy/freq_ctr.h>
-#include <haproxy/proto_tcp.h>
 
 /* ***** READ THIS before adding code here! *****
  *
diff --git a/src/stats.c b/src/stats.c
index bb70884..7226874 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -24,9 +24,10 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include <haproxy/api.h>
 #include <haproxy/applet-t.h>
 #include <haproxy/backend.h>
-#include <haproxy/api.h>
+#include <haproxy/base64.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/channel.h>
 #include <haproxy/check.h>
@@ -35,17 +36,20 @@
 #include <haproxy/debug.h>
 #include <haproxy/dns.h>
 #include <haproxy/errors.h>
+#include <haproxy/fd.h>
+#include <haproxy/freq_ctr.h>
 #include <haproxy/frontend.h>
 #include <haproxy/global.h>
 #include <haproxy/http.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/htx.h>
-#include <haproxy/pool.h>
 #include <haproxy/list.h>
-#include <haproxy/log.h>
 #include <haproxy/listener.h>
+#include <haproxy/log.h>
 #include <haproxy/map-t.h>
 #include <haproxy/pattern-t.h>
+#include <haproxy/pipe.h>
+#include <haproxy/pool.h>
 #include <haproxy/proxy.h>
 #include <haproxy/server.h>
 #include <haproxy/session.h>
@@ -54,16 +58,12 @@
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
-#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
+#include <haproxy/tools.h>
 #include <haproxy/uri_auth-t.h>
 #include <haproxy/version.h>
-#include <haproxy/base64.h>
 
-#include <haproxy/fd.h>
-#include <haproxy/freq_ctr.h>
-#include <haproxy/pipe.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/stick_table.c b/src/stick_table.c
index c5ddd0b..3ddb668 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -14,34 +14,34 @@
 #include <string.h>
 #include <errno.h>
 
+#include <import/ebmbtree.h>
+#include <import/ebsttree.h>
+#include <import/ebistree.h>
+
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/cli.h>
 #include <haproxy/errors.h>
 #include <haproxy/global.h>
 #include <haproxy/http_rules.h>
-#include <haproxy/pool.h>
 #include <haproxy/list.h>
 #include <haproxy/log.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/peers.h>
+#include <haproxy/pool.h>
+#include <haproxy/proto_tcp.h>
 #include <haproxy/proxy.h>
+#include <haproxy/sample.h>
 #include <haproxy/stats-t.h>
+#include <haproxy/stick_table.h>
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/tcp_rules.h>
-#include <haproxy/tools.h>
 #include <haproxy/time.h>
-
-#include <import/ebmbtree.h>
-#include <import/ebsttree.h>
-#include <import/ebistree.h>
+#include <haproxy/tools.h>
 
-#include <haproxy/arg.h>
-#include <haproxy/proto_tcp.h>
-#include <haproxy/sample.h>
-#include <haproxy/stick_table.h>
 
 /* structure used to return a table key built from a sample */
 static THREAD_LOCAL struct stktable_key static_table_key;
diff --git a/src/stream.c b/src/stream.c
index 09f6f19..0c02cfb 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -18,9 +18,11 @@
 
 #include <haproxy/acl.h>
 #include <haproxy/action.h>
+#include <haproxy/activity.h>
+#include <haproxy/api.h>
 #include <haproxy/applet.h>
+#include <haproxy/arg.h>
 #include <haproxy/backend.h>
-#include <haproxy/api.h>
 #include <haproxy/capture.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/channel.h>
@@ -30,35 +32,33 @@
 #include <haproxy/dict.h>
 #include <haproxy/dns.h>
 #include <haproxy/dynbuf.h>
+#include <haproxy/fd.h>
 #include <haproxy/filters.h>
+#include <haproxy/freq_ctr.h>
 #include <haproxy/frontend.h>
 #include <haproxy/global.h>
 #include <haproxy/hlua.h>
 #include <haproxy/http_ana.h>
 #include <haproxy/http_rules.h>
-#include <haproxy/istbuf.h>
-#include <haproxy/thread.h>
 #include <haproxy/htx.h>
+#include <haproxy/istbuf.h>
 #include <haproxy/log.h>
+#include <haproxy/pipe.h>
 #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/stick_table.h>
 #include <haproxy/stream.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/tcp_rules.h>
+#include <haproxy/thread.h>
 #include <haproxy/trace.h>
 #include <haproxy/vars.h>
 
-#include <haproxy/activity.h>
-#include <haproxy/arg.h>
-#include <haproxy/fd.h>
-#include <haproxy/freq_ctr.h>
-#include <haproxy/pipe.h>
-#include <haproxy/stick_table.h>
 
 DECLARE_POOL(pool_head_stream, "stream", sizeof(struct stream));
 DECLARE_POOL(pool_head_uniqueid, "uniqueid", UNIQUEID_LEN);
diff --git a/src/stream_interface.c b/src/stream_interface.c
index 1d6cf51..ef2fc0b 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -19,23 +19,22 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#include <haproxy/applet.h>
 #include <haproxy/api.h>
+#include <haproxy/applet.h>
 #include <haproxy/channel.h>
 #include <haproxy/connection.h>
 #include <haproxy/dynbuf.h>
 #include <haproxy/http_htx.h>
+#include <haproxy/pipe-t.h>
+#include <haproxy/pipe.h>
 #include <haproxy/proxy.h>
 #include <haproxy/stream-t.h>
 #include <haproxy/stream_interface.h>
-#include <haproxy/tools.h>
+#include <haproxy/task.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
-#include <haproxy/task.h>
-
-#include <haproxy/pipe.h>
+#include <haproxy/tools.h>
 
-#include <haproxy/pipe-t.h>
 
 /* functions used by default on a detached stream-interface */
 static void stream_int_shutr(struct stream_interface *si);
diff --git a/src/task.c b/src/task.c
index bcf18b2..3d61562 100644
--- a/src/task.c
+++ b/src/task.c
@@ -12,18 +12,19 @@
 
 #include <string.h>
 
+#include <import/eb32sctree.h>
+#include <import/eb32tree.h>
+
 #include <haproxy/api.h>
-#include <haproxy/pool.h>
+#include <haproxy/fd.h>
+#include <haproxy/freq_ctr.h>
 #include <haproxy/list.h>
+#include <haproxy/pool.h>
 #include <haproxy/stream.h>
 #include <haproxy/task.h>
-#include <haproxy/tools.h>
 #include <haproxy/time.h>
-#include <import/eb32sctree.h>
-#include <import/eb32tree.h>
+#include <haproxy/tools.h>
 
-#include <haproxy/fd.h>
-#include <haproxy/freq_ctr.h>
 
 DECLARE_POOL(pool_head_task,    "task",    sizeof(struct task));
 DECLARE_POOL(pool_head_tasklet, "tasklet", sizeof(struct tasklet));
diff --git a/src/tcp_rules.c b/src/tcp_rules.c
index 5f8c74d..703bd4f 100644
--- a/src/tcp_rules.c
+++ b/src/tcp_rules.c
@@ -11,8 +11,8 @@
  */
 #include <haproxy/acl.h>
 #include <haproxy/action.h>
-#include <haproxy/arg-t.h>
 #include <haproxy/api.h>
+#include <haproxy/arg-t.h>
 #include <haproxy/capture-t.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/channel.h>
@@ -26,9 +26,9 @@
 #include <haproxy/stream-t.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/tcp_rules.h>
-#include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
+#include <haproxy/tools.h>
 #include <haproxy/trace.h>
 
 
diff --git a/src/tcpcheck.c b/src/tcpcheck.c
index 8808a0c..2b7c0c5 100644
--- a/src/tcpcheck.c
+++ b/src/tcpcheck.c
@@ -48,16 +48,16 @@
 #include <haproxy/istbuf.h>
 #include <haproxy/list.h>
 #include <haproxy/log.h>
-#include <haproxy/regex.h>
-#include <haproxy/tools.h>
-#include <haproxy/time.h>
 #include <haproxy/protocol.h>
 #include <haproxy/proxy-t.h>
+#include <haproxy/regex.h>
+#include <haproxy/sample.h>
 #include <haproxy/server.h>
 #include <haproxy/ssl_sock.h>
-#include <haproxy/sample.h>
 #include <haproxy/task.h>
 #include <haproxy/tcpcheck.h>
+#include <haproxy/time.h>
+#include <haproxy/tools.h>
 #include <haproxy/vars.h>
 
 
diff --git a/src/thread.c b/src/thread.c
index c58669f..3ec8d8c 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -24,10 +24,10 @@
 #endif
 
 #include <haproxy/cfgparse.h>
+#include <haproxy/fd.h>
+#include <haproxy/global.h>
 #include <haproxy/thread.h>
 #include <haproxy/tools.h>
-#include <haproxy/global.h>
-#include <haproxy/fd.h>
 
 struct thread_info ha_thread_info[MAX_THREADS] = { };
 THREAD_LOCAL struct thread_info *ti = &ha_thread_info[0];
diff --git a/src/time.c b/src/time.c
index 9c99fd5..a586e49 100644
--- a/src/time.c
+++ b/src/time.c
@@ -14,8 +14,8 @@
 #include <sys/time.h>
 
 #include <haproxy/api.h>
-#include <haproxy/tools.h>
 #include <haproxy/time.h>
+#include <haproxy/tools.h>
 
 THREAD_LOCAL unsigned int   ms_left_scaled;  /* milliseconds left for current second (0..2^32-1) */
 THREAD_LOCAL unsigned int   now_ms;          /* internal date in milliseconds (may wrap) */
diff --git a/src/tools.c b/src/tools.c
index 52522cb..0b7e77e 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -36,8 +36,8 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
-#include <import/eb32tree.h>
 #include <import/eb32sctree.h>
+#include <import/eb32tree.h>
 
 #include <haproxy/api.h>
 #include <haproxy/chunk.h>
@@ -46,11 +46,11 @@
 #include <haproxy/hlua.h>
 #include <haproxy/listener.h>
 #include <haproxy/namespace.h>
+#include <haproxy/proto_udp.h>
 #include <haproxy/ssl_sock.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/tools.h>
-#include <haproxy/proto_udp.h>
 
 /* This macro returns false if the test __x is false. Many
  * of the following parsing function must be abort the processing
diff --git a/src/vars.c b/src/vars.c
index 9ba1720..b154c52 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -1,7 +1,7 @@
 #include <ctype.h>
 
-#include <haproxy/arg.h>
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/check.h>
 #include <haproxy/global.h>
@@ -11,8 +11,8 @@
 #include <haproxy/log.h>
 #include <haproxy/sample.h>
 #include <haproxy/stream-t.h>
-#include <haproxy/tcpcheck.h>
 #include <haproxy/tcp_rules.h>
+#include <haproxy/tcpcheck.h>
 #include <haproxy/vars.h>
 
 
diff --git a/src/wurfl.c b/src/wurfl.c
index 9a1d858..06029aa 100644
--- a/src/wurfl.c
+++ b/src/wurfl.c
@@ -2,6 +2,7 @@
 #include <stdarg.h>
 
 #include <haproxy/api.h>
+#include <haproxy/arg.h>
 #include <haproxy/buf-t.h>
 #include <haproxy/cfgparse.h>
 #include <haproxy/chunk.h>
@@ -11,10 +12,9 @@
 #include <haproxy/http_fetch.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/log.h>
-#include <haproxy/arg.h>
 #include <haproxy/sample.h>
-#include <import/ebsttree.h>
 #include <import/ebmbtree.h>
+#include <import/ebsttree.h>
 
 #include <wurfl/wurfl.h>