]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: include: move stick_table.h to haproxy/stick_table{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Jun 2020 16:46:44 +0000 (18:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:58 +0000 (10:18 +0200)
The stktable_types[] array declaration was moved to the main file as
it had nothing to do in the types. A few declarations were reordered
in the types file so that defines were before the structs. Thread-t
was added since there are a few __decl_thread(). The loss of peers.h
revealed that cfgparse-listen needed it.

22 files changed:
include/haproxy/action-t.h
include/haproxy/arg-t.h
include/haproxy/hlua-t.h
include/haproxy/peers.h
include/haproxy/sample.h
include/haproxy/stick_table-t.h [moved from include/types/stick_table.h with 96% similarity]
include/haproxy/stick_table.h [moved from include/proto/stick_table.h with 96% similarity]
include/proto/session.h
include/proto/stream.h
include/types/proxy.h
include/types/session.h
include/types/stream.h
src/acl.c
src/action.c
src/cfgparse-listen.c
src/cfgparse.c
src/hlua_fcn.c
src/peers.c
src/sample.c
src/stick_table.c
src/stream.c
src/tcp_rules.c

index 54dd63b9e02ba5b7bcf3487a14a39c95bb109d9b..9a7636674a38a1591227f17e13bba3315890d710 100644 (file)
@@ -25,7 +25,7 @@
 #include <haproxy/regex-t.h>
 
 #include <types/applet.h>
-#include <types/stick_table.h>
+#include <haproxy/stick_table-t.h>
 
 enum act_from {
        ACT_F_TCP_REQ_CON, /* tcp-request connection */
index a283eff81235a1ba506b4e8ee43b784e8ee471b9..c5a95d387e244a2e2ed103dbdfe7ad7ac462a59e 100644 (file)
@@ -30,7 +30,7 @@
 #include <haproxy/protobuf-t.h>
 #include <haproxy/vars-t.h>
 
-#include <types/stick_table.h>
+#include <haproxy/stick_table-t.h>
 
 /* encoding of each arg type : up to 31 types are supported */
 #define ARGT_BITS      5
index a49de51196e1c84bfa078b4052d37c4982c11272..0f992236ee0458961cfb5405ef4e75da5b0a19d0 100644 (file)
@@ -36,7 +36,7 @@
 #include <types/http_ana.h>
 #include <types/proxy.h>
 #include <types/server.h>
-#include <types/stick_table.h>
+#include <haproxy/stick_table-t.h>
 
 #define CLASS_CORE         "Core"
 #define CLASS_TXN          "TXN"
index 10fd8d89516e560e60b0f6f9f3b5e3f5b7d6f228..c07ee6d3359f55e6c1a46666bd571de4c694402a 100644 (file)
@@ -29,7 +29,7 @@
 #include <haproxy/time.h>
 
 #include <types/proxy.h>
-#include <types/stick_table.h>
+#include <haproxy/stick_table-t.h>
 #include <types/stream.h>
 
 extern struct peers *cfg_peers;
index 1c30fd4a43ec2ee215aa87a27c932726b54c8483..970dc1b6e8ce8a37245531584de8bfb45748a2cd 100644 (file)
@@ -26,7 +26,7 @@
 #include <haproxy/arg-t.h>
 #include <haproxy/api.h>
 #include <haproxy/sample-t.h>
-#include <types/stick_table.h>
+#include <haproxy/stick_table-t.h>
 
 extern sample_cast_fct sample_casts[SMP_TYPES][SMP_TYPES];
 extern const unsigned int fetch_cap[SMP_SRC_ENTRIES];
similarity index 96%
rename from include/types/stick_table.h
rename to include/haproxy/stick_table-t.h
index 2918381db5ccfc12ee65f73241f14553ef4c4bf8..86d8dad1fb6436d96091712bca1dff0063a427cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/types/stick_table.h
+ * include/haproxy/stick_table-t.h
  * Macros, variables and structures for stick tables management.
  *
  * Copyright (C) 2009-2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _TYPES_STICK_TABLE_H
-#define _TYPES_STICK_TABLE_H
+#ifndef _HAPROXY_STICK_TABLE_T_H
+#define _HAPROXY_STICK_TABLE_T_H
 
 #include <sys/socket.h>
 #include <netinet/in.h>
 
-#include <import/ebtree.h>
-#include <import/ebmbtree.h>
 #include <import/eb32tree.h>
-#include <haproxy/dict-t.h>
-#include <haproxy/pool-t.h>
+#include <import/ebmbtree.h>
+#include <import/ebpttree.h>
+
 #include <haproxy/freq_ctr-t.h>
-#include <haproxy/peers-t.h>
-#include <haproxy/sample-t.h>
+#include <haproxy/thread-t.h>
+#include <haproxy/api-t.h>
+
 
 /* The types of extra data we can store in a stick table */
 enum {
@@ -80,6 +80,27 @@ enum {
        ARG_T_DELAY,              /* a delay which supports time units */
 };
 
+/* stick table key type flags */
+#define STK_F_CUSTOM_KEYSIZE      0x00000001   /* this table's key size is configurable */
+
+/* WARNING: if new fields are added, they must be initialized in stream_accept()
+ * and freed in stream_free() !
+ *
+ * What's the purpose of there two macro:
+ *   - STKCTR_TRACK_BACKEND indicates that a tracking pointer was set from the backend
+ *    and thus that when a keep-alive request goes to another backend, the track
+ *    must cease.
+ *
+ *   - STKCTR_TRACK_CONTENT indicates that the tracking pointer was set in a
+ *    content-aware rule (tcp-request content or http-request) and that the
+ *    tracking has to be performed in the stream and not in the session, and
+ *    will cease for a new keep-alive request over the same connection.
+ *
+ * These values are mixed with the stksess pointer in stkctr->entry.
+ */
+#define STKCTR_TRACK_BACKEND 1
+#define STKCTR_TRACK_CONTENT 2
+
 /* stick_table extra data. This is mainly used for casting or size computation */
 union stktable_data {
        /* standard types for easy casting */
@@ -119,9 +140,6 @@ struct stktable_data_type {
        int arg_type;     /* type of optional argument, ARG_T_* */
 };
 
-/* stick table key type flags */
-#define STK_F_CUSTOM_KEYSIZE      0x00000001   /* this table's key size is configurable */
-
 /* stick table keyword type */
 struct stktable_type {
        const char *kw;           /* keyword string */
@@ -129,8 +147,6 @@ struct stktable_type {
        size_t default_size;      /* default key size */
 };
 
-extern struct stktable_type stktable_types[];
-
 /* Sticky session.
  * Any additional data related to the stuck session is installed *before*
  * stksess (with negative offsets). This allows us to run variable-sized
@@ -202,22 +218,6 @@ struct stktable_key {
        size_t key_len;                 /* data len to read in buff in case of null terminated string */
 };
 
-/* WARNING: if new fields are added, they must be initialized in stream_accept()
- * and freed in stream_free() !
- *
- * What's the purpose of there two macro:
- *   - STKCTR_TRACK_BACKEND indicates that a tracking pointer was set from the backend
- *    and thus that when a keep-alive request goes to another backend, the track
- *    must cease.
- *
- *   - STKCTR_TRACK_CONTENT indicates that the tracking pointer was set in a
- *    content-aware rule (tcp-request content or http-request) and that the
- *    tracking has to be performed in the stream and not in the session, and
- *    will cease for a new keep-alive request over the same connection.
- */
-#define STKCTR_TRACK_BACKEND 1
-#define STKCTR_TRACK_CONTENT 2
-
 /* stick counter. The <entry> member is a composite address (caddr) made of a
  * pointer to an stksess struct, and two flags among STKCTR_TRACK_* above.
  */
@@ -235,4 +235,4 @@ struct track_ctr_prm {
        } table;
 };
 
-#endif /* _TYPES_STICK_TABLE_H */
+#endif /* _HAPROXY_STICK_TABLE_T_H */
similarity index 96%
rename from include/proto/stick_table.h
rename to include/haproxy/stick_table.h
index ebc4d675441204b9894c2b9837a0e679ae769a4e..c77988f4f94db4f6f377919f539f10013eb14bd9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/proto/stick_table.h
+ * include/haproxy/stick_table.h
  * Functions for stick tables management.
  *
  * Copyright (C) 2009-2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _PROTO_STICK_TABLE_H
-#define _PROTO_STICK_TABLE_H
+#ifndef _HAPROXY_STICK_TABLE_H
+#define _HAPROXY_STICK_TABLE_H
 
+#include <haproxy/api.h>
 #include <haproxy/dict-t.h>
 #include <haproxy/errors.h>
+#include <haproxy/sample-t.h>
+#include <haproxy/stick_table-t.h>
 #include <haproxy/tools.h>
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
-#include <types/stick_table.h>
 
 extern struct stktable *stktables_list;
+extern struct stktable_type stktable_types[];
 
 #define stktable_data_size(type) (sizeof(((union stktable_data*)0)->type))
 #define stktable_data_cast(ptr, type) ((union stktable_data*)(ptr))->type
@@ -200,4 +203,4 @@ static inline void stkctr_clr_flags(struct stkctr *stkctr, unsigned int flags)
        stkctr->entry = caddr_clr_flags(stkctr->entry, flags);
 }
 
-#endif /* _PROTO_STICK_TABLE_H */
+#endif /* _HAPROXY_STICK_TABLE_H */
index 01e2d94a74867e0d736ffe844f63fb3d473bac14..45bfedb137ac187d24321add47f51be1a1862b8d 100644 (file)
@@ -29,7 +29,7 @@
 #include <haproxy/global-t.h>
 #include <types/session.h>
 
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.h>
 #include <proto/server.h>
 
 extern struct pool_head *pool_head_session;
index 9be8d4647529620b4019ec51ccd6e275af45b521..80a616b6e1732204dfb2f13788201424b5bd6bc6 100644 (file)
@@ -30,7 +30,7 @@
 #include <haproxy/freq_ctr.h>
 #include <haproxy/obj_type.h>
 #include <proto/queue.h>
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.h>
 #include <haproxy/task.h>
 #include <proto/trace.h>
 
index 5ba68c7b92eeaa6f3e199043554cc4c408f751cf..7579d8a2735c7c69c1ce3bd912466461748dd0fd 100644 (file)
@@ -46,7 +46,7 @@
 #include <types/log.h>
 #include <haproxy/sample-t.h>
 #include <types/server.h>
-#include <types/stick_table.h>
+#include <haproxy/stick_table-t.h>
 
 /* values for proxy->state */
 enum pr_state {
index 559e7864670c470c798557268daa08d35e5be726..3942d62b562c6fc05b5b6a9ea33eb4b536f68793 100644 (file)
@@ -33,7 +33,7 @@
 #include <haproxy/obj_type-t.h>
 #include <haproxy/vars-t.h>
 
-#include <types/stick_table.h>
+#include <haproxy/stick_table-t.h>
 #include <haproxy/task-t.h>
 
 struct sess_srv_list {
index e2e01db051f3f7b4a1c1a37f20f0c77ce798396d..1a99429ec81edc95b0c61b9354d3700abdb7e307 100644 (file)
@@ -44,7 +44,7 @@
 #include <types/session.h>
 #include <types/stream_interface.h>
 #include <haproxy/task-t.h>
-#include <types/stick_table.h>
+#include <haproxy/stick_table-t.h>
 
 /* Various Stream Flags, bits values 0x01 to 0x100 (shift 0) */
 #define SF_DIRECT      0x00000001      /* connection made on the server matching the client cookie */
index caa9dd15207b5599ab117d3a3b6842130292b598..c0b698550fbe2d33caddc9c60563141d94f5287f 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -29,7 +29,7 @@
 #include <proto/log.h>
 #include <proto/proxy.h>
 #include <haproxy/sample.h>
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.h>
 
 #include <import/ebsttree.h>
 
index 4889a4b16cd40deff879fb705a7b5603e78edc5e..fa3b4f7774825205224d4891b52655064a2efe5d 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <proto/log.h>
 #include <proto/proxy.h>
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.h>
 
 
 /* Find and check the target table used by an action track-sc*. This
index 943c4c811396aac31002f5687a573c6e622ecaec..51e118c4d86b1cb8de9bdfe3fdb0538d41d35d8e 100644 (file)
@@ -21,6 +21,7 @@
 #include <haproxy/http_htx.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/listener.h>
+#include <haproxy/peers.h>
 #include <haproxy/sample.h>
 #include <types/stats.h>
 
@@ -28,7 +29,7 @@
 #include <haproxy/protocol.h>
 #include <proto/proxy.h>
 #include <proto/server.h>
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.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.
index 0a0c315e59850d3a8469f43e61ed55be15e0238a..0fc9bfea278e4f37b96d9eb5da1f360a6df83221 100644 (file)
@@ -80,7 +80,7 @@
 #include <proto/session.h>
 #include <proto/server.h>
 #include <proto/stream.h>
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.h>
 #include <haproxy/tcp_rules.h>
 
 
index 36a54e4d326b07320ae1af29f72ccfc2fe48c444..48a0514f40539e9d2cecabece5541300d23f26ab 100644 (file)
@@ -32,7 +32,7 @@
 #include <proto/proxy.h>
 #include <proto/server.h>
 #include <proto/stats.h>
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.h>
 
 /* Contains the class reference of the concat object. */
 static int class_concat_ref;
index 8ffe42167f79ec82e442e73d7e031b19d010a663..45e438d8755ea76dc507e32861a5a513498e5d35 100644 (file)
@@ -43,7 +43,7 @@
 #include <proto/proxy.h>
 #include <proto/session.h>
 #include <proto/stream.h>
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.h>
 #include <proto/stream_interface.h>
 
 
index 828cf26f71421c1f68e8d6789917ae971622359c..8fd043b8e3f95820b220d89bd4f8639020d372f4 100644 (file)
@@ -37,7 +37,7 @@
 #include <proto/log.h>
 #include <proto/proxy.h>
 #include <haproxy/sink.h>
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.h>
 
 #include <import/sha1.h>
 #include <import/xxhash.h>
index 835b0a6ffcff61278d0b30c45bdbf6336884cae2..ebb903371090522606cbe6cc43d7c855c7c1f3ce 100644 (file)
@@ -42,7 +42,7 @@
 #include <haproxy/sample.h>
 #include <proto/stream.h>
 #include <proto/stream_interface.h>
-#include <proto/stick_table.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;
index 2f6ff043e3c4de1f012ad7edb358b51db43ce2c5..8a3ed6f8698ffb043e998ccfc901ff14d2f3549d 100644 (file)
@@ -58,7 +58,7 @@
 #include <proto/proxy.h>
 #include <proto/queue.h>
 #include <proto/server.h>
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.h>
 #include <proto/stream_interface.h>
 
 DECLARE_POOL(pool_head_stream, "stream", sizeof(struct stream));
index 6b51be4796b46f012bbf92227192a4e22c3b34a8..9b4977d9da486c3f75eaade3d68464f2b5df4721 100644 (file)
@@ -28,7 +28,7 @@
 #include <proto/channel.h>
 #include <proto/log.h>
 #include <proto/proxy.h>
-#include <proto/stick_table.h>
+#include <haproxy/stick_table.h>
 #include <proto/stream.h>
 #include <proto/stream_interface.h>