]> git.kaiwu.me - haproxy.git/commitdiff
REORG: include: move vars.h to haproxy/vars{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Jun 2020 14:25:31 +0000 (16:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:58 +0000 (10:18 +0200)
A few includes (sessions.h, stream.h, api-t.h) were added for arguments
that were first declared in function prototypes.

19 files changed:
include/haproxy/arg-t.h
include/haproxy/vars-t.h [new file with mode: 0644]
include/haproxy/vars.h [new file with mode: 0644]
include/proto/vars.h [deleted file]
include/types/global.h
include/types/session.h
include/types/stream.h
include/types/vars.h [deleted file]
src/checks.c
src/dns.c
src/flt_spoe.c
src/haproxy.c
src/hlua.c
src/http_ana.c
src/sample.c
src/session.c
src/ssl_sock.c
src/stream.c
src/vars.c

index d63d60f4e82a99294e3d5b3655ab5350e742bbf0..a283eff81235a1ba506b4e8ee43b784e8ee471b9 100644 (file)
@@ -28,8 +28,8 @@
 #include <haproxy/buf-t.h>
 #include <haproxy/list-t.h>
 #include <haproxy/protobuf-t.h>
+#include <haproxy/vars-t.h>
 
-#include <types/vars.h>
 #include <types/stick_table.h>
 
 /* encoding of each arg type : up to 31 types are supported */
diff --git a/include/haproxy/vars-t.h b/include/haproxy/vars-t.h
new file mode 100644 (file)
index 0000000..0d8f337
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * include/haproxy/vars-t.h
+ * Macros and structures definitions for variables.
+ *
+ * Copyright (C) 2015 Thierry FOURNIER <tfournier@arpalert.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef _HAPROXY_VARS_T_H
+#define _HAPROXY_VARS_T_H
+
+#include <haproxy/list-t.h>
+#include <haproxy/sample-t.h>
+#include <haproxy/thread-t.h>
+
+enum vars_scope {
+       SCOPE_SESS = 0,
+       SCOPE_TXN,
+       SCOPE_REQ,
+       SCOPE_RES,
+       SCOPE_PROC,
+       SCOPE_CHECK,
+};
+
+struct vars {
+       struct list head;
+       enum vars_scope scope;
+       unsigned int size;
+       __decl_thread(HA_RWLOCK_T rwlock);
+};
+
+/* This struct describes a variable. */
+struct var_desc {
+       const char *name; /* Contains the normalized variable name. */
+       enum vars_scope scope;
+};
+
+struct var {
+       struct list l; /* Used for chaining vars. */
+       const char *name; /* Contains the variable name. */
+       struct sample_data data; /* data storage. */
+};
+
+#endif
diff --git a/include/haproxy/vars.h b/include/haproxy/vars.h
new file mode 100644 (file)
index 0000000..32172a8
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * include/haproxy/vars.h
+ * Prototypes for variables.
+ *
+ * Copyright (C) 2015 Thierry FOURNIER <tfournier@arpalert.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef _HAPROXY_VARS_H
+#define _HAPROXY_VARS_H
+
+#include <types/session.h>
+#include <types/stream.h>
+#include <haproxy/api-t.h>
+#include <haproxy/vars-t.h>
+
+void vars_init(struct vars *vars, enum vars_scope scope);
+void vars_prune(struct vars *vars, struct session *sess, struct stream *strm);
+void vars_prune_per_sess(struct vars *vars);
+int vars_get_by_name(const char *name, size_t len, struct sample *smp);
+int vars_set_by_name_ifexist(const char *name, size_t len, struct sample *smp);
+int vars_set_by_name(const char *name, size_t len, struct sample *smp);
+int vars_unset_by_name_ifexist(const char *name, size_t len, struct sample *smp);
+int vars_get_by_desc(const struct var_desc *var_desc, struct sample *smp);
+int vars_check_arg(struct arg *arg, char **err);
+
+#endif
diff --git a/include/proto/vars.h b/include/proto/vars.h
deleted file mode 100644 (file)
index 81f99df..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _PROTO_VARS_H
-#define _PROTO_VARS_H
-
-#include <types/vars.h>
-
-void vars_init(struct vars *vars, enum vars_scope scope);
-void vars_prune(struct vars *vars, struct session *sess, struct stream *strm);
-void vars_prune_per_sess(struct vars *vars);
-int vars_get_by_name(const char *name, size_t len, struct sample *smp);
-int vars_set_by_name_ifexist(const char *name, size_t len, struct sample *smp);
-int vars_set_by_name(const char *name, size_t len, struct sample *smp);
-int vars_unset_by_name_ifexist(const char *name, size_t len, struct sample *smp);
-int vars_get_by_desc(const struct var_desc *var_desc, struct sample *smp);
-int vars_check_arg(struct arg *arg, char **err);
-
-#endif
index f753660423af6852a437bba722ff389e464ad57b..56e7678a1f05b477a078c56c9fc3f5491dfdccf2 100644 (file)
 
 #include <haproxy/api-t.h>
 #include <haproxy/thread.h>
+#include <haproxy/vars-t.h>
 
 #include <haproxy/freq_ctr-t.h>
 #include <types/proxy.h>
 #include <types/task.h>
-#include <types/vars.h>
 
 #ifndef UNIX_MAX_PATH
 #define UNIX_MAX_PATH 108
index 66911f3d6932e26bcd81fba9b8b84428c5186ecc..70d10a84cdf4a86c403e6b264d3522b56f05bd39 100644 (file)
 #include <haproxy/api-t.h>
 #include <haproxy/list-t.h>
 #include <haproxy/obj_type-t.h>
+#include <haproxy/vars-t.h>
 
 #include <types/proxy.h>
 #include <types/stick_table.h>
 #include <types/task.h>
-#include <types/vars.h>
 
 struct sess_srv_list {
        void *target;
index e86b6d6141c85d60c78c2c52f3e7ac41f21d47b2..88708428c4135f17f7f47101f18f8bb545d8e444 100644 (file)
@@ -33,6 +33,7 @@
 #include <haproxy/hlua-t.h>
 #include <haproxy/list-t.h>
 #include <haproxy/obj_type-t.h>
+#include <haproxy/vars-t.h>
 
 #include <types/channel.h>
 #include <types/filters.h>
@@ -44,7 +45,6 @@
 #include <types/stream_interface.h>
 #include <types/task.h>
 #include <types/stick_table.h>
-#include <types/vars.h>
 
 /* Various Stream Flags, bits values 0x01 to 0x100 (shift 0) */
 #define SF_DIRECT      0x00000001      /* connection made on the server matching the client cookie */
diff --git a/include/types/vars.h b/include/types/vars.h
deleted file mode 100644 (file)
index d8ec71c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _TYPES_VARS_H
-#define _TYPES_VARS_H
-
-#include <haproxy/list-t.h>
-#include <haproxy/thread.h>
-
-#include <haproxy/sample-t.h>
-
-enum vars_scope {
-       SCOPE_SESS = 0,
-       SCOPE_TXN,
-       SCOPE_REQ,
-       SCOPE_RES,
-       SCOPE_PROC,
-       SCOPE_CHECK,
-};
-
-struct vars {
-       struct list head;
-       enum vars_scope scope;
-       unsigned int size;
-       __decl_thread(HA_RWLOCK_T rwlock);
-};
-
-/* This struct describes a variable. */
-struct var_desc {
-       const char *name; /* Contains the normalized variable name. */
-       enum vars_scope scope;
-};
-
-struct var {
-       struct list l; /* Used for chaining vars. */
-       const char *name; /* Contains the variable name. */
-       struct sample_data data; /* data storage. */
-};
-
-#endif
index d742969684687de829b1f8fecf88a2f977ebfbcb..0793a82a22bf2e59a03e73311e11a23530e9c396 100644 (file)
@@ -45,6 +45,7 @@
 #include <haproxy/http_htx.h>
 #include <haproxy/h1.h>
 #include <haproxy/htx.h>
+#include <haproxy/vars.h>
 
 #include <types/global.h>
 #include <types/stats.h>
@@ -64,7 +65,6 @@
 #include <proto/signal.h>
 #include <proto/stream_interface.h>
 #include <proto/task.h>
-#include <proto/vars.h>
 #include <proto/log.h>
 #include <haproxy/proto_udp.h>
 #include <proto/ssl_sock.h>
index e176b789d655e4f10feda5a5e1986db82612c3fe..a3e02e9d10215380188340d8cc495a43a163303d 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -29,6 +29,7 @@
 #include <haproxy/time.h>
 #include <haproxy/ticks.h>
 #include <haproxy/net_helper.h>
+#include <haproxy/vars.h>
 
 #include <types/applet.h>
 #include <types/cli.h>
@@ -47,7 +48,6 @@
 #include <proto/proxy.h>
 #include <proto/stream_interface.h>
 #include <proto/tcp_rules.h>
-#include <proto/vars.h>
 
 struct list dns_resolvers  = LIST_HEAD_INIT(dns_resolvers);
 struct list dns_srvrq_list = LIST_HEAD_INIT(dns_srvrq_list);
index 010dac2a5619d8e9d722e4b52c5a36a0e8658d03..6acb9f412b7485f264047983bd18dfa0beee660b 100644 (file)
@@ -21,6 +21,7 @@
 #include <haproxy/thread.h>
 #include <haproxy/pool.h>
 #include <haproxy/time.h>
+#include <haproxy/vars.h>
 
 #include <haproxy/arg-t.h>
 #include <types/global.h>
@@ -41,7 +42,6 @@
 #include <proto/stream_interface.h>
 #include <proto/task.h>
 #include <proto/tcp_rules.h>
-#include <proto/vars.h>
 
 #if defined(DEBUG_SPOE) || defined(DEBUG_FULL)
 #define SPOE_PRINTF(x...) fprintf(x)
index 60c5f65cb883d576f213c1b2699377759a347f17..5a7cbf35b456245f436b42703baadb6ac1ec4f0b 100644 (file)
 #include <common/uri_auth.h>
 #include <haproxy/version.h>
 #include <haproxy/thread.h>
+#include <haproxy/vars.h>
 
 #include <haproxy/capture-t.h>
 #include <types/cli.h>
 #include <proto/stream.h>
 #include <proto/signal.h>
 #include <proto/task.h>
-#include <proto/vars.h>
 #include <proto/ssl_sock.h>
 
 /* array of init calls for older platforms */
index 5b670c741a285198230955dd059d1aa166c589fe..fda7212bfebdd4a15eec62c4030dc4a836daaaa1 100644 (file)
@@ -39,6 +39,7 @@
 #include <haproxy/payload.h>
 #include <haproxy/sample.h>
 #include <haproxy/tools.h>
+#include <haproxy/vars.h>
 
 #include <types/cli.h>
 #include <types/proxy.h>
@@ -59,7 +60,6 @@
 #include <proto/stream_interface.h>
 #include <proto/task.h>
 #include <proto/tcp_rules.h>
-#include <proto/vars.h>
 
 /* Lua uses longjmp to perform yield or throwing errors. This
  * macro is used only for identifying the function that can
index da160980be6e3e52a2a383e6f46ac6806c72b61e..f7e59321f6bcfb9ff510a944c6eb78f8006d40ef 100644 (file)
@@ -18,6 +18,7 @@
 #include <haproxy/htx.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/regex.h>
+#include <haproxy/vars.h>
 #include <common/uri_auth.h>
 
 #include <haproxy/capture-t.h>
@@ -34,7 +35,6 @@
 #include <proto/stream.h>
 #include <proto/stream_interface.h>
 #include <proto/stats.h>
-#include <proto/vars.h>
 
 #define TRACE_SOURCE &trace_strm
 
index 8ee3407c2f8595356dd389be8e22cd41393890da..ef798341edce7d0f864d286a50a3ad69f3848520 100644 (file)
@@ -29,6 +29,7 @@
 #include <haproxy/regex.h>
 #include <haproxy/sample.h>
 #include <haproxy/tools.h>
+#include <haproxy/vars.h>
 #include <common/uri_auth.h>
 #include <haproxy/base64.h>
 
@@ -37,7 +38,6 @@
 #include <proto/proxy.h>
 #include <haproxy/sink.h>
 #include <proto/stick_table.h>
-#include <proto/vars.h>
 
 #include <import/sha1.h>
 #include <import/xxhash.h>
index f752e07ece42dcb01972e9e626ba761ee572eb63..afbcf2be17c0e7dfcbc65a925549f4c3176443b3 100644 (file)
@@ -14,6 +14,7 @@
 #include <haproxy/http.h>
 #include <haproxy/listener.h>
 #include <haproxy/pool.h>
+#include <haproxy/vars.h>
 
 #include <types/global.h>
 #include <types/session.h>
@@ -24,7 +25,6 @@
 #include <proto/session.h>
 #include <proto/stream.h>
 #include <proto/tcp_rules.h>
-#include <proto/vars.h>
 
 DECLARE_POOL(pool_head_session, "session", sizeof(struct session));
 DECLARE_POOL(pool_head_sess_srv_list, "session server list",
index b9663081bcd16cf80bade07fdfa3115436749e84..6d9d713238865e1e3cf4b4f2634d7d5dbdec6dfd 100644 (file)
@@ -59,6 +59,7 @@
 #include <haproxy/ticks.h>
 #include <haproxy/time.h>
 #include <haproxy/base64.h>
+#include <haproxy/vars.h>
 
 #include <import/ebpttree.h>
 #include <import/ebsttree.h>
@@ -85,7 +86,6 @@
 #include <proto/ssl_sock.h>
 #include <proto/stream.h>
 #include <proto/task.h>
-#include <proto/vars.h>
 
 /* ***** READ THIS before adding code here! *****
  *
index b3e71480a9f1b350a47999769efb5719e155e1b6..248dfe25a40337fb54964b79b3e56024eb3a7bae 100644 (file)
@@ -28,6 +28,7 @@
 #include <haproxy/thread.h>
 #include <haproxy/htx.h>
 #include <haproxy/pool.h>
+#include <haproxy/vars.h>
 
 #include <types/applet.h>
 #include <types/cli.h>
@@ -59,7 +60,6 @@
 #include <proto/stream_interface.h>
 #include <proto/task.h>
 #include <proto/tcp_rules.h>
-#include <proto/vars.h>
 
 DECLARE_POOL(pool_head_stream, "stream", sizeof(struct stream));
 DECLARE_POOL(pool_head_uniqueid, "uniqueid", UNIQUEID_LEN);
index f69dbbbcca0e5e0d601554c939eb0be895876212..b9aea6ad6c6ddb5347dbfb9296c4b7df76a25441 100644 (file)
@@ -6,14 +6,12 @@
 #include <haproxy/http_rules.h>
 #include <haproxy/list.h>
 #include <haproxy/sample.h>
-
-#include <types/vars.h>
+#include <haproxy/vars.h>
 
 #include <haproxy/arg.h>
 #include <proto/http_ana.h>
 #include <proto/stream.h>
 #include <proto/tcp_rules.h>
-#include <proto/vars.h>
 #include <proto/checks.h>
 
 /* This contains a pool of struct vars */