]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: include: move protocol.h to haproxy/protocol{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Wed, 3 Jun 2020 13:26:55 +0000 (15:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:57 +0000 (10:18 +0200)
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.

16 files changed:
include/common/standard.h
include/haproxy/protocol-t.h [moved from include/types/protocol.h with 95% similarity]
include/haproxy/protocol.h [moved from include/proto/protocol.h with 91% similarity]
include/types/connection.h
src/backend.c
src/cfgparse-listen.c
src/cfgparse.c
src/checks.c
src/cli.c
src/haproxy.c
src/listener.c
src/proto_sockpair.c
src/proto_tcp.c
src/proto_uxst.c
src/protocol.c
src/server.c

index fdaa2a8ae8537f22cf478155761b9d852e576ead..ab8c075784410cc950946b670f31a67497f5f3c9 100644 (file)
@@ -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)
similarity index 95%
rename from include/types/protocol.h
rename to include/haproxy/protocol-t.h
index 0c490682acfb1613de4134da6c363df25fe4d8bf..cc762aefa63dd3c85a16bea07ac2b43c8347ca0a 100644 (file)
@@ -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
  * 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 @@ struct connection;
  * 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 @@ struct connection;
 # 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 protocol {
        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:
similarity index 91%
rename from include/proto/protocol.h
rename to include/haproxy/protocol.h
index 36162a04b9a3e02e626faff0a9199c9de4cf2aea..44d7b0334a1220ffa937e1eacee41c2dea06ac96 100644 (file)
@@ -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
  * 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 @@ static inline struct protocol *protocol_by_family(int family)
        return NULL;
 }
 
-#endif /* _PROTO_PROTOCOL_H */
+#endif /* _HAPROXY_PROTOCOL_H */
 
 /*
  * Local variables:
index 601e5056c59d75191dc362926def9684bc35ba89..3f72855d5f6eb557c6f2558c7e926afaed098835 100644 (file)
@@ -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>
index e5ceda9eb5e35fe819da277fb032a784b359aae9..a78aad8aa37ffece3b334da7d5ed73bc2f7430f2 100644 (file)
@@ -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>
index 438accc8ca73ae1d47ff04a5188738c0cd36ec0c..bd3e61e741df8dab176fd486e44345b8824694cb 100644 (file)
@@ -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>
index 8cdfb15a4bee151bcc2d9287bf88237ca4d35577..b3a66b829a994cffbd41a81e86a69c0971b05d7d 100644 (file)
@@ -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>
index 2b7aa8c7928d28d7650965a2dfca855d597fa4c9..4a1b87fda23d14f7dffc8acd7a559190e624c13b 100644 (file)
@@ -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>
index 00cf50778022f7be8172562e26615a832ae9e2df..932af30389bdd27e0b23503e6449506e2546e233 100644 (file)
--- 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>
index 684ee2217aaafd6076760e27ab337a575c89bad1..4bf229cd9f7be9d21a53b1f2fa5504e7c438fbce 100644 (file)
 #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>
index 04ce4e33f14a2c63b145ce767892e6c2735da2ee..2f9c800b5ffc03fe6655111dabac5de540e9a23d 100644 (file)
@@ -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>
index 446d8dee331f18fbef447fe06d90e5ea6d4f0764..dfba155558ab776c762d4a6e2868e04a7b6d47b4 100644 (file)
@@ -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);
index 973a4d3138c40cc79b5f2100f44c8669af97f99e..42c034e031af206082958794ff71d30626fc908e 100644 (file)
@@ -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>
index 99e4eff05893f813a6515c5c634c8c195b424ec6..1dce1a93d1a2527f829d77585fa49a1815d3f692 100644 (file)
@@ -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);
index 4909ee14a3ba990fde36f33ab6507c75bcf93887..defb19721fbc72c5470df94da1af54833bea88bf 100644 (file)
@@ -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);
index 29919ee4150964a6ef0f5a8f5fbecf09e82da782..6f14e5af6e7959037b9e1fb5dfd8cb0eeeb88ad2 100644 (file)
@@ -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>