]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: include: move peers.h to haproxy/peers{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Jun 2020 16:38:21 +0000 (18:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:58 +0000 (10:18 +0200)
The cfg_peers external declaration was moved to the main file instead
of the type one. A few types were still missing from the proto, causing
warnings in the functions prototypes (proxy, stick_table).

include/haproxy/peers-t.h [moved from include/types/peers.h with 96% similarity]
include/haproxy/peers.h [moved from include/proto/peers.h with 86% similarity]
include/types/stick_table.h
src/cfgparse.c
src/cli.c
src/haproxy.c
src/mworker.c
src/peers.c
src/proxy.c
src/stick_table.c

similarity index 96%
rename from include/types/peers.h
rename to include/haproxy/peers-t.h
index 33d40ec28b70a592246d50460fa8d041604f7990..ea96751840dcf3590939f1e19509468a25e1fcf9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/types/peers.h
+ * include/haproxy/peers-t.h
  * This file defines everything related to peers.
  *
  * Copyright 2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _TYPES_PEERS_H
-#define _TYPES_PEERS_H
+#ifndef _HAPROXY_PEERS_T_H
+#define _HAPROXY_PEERS_T_H
 
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
+#include <import/eb32tree.h>
+
 #include <haproxy/dict-t.h>
+#include <haproxy/thread-t.h>
 #include <haproxy/api-t.h>
 #include <haproxy/list-t.h>
-#include <import/eb32tree.h>
 
 
 struct shared_table {
@@ -131,7 +133,5 @@ struct dcache {
        size_t max_entries;
 };
 
-extern struct peers *cfg_peers;
-
-#endif /* _TYPES_PEERS_H */
+#endif /* _HAPROXY_PEERS_T_H */
 
similarity index 86%
rename from include/proto/peers.h
rename to include/haproxy/peers.h
index 93bb3224c1a798b7249ee82b00b6b28840a869bb..10fd8d89516e560e60b0f6f9f3b5e3f5b7d6f228 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/proto/peers.h
+ * include/haproxy/peers.h
  * This file defines function prototypes for peers management.
  *
  * Copyright 2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _PROTO_PEERS_H
-#define _PROTO_PEERS_H
+#ifndef _HAPROXY_PEERS_H
+#define _HAPROXY_PEERS_H
 
 #include <haproxy/api.h>
 #include <haproxy/connection.h>
-#include <haproxy/ticks.h>
+#include <haproxy/obj_type.h>
+#include <haproxy/peers-t.h>
 #include <haproxy/time.h>
+
+#include <types/proxy.h>
+#include <types/stick_table.h>
 #include <types/stream.h>
-#include <types/peers.h>
+
+extern struct peers *cfg_peers;
+
+int peers_init_sync(struct peers *peers);
+int peers_alloc_dcache(struct peers *peers);
+void peers_register_table(struct peers *, struct stktable *table);
+void peers_setup_frontend(struct proxy *fe);
 
 #if defined(USE_OPENSSL)
 static inline enum obj_type *peer_session_target(struct peer *p, struct stream *s)
@@ -54,10 +64,5 @@ static inline struct xprt_ops *peer_xprt(struct peer *p)
 }
 #endif
 
-int peers_init_sync(struct peers *peers);
-int peers_alloc_dcache(struct peers *peers);
-void peers_register_table(struct peers *, struct stktable *table);
-void peers_setup_frontend(struct proxy *fe);
-
-#endif /* _PROTO_PEERS_H */
+#endif /* _HAPROXY_PEERS_H */
 
index 0ee7b95f7481edb6705856a8de559ce82652e714..2918381db5ccfc12ee65f73241f14553ef4c4bf8 100644 (file)
@@ -32,7 +32,7 @@
 #include <haproxy/dict-t.h>
 #include <haproxy/pool-t.h>
 #include <haproxy/freq_ctr-t.h>
-#include <types/peers.h>
+#include <haproxy/peers-t.h>
 #include <haproxy/sample-t.h>
 
 /* The types of extra data we can store in a stick table */
index 6051b155ee27a147cc43b2816b6d15b181f028aa..0a0c315e59850d3a8469f43e61ed55be15e0238a 100644 (file)
@@ -52,6 +52,7 @@
 #include <haproxy/listener.h>
 #include <haproxy/mailers-t.h>
 #include <haproxy/obj_type-t.h>
+#include <haproxy/peers-t.h>
 #include <haproxy/pool.h>
 #include <haproxy/tools.h>
 #include <haproxy/time.h>
@@ -62,7 +63,6 @@
 
 #include <types/filters.h>
 #include <haproxy/global.h>
-#include <types/peers.h>
 #include <types/stats.h>
 
 #include <proto/acl.h>
@@ -75,7 +75,7 @@
 #include <haproxy/protocol.h>
 #include <proto/http_ana.h>
 #include <proto/proxy.h>
-#include <proto/peers.h>
+#include <haproxy/peers.h>
 #include <haproxy/sample.h>
 #include <proto/session.h>
 #include <proto/server.h>
index 63d2b58f7db7416f5650e2e255ab8c203e86b47e..48539fd4aa337e5acc487838566ffca68bf455d9 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -35,6 +35,7 @@
 #include <haproxy/listener.h>
 #include <haproxy/mworker-t.h>
 #include <haproxy/pattern-t.h>
+#include <haproxy/peers.h>
 #include <haproxy/sample-t.h>
 #include <haproxy/task.h>
 #include <haproxy/tools.h>
index 9b0d767de1e235b6e5cc67319534828e43b63882..bfbfa0580f6ceb74cb9930b78bd8abd8992917cc 100644 (file)
@@ -99,6 +99,7 @@
 #include <haproxy/net_helper.h>
 #include <haproxy/openssl-compat.h>
 #include <haproxy/pattern.h>
+#include <haproxy/peers.h>
 #include <haproxy/sample.h>
 #include <haproxy/regex.h>
 #include <haproxy/signal.h>
 #include <types/filters.h>
 #include <haproxy/global.h>
 #include <types/acl.h>
-#include <types/peers.h>
 
 #include <proto/acl.h>
 #include <haproxy/activity.h>
index eeedb4c705092ed1f86bdc71f82995f4cca4d20a..091a6dfb04164e7f94cf47a5da1e3a341afe3a04 100644 (file)
 #include <haproxy/list.h>
 #include <haproxy/listener.h>
 #include <haproxy/mworker.h>
+#include <haproxy/peers.h>
 #include <haproxy/signal.h>
 #include <haproxy/version.h>
 
 #include <types/cli.h>
 #include <haproxy/global.h>
-#include <types/peers.h>
 
 #include <proto/cli.h>
 #include <haproxy/fd.h>
index c1c9588a9f8a755f2d19098da19afde196f2acd3..8ffe42167f79ec82e442e73d7e031b19d010a663 100644 (file)
 #include <haproxy/frontend.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/obj_type-t.h>
+#include <haproxy/peers.h>
 #include <haproxy/task.h>
 #include <haproxy/signal.h>
 #include <haproxy/time.h>
 #include <haproxy/tools.h>
 #include <haproxy/thread.h>
 
-#include <types/peers.h>
 #include <types/stats.h>
 
 #include <proto/acl.h>
@@ -40,7 +40,6 @@
 #include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <proto/log.h>
-#include <proto/peers.h>
 #include <proto/proxy.h>
 #include <proto/session.h>
 #include <proto/stream.h>
index bb686e77ce3bf876588bee8f290d811b7ffd5338..c66927d0749bc6a98fd6cf7fe3fa6ebe50ca032b 100644 (file)
@@ -23,6 +23,7 @@
 #include <haproxy/global.h>
 #include <haproxy/listener.h>
 #include <haproxy/obj_type-t.h>
+#include <haproxy/peers.h>
 #include <haproxy/pool.h>
 #include <haproxy/task.h>
 #include <haproxy/time.h>
@@ -32,7 +33,6 @@
 
 #include <haproxy/capture-t.h>
 #include <types/cli.h>
-#include <types/peers.h>
 #include <types/stats.h>
 
 #include <proto/applet.h>
index aad4071a6049734dadd7fe687f81d8cbe0f0ef03..835b0a6ffcff61278d0b30c45bdbf6336884cae2 100644 (file)
@@ -21,6 +21,7 @@
 #include <haproxy/pool.h>
 #include <haproxy/list.h>
 #include <haproxy/net_helper.h>
+#include <haproxy/peers.h>
 #include <haproxy/task.h>
 #include <haproxy/tcp_rules.h>
 #include <haproxy/tools.h>
@@ -42,7 +43,6 @@
 #include <proto/stream.h>
 #include <proto/stream_interface.h>
 #include <proto/stick_table.h>
-#include <proto/peers.h>
 
 /* structure used to return a table key built from a sample */
 static THREAD_LOCAL struct stktable_key static_table_key;