REORG: include: move protocol.h to haproxy/protocol{,-t}.h
The protocol.h files are pretty low in the dependency and (sadly) used
by some files from common/. Almost nothing was changed except lifting a
few comments.
diff --git a/include/common/standard.h b/include/common/standard.h
index fdaa2a8..ab8c075 100644
--- a/include/common/standard.h
+++ b/include/common/standard.h
@@ -43,7 +43,7 @@
#include <haproxy/namespace-t.h>
#include <import/eb32tree.h>
#include <import/eb32sctree.h>
-#include <types/protocol.h>
+#include <haproxy/protocol-t.h>
/* size used for max length of decimal representation of long long int. */
#define NB_LLMAX_STR (sizeof("-9223372036854775807")-1)
diff --git a/include/types/protocol.h b/include/haproxy/protocol-t.h
similarity index 94%
rename from include/types/protocol.h
rename to include/haproxy/protocol-t.h
index 0c49068..cc762ae 100644
--- a/include/types/protocol.h
+++ b/include/haproxy/protocol-t.h
@@ -1,8 +1,8 @@
/*
- * include/types/protocol.h
+ * include/haproxy/protocol-t.h
* This file defines the structures used by generic network protocols.
*
- * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -19,15 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _TYPES_PROTOCOL_H
-#define _TYPES_PROTOCOL_H
+#ifndef _HAPROXY_PROTOCOL_T_H
+#define _HAPROXY_PROTOCOL_T_H
#include <sys/types.h>
#include <sys/socket.h>
+#include <import/eb32tree.h>
#include <haproxy/api-t.h>
#include <haproxy/list-t.h>
-#include <import/eb32tree.h>
/* some pointer types referenced below */
struct listener;
@@ -37,7 +37,6 @@
* Custom network family for str2sa parsing. Should be ok to do this since
* sa_family_t is standardized as an unsigned integer
*/
-
#define AF_CUST_SOCKPAIR (AF_MAX + 1)
#define AF_CUST_MAX (AF_MAX + 2)
@@ -48,11 +47,15 @@
# error "Can't build on the target system, AF_CUST_MAX overflow"
#endif
-
-
/* max length of a protocol name, including trailing zero */
#define PROTO_NAME_LEN 16
+/* flags for ->connect() */
+#define CONNECT_HAS_DATA 0x00000001 /* There's data available to be sent */
+#define CONNECT_DELACK_SMART_CONNECT 0x00000002 /* Use a delayed ACK if the backend has tcp-smart-connect */
+#define CONNECT_DELACK_ALWAYS 0x00000004 /* Use a delayed ACK */
+#define CONNECT_CAN_USE_TFO 0x00000008 /* We can use TFO for this connection */
+
/* This structure contains all information needed to easily handle a protocol.
* Its primary goal is to ease listeners maintenance. Specifically, the
* bind_all() primitive must be used before any fork(), and the enable_all()
@@ -85,11 +88,7 @@
struct list list; /* list of registered protocols (under proto_lock) */
};
-#define CONNECT_HAS_DATA 0x00000001 /* There's data available to be sent */
-#define CONNECT_DELACK_SMART_CONNECT 0x00000002 /* Use a delayed ACK if the backend has tcp-smart-connect */
-#define CONNECT_DELACK_ALWAYS 0x00000004 /* Use a delayed ACK */
-#define CONNECT_CAN_USE_TFO 0x00000008 /* We can use TFO for this connection */
-#endif /* _TYPES_PROTOCOL_H */
+#endif /* _HAPROXY_PROTOCOL_T_H */
/*
* Local variables:
diff --git a/include/proto/protocol.h b/include/haproxy/protocol.h
similarity index 91%
rename from include/proto/protocol.h
rename to include/haproxy/protocol.h
index 36162a0..44d7b03 100644
--- a/include/proto/protocol.h
+++ b/include/haproxy/protocol.h
@@ -1,8 +1,8 @@
/*
- * include/proto/protocol.h
+ * include/haproxy/protocol.h
* This file declares generic protocol management primitives.
*
- * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -19,12 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _PROTO_PROTOCOL_H
-#define _PROTO_PROTOCOL_H
+#ifndef _HAPROXY_PROTOCOL_H
+#define _HAPROXY_PROTOCOL_H
#include <sys/socket.h>
+#include <haproxy/protocol-t.h>
#include <haproxy/thread.h>
-#include <types/protocol.h>
extern struct protocol *__protocol_by_family[AF_CUST_MAX];
__decl_thread(extern HA_SPINLOCK_T proto_lock);
@@ -63,7 +63,7 @@
return NULL;
}
-#endif /* _PROTO_PROTOCOL_H */
+#endif /* _HAPROXY_PROTOCOL_H */
/*
* Local variables:
diff --git a/include/types/connection.h b/include/types/connection.h
index 601e505..3f72855 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -31,7 +31,7 @@
#include <types/listener.h>
#include <types/obj_type.h>
#include <types/port_range.h>
-#include <types/protocol.h>
+#include <haproxy/protocol-t.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
diff --git a/src/backend.c b/src/backend.c
index e5ceda9..a78aad8 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -45,7 +45,7 @@
#include <proto/mux_pt.h>
#include <proto/obj_type.h>
#include <proto/payload.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/http_ana.h>
#include <proto/proto_tcp.h>
#include <proto/proxy.h>
diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c
index 438accc..bd3e61e 100644
--- a/src/cfgparse-listen.c
+++ b/src/cfgparse-listen.c
@@ -24,7 +24,7 @@
#include <proto/http_htx.h>
#include <proto/http_rules.h>
#include <proto/listener.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/proxy.h>
#include <proto/server.h>
#include <proto/stick_table.h>
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 8cdfb15..b3a66b8 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -71,7 +71,7 @@
#include <proto/lb_map.h>
#include <proto/listener.h>
#include <proto/log.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/http_ana.h>
#include <proto/proxy.h>
#include <proto/peers.h>
diff --git a/src/checks.c b/src/checks.c
index 2b7aa8c..4a1b87f 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -59,7 +59,7 @@
#include <proto/queue.h>
#include <proto/port_range.h>
#include <proto/proto_tcp.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/proxy.h>
#include <proto/server.h>
#include <proto/signal.h>
diff --git a/src/cli.c b/src/cli.c
index 00cf507..932af30 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -54,7 +54,7 @@
#include <proto/log.h>
#include <proto/pattern.h>
#include <proto/pipe.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/listener.h>
#include <proto/map.h>
#include <proto/proxy.h>
diff --git a/src/haproxy.c b/src/haproxy.c
index 684ee22..4bf229c 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -121,7 +121,7 @@
#include <proto/log.h>
#include <proto/mworker.h>
#include <proto/pattern.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/http_ana.h>
#include <proto/proxy.h>
#include <proto/queue.h>
diff --git a/src/listener.c b/src/listener.c
index 04ce4e3..2f9c800 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -26,7 +26,7 @@
#include <haproxy/time.h>
#include <types/global.h>
-#include <types/protocol.h>
+#include <haproxy/protocol-t.h>
#include <proto/acl.h>
#include <proto/connection.h>
@@ -34,7 +34,7 @@
#include <haproxy/freq_ctr.h>
#include <proto/log.h>
#include <proto/listener.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/proto_sockpair.h>
#include <proto/sample.h>
#include <proto/stream.h>
diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c
index 446d8de..dfba155 100644
--- a/src/proto_sockpair.c
+++ b/src/proto_sockpair.c
@@ -40,7 +40,7 @@
#include <haproxy/freq_ctr.h>
#include <proto/listener.h>
#include <proto/log.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/task.h>
static void sockpair_add_listener(struct listener *listener, int port);
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 973a4d3..42c034e 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -49,7 +49,7 @@
#include <proto/listener.h>
#include <proto/log.h>
#include <proto/port_range.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/http_ana.h>
#include <proto/proto_tcp.h>
#include <proto/proxy.h>
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 99e4eff..1dce1a9 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -39,7 +39,7 @@
#include <proto/fd.h>
#include <proto/listener.h>
#include <proto/log.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/task.h>
static int uxst_bind_listener(struct listener *listener, char *errmsg, int errlen);
diff --git a/src/protocol.c b/src/protocol.c
index 4909ee1..defb197 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -18,7 +18,7 @@
#include <haproxy/list.h>
#include <common/standard.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
/* List head of all registered protocols */
static struct list protocols = LIST_HEAD_INIT(protocols);
diff --git a/src/server.c b/src/server.c
index 29919ee..6f14e5a 100644
--- a/src/server.c
+++ b/src/server.c
@@ -35,7 +35,7 @@
#include <proto/checks.h>
#include <proto/connection.h>
#include <proto/port_range.h>
-#include <proto/protocol.h>
+#include <haproxy/protocol.h>
#include <proto/queue.h>
#include <proto/sample.h>
#include <proto/server.h>