]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: include: move cli.h to haproxy/cli{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Jun 2020 18:19:54 +0000 (20:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:58 +0000 (10:18 +0200)
Almost no change except moving the cli_kw struct definition after the
defines. Almost all users had both types&proto included, which is not
surprizing since this code is old and it used to be the norm a decade
ago. These places were cleaned.

27 files changed:
include/haproxy/cli-t.h [moved from include/types/cli.h with 94% similarity]
include/haproxy/cli.h [moved from include/proto/cli.h with 96% similarity]
include/haproxy/listener.h
src/activity.c
src/cache.c
src/cli.c
src/debug.c
src/dns.c
src/haproxy.c
src/hlua.c
src/hlua_fcn.c
src/log.c
src/map.c
src/mworker.c
src/peers.c
src/pool.c
src/proxy.c
src/ring.c
src/server.c
src/sink.c
src/ssl_ckch.c
src/ssl_crtlist.c
src/ssl_sock.c
src/stats.c
src/stick_table.c
src/stream.c
src/trace.c

similarity index 94%
rename from include/types/cli.h
rename to include/haproxy/cli-t.h
index 710e01433c72c8702874f307f7bd7723c85fc7fc..bfa3a34a7edb7cef5c5b33f5d7ba0f26ff66a850 100644 (file)
@@ -1,7 +1,9 @@
 /*
- * include/types/cli.h
+ * include/haproxy/cli-t.h
  * This file provides structures and types for CLI.
  *
+ * 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
  * License as published by the Free Software Foundation, version 2.1
@@ -17,8 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _TYPES_CLI_H
-#define _TYPES_CLI_H
+#ifndef _HAPROXY_CLI_T_H
+#define _HAPROXY_CLI_T_H
 
 #include <haproxy/applet-t.h>
 #include <haproxy/list-t.h>
 #define APPCTX_CLI_ST1_PAYLOAD (1 << 1)
 #define APPCTX_CLI_ST1_NOLF    (1 << 2)
 
-struct cli_kw {
-       const char *str_kw[5];   /* keywords ended by NULL, limited to 5
-                                separated keywords combination */
-       const char *usage;   /* usage message */
-       int (*parse)(char **args, char *payload, struct appctx *appctx, void *private);
-       int (*io_handler)(struct appctx *appctx);
-       void (*io_release)(struct appctx *appctx);
-       void *private;
-       int level; /* this is the level needed to show the keyword usage and to use it */
-};
-
-struct cli_kw_list {
-       struct list list;
-       struct cli_kw kw[VAR_ARRAY];
-};
-
 /* CLI states */
 enum {
        CLI_ST_INIT = 0,   /* initial state, must leave to zero ! */
@@ -80,4 +66,20 @@ enum {
 };
 
 
-#endif /* _TYPES_CLI_H */
+struct cli_kw {
+       const char *str_kw[5];   /* keywords ended by NULL, limited to 5
+                                separated keywords combination */
+       const char *usage;   /* usage message */
+       int (*parse)(char **args, char *payload, struct appctx *appctx, void *private);
+       int (*io_handler)(struct appctx *appctx);
+       void (*io_release)(struct appctx *appctx);
+       void *private;
+       int level; /* this is the level needed to show the keyword usage and to use it */
+};
+
+struct cli_kw_list {
+       struct list list;
+       struct cli_kw kw[VAR_ARRAY];
+};
+
+#endif /* _HAPROXY_CLI_T_H */
similarity index 96%
rename from include/proto/cli.h
rename to include/haproxy/cli.h
index cbd3cd9d319e584096df69e5bd9db6b65b34d0e1..36bcb2b9182810ca156dd9177e67e73fa347776c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/proto/cli.h
+ * include/haproxy/cli.h
  * This file contains definitions of some primitives to dedicated to
  * statistics output.
  *
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _PROTO_CLI_H
-#define _PROTO_CLI_H
+#ifndef _HAPROXY_CLI_H
+#define _HAPROXY_CLI_H
 
 #include <haproxy/applet-t.h>
+#include <haproxy/cli-t.h>
 #include <haproxy/global.h>
 #include <types/channel.h>
-#include <types/cli.h>
 #include <types/stream.h>
 
 
@@ -96,5 +96,5 @@ static inline int cli_dynerr(struct appctx *appctx, char *err)
 }
 
 
-#endif /* _PROTO_CLI_H */
+#endif /* _HAPROXY_CLI_H */
 
index 3d3d1181bd9c8d0ba2609e6a0848beddd51bda12..c2ac75e0574820d9a1c8bbc87791607cbdc3e61e 100644 (file)
@@ -26,9 +26,9 @@
 #include <string.h>
 
 #include <haproxy/api.h>
+#include <haproxy/cli-t.h>
 #include <haproxy/list.h>
 #include <haproxy/listener-t.h>
-#include <types/cli.h>
 
 /* This function tries to temporarily disable a listener, depending on the OS
  * capabilities. Linux unbinds the listen socket after a SHUT_RD, and ignores
index 59ae4fad415c6ababd9d29f8367d5f5925ca57eb..1f2ab487d2654547720d7dd5a119e8e8f4aece0f 100644 (file)
 
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
+#include <haproxy/cli.h>
 #include <haproxy/tools.h>
 #include <haproxy/thread-t.h>
 #include <haproxy/activity-t.h>
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <haproxy/freq_ctr.h>
 #include <proto/stream_interface.h>
 
index 707a011617367b76eaf748585be79f4455201d48..138ae525d0441600f9b55cb186a50bdb9b6dbe74 100644 (file)
 
 #include <haproxy/action-t.h>
 #include <haproxy/api.h>
+#include <haproxy/cli.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/shctx.h>
 #include <import/eb32tree.h>
 #include <import/sha1.h>
 
-#include <types/cli.h>
 #include <types/filters.h>
 #include <types/proxy.h>
 
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <proto/proxy.h>
 #include <proto/filters.h>
 #include <proto/http_ana.h>
index 2a0f423b8089c733409c3fdd96149368ce9bb982..2b54dc1aadb07df39dd484aa69409e3479714b14 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -30,6 +30,7 @@
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/check.h>
+#include <haproxy/cli.h>
 #include <haproxy/dns-t.h>
 #include <haproxy/frontend.h>
 #include <haproxy/list.h>
@@ -52,7 +53,6 @@
 #include <haproxy/activity.h>
 #include <proto/backend.h>
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <haproxy/compression.h>
 #include <haproxy/fd.h>
 #include <haproxy/freq_ctr.h>
index 0726d7d66e94bd46abb4fba33651cad24d60dd76..51c84cb0d8fa5a56065d85438435a176f7e91a2e 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <haproxy/api.h>
 #include <haproxy/buf.h>
+#include <haproxy/cli.h>
 #include <haproxy/debug.h>
 #include <haproxy/hlua.h>
 #include <haproxy/task.h>
@@ -31,7 +32,6 @@
 
 #include <haproxy/global.h>
 
-#include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <proto/stream_interface.h>
 
index 036d4af3dc34c7fe0fb13ccf86369cb992a9cfe2..e54205b810e151612e33e8dfddd5b6f965d5138a 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -23,6 +23,7 @@
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/check.h>
+#include <haproxy/cli.h>
 #include <haproxy/dns.h>
 #include <haproxy/errors.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/net_helper.h>
 #include <haproxy/vars.h>
 
-#include <types/cli.h>
 #include <haproxy/global.h>
 
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <proto/http_ana.h>
 #include <proto/log.h>
index 26702a9065706f1161353cc56c992732161ef961..c717577a2d6f544a00e615033aea737bedbad44a 100644 (file)
@@ -86,6 +86,7 @@
 #include <haproxy/base64.h>
 #include <common/cfgparse.h>
 #include <haproxy/chunk.h>
+#include <haproxy/cli.h>
 #include <haproxy/connection.h>
 #include <haproxy/dns.h>
 #include <haproxy/dynbuf.h>
 #include <haproxy/vars.h>
 
 #include <haproxy/capture-t.h>
-#include <types/cli.h>
 #include <types/filters.h>
 #include <haproxy/global.h>
 
 #include <haproxy/arg.h>
 #include <proto/backend.h>
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <proto/filters.h>
 #include <proto/log.h>
index 04319bc7822db3f8c2f1eb02db8c22f361a506d3..1538739b036a0863017cd9558346d9b53de84ea2 100644 (file)
@@ -26,6 +26,7 @@
 #include <import/ebpttree.h>
 
 #include <common/cfgparse.h>
+#include <haproxy/cli.h>
 #include <haproxy/connection.h>
 #include <haproxy/http_htx.h>
 #include <haproxy/thread.h>
 #include <haproxy/tools.h>
 #include <haproxy/vars.h>
 
-#include <types/cli.h>
 #include <types/proxy.h>
 
 #include <haproxy/arg.h>
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <proto/queue.h>
 #include <proto/http_ana.h>
 #include <proto/server.h>
index c9ef840e4bfe5ea889e29e2005d0dfda30786127..c14c885ff89315cac1f4b0b56b17181d6f3963a9 100644 (file)
@@ -18,6 +18,7 @@
 #include <lua.h>
 #include <lualib.h>
 
+#include <haproxy/cli-t.h>
 #include <haproxy/hlua-t.h>
 #include <haproxy/http.h>
 #include <haproxy/net_helper.h>
@@ -25,7 +26,6 @@
 #include <haproxy/stats.h>
 #include <haproxy/time.h>
 
-#include <types/cli.h>
 #include <types/proxy.h>
 
 #include <proto/proxy.h>
index 7b5a3574bffdfa3f437d9918f4eeedbd3b86f379..fcf61b1b4504df31c1fee152b1d34b9b62730e18 100644 (file)
--- a/src/log.c
+++ b/src/log.c
 
 #include <haproxy/applet-t.h>
 #include <haproxy/api.h>
+#include <haproxy/cli.h>
 #include <haproxy/frontend.h>
 #include <haproxy/http.h>
 #include <haproxy/tools.h>
 #include <haproxy/time.h>
 #include <haproxy/version.h>
 
-#include <types/cli.h>
 #include <haproxy/global.h>
 #include <types/log.h>
 
-#include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <proto/log.h>
 #include <haproxy/ring.h>
index 65fd1edb08793d84f22bea8d88075ea099477e56..8b7cc5113ba84bd1727692db4924518058527b3a 100644 (file)
--- a/src/map.c
+++ b/src/map.c
 
 #include <haproxy/applet-t.h>
 #include <haproxy/api.h>
+#include <haproxy/cli.h>
 #include <haproxy/map.h>
 #include <haproxy/pattern.h>
 #include <haproxy/regex.h>
 #include <haproxy/stats-t.h>
 #include <haproxy/tools.h>
 
-#include <types/cli.h>
-
 #include <haproxy/arg.h>
-#include <proto/cli.h>
 #include <proto/log.h>
 #include <proto/stream_interface.h>
 #include <haproxy/sample.h>
index 091a6dfb04164e7f94cf47a5da1e3a341afe3a04..3481c19808e8723e78bf5f4a09add270dd7d57f6 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
+#include <haproxy/cli.h>
 #include <haproxy/list.h>
 #include <haproxy/listener.h>
 #include <haproxy/mworker.h>
 #include <haproxy/signal.h>
 #include <haproxy/version.h>
 
-#include <types/cli.h>
 #include <haproxy/global.h>
 
-#include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <proto/log.h>
 #include <proto/proxy.h>
index c9d57355bb7423cd5d36a723ac9fd7e3f1d3237f..030a08240cdf7ae011ab794668892bc1bfcdc7a0 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <haproxy/applet.h>
 #include <haproxy/api.h>
+#include <haproxy/cli.h>
 #include <haproxy/dict.h>
 #include <haproxy/frontend.h>
 #include <haproxy/net_helper.h>
@@ -36,7 +37,6 @@
 #include <haproxy/thread.h>
 
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <proto/log.h>
 #include <proto/proxy.h>
index e8b96a0e37018d3abe477b14a24b120e8dd49696..1e87b750f9ab2f39c951eb75813485194779ccc5 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <haproxy/applet-t.h>
 #include <haproxy/api.h>
-#include <types/cli.h>
+#include <haproxy/cli.h>
 #include <haproxy/global.h>
 
 #include <common/cfgparse.h>
@@ -25,7 +25,6 @@
 
 #include <haproxy/activity-t.h>
 
-#include <proto/cli.h>
 #include <proto/channel.h>
 #include <proto/log.h>
 #include <proto/stream_interface.h>
index 8e0f03a102ef6ca90b6ed2bbde9990090900d414..94bce71a48d256c92c06f90b59d3c8d53338e26f 100644 (file)
@@ -20,6 +20,7 @@
 #include <haproxy/applet-t.h>
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
+#include <haproxy/cli.h>
 #include <haproxy/errors.h>
 #include <haproxy/global.h>
 #include <haproxy/listener.h>
@@ -34,9 +35,7 @@
 #include <import/ebistree.h>
 
 #include <haproxy/capture-t.h>
-#include <types/cli.h>
 
-#include <proto/cli.h>
 #include <proto/backend.h>
 #include <haproxy/fd.h>
 #include <proto/filters.h>
index 323249dc3583274663ec85d77a7d4db47d25291c..cdf91859b7de912baef96238c58ed916dfd3f7c7 100644 (file)
@@ -22,8 +22,8 @@
 #include <haproxy/applet.h>
 #include <haproxy/api.h>
 #include <haproxy/buf.h>
+#include <haproxy/cli.h>
 #include <haproxy/thread.h>
-#include <proto/cli.h>
 #include <haproxy/ring.h>
 #include <proto/stream_interface.h>
 
index c4a453bf94356f1cd3dc0ff0dab36497dc764fdd..e8ed5a9af2c9ce1569cd75e8ce038343cd12dc36 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <common/cfgparse.h>
 #include <haproxy/check.h>
+#include <haproxy/cli.h>
 #include <haproxy/connection.h>
 #include <haproxy/dict-t.h>
 #include <haproxy/dns.h>
 #include <haproxy/task.h>
 #include <haproxy/time.h>
 
-#include <types/cli.h>
-#include <types/cli.h>
-
-#include <proto/cli.h>
 #include <haproxy/port_range.h>
 #include <haproxy/protocol.h>
 #include <proto/queue.h>
index c4a452dcfad3ce27a7f6f532f5b41cef951eef75..8408be7c6f09cd59073495ba0de73e9fa5cdff72 100644 (file)
 
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
+#include <haproxy/cli.h>
 #include <import/ist.h>
 #include <haproxy/list.h>
 #include <haproxy/time.h>
-#include <proto/cli.h>
 #include <proto/log.h>
 #include <haproxy/ring.h>
 #include <haproxy/signal.h>
index 5b1b4e10e86de5b250d5b7ed47257783d16f2e77..1125961e9fed978b667548e41d998428f84e6bcf 100644 (file)
@@ -22,6 +22,7 @@
 #include <sys/types.h>
 
 #include <haproxy/base64.h>
+#include <haproxy/cli.h>
 #include <haproxy/errors.h>
 #include <haproxy/ssl_ckch.h>
 #include <haproxy/ssl_utils.h>
 
 #include <import/ebsttree.h>
 
-#include <types/cli.h>
 #include <types/ssl_sock.h>
 
-#include <proto/cli.h>
 #include <proto/channel.h>
 #include <proto/ssl_sock.h>
 #include <proto/stream_interface.h>
index 9d0e1e7c5ea5d7eb8f7e5b4eae6b70a22c766b02..ab88dcb442c7b93876178231d371505870a184cb 100644 (file)
@@ -15,6 +15,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include <haproxy/cli.h>
 #include <haproxy/errors.h>
 #include <haproxy/ssl_ckch.h>
 #include <haproxy/ssl_crtlist.h>
 #include <import/ebpttree.h>
 #include <import/ebsttree.h>
 
-#include <types/cli.h>
 #include <types/ssl_sock.h>
 
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <proto/stream_interface.h>
 #include <proto/ssl_sock.h>
 
index aa983bd03b3bfbecfb847c74199d3eb65364b174..35c03a8ccd1569ce2825cd077879e0a6a8391f48 100644 (file)
@@ -46,6 +46,7 @@
 
 #include <haproxy/dynbuf.h>
 #include <haproxy/chunk.h>
+#include <haproxy/cli.h>
 #include <haproxy/connection.h>
 #include <haproxy/errors.h>
 #include <haproxy/frontend.h>
 #include <import/ebpttree.h>
 #include <import/ebsttree.h>
 
-#include <types/cli.h>
 #include <types/ssl_sock.h>
 
 #include <haproxy/arg.h>
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <haproxy/freq_ctr.h>
 #include <haproxy/proto_tcp.h>
index bc590660ad4628117b0f9a767c5f9a9b3e4efeab..e62f0e4190d0f05d26df7e66c7e4b067ce8825bd 100644 (file)
@@ -28,6 +28,7 @@
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
 #include <haproxy/check.h>
+#include <haproxy/cli.h>
 #include <haproxy/compression.h>
 #include <haproxy/debug.h>
 #include <haproxy/dns.h>
 #include <haproxy/version.h>
 #include <haproxy/base64.h>
 
-#include <types/cli.h>
-
 #include <proto/backend.h>
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <haproxy/freq_ctr.h>
 #include <proto/log.h>
index a79defc79bfc77b599c870ec5947501b693ff405..736c8098e3a1c8c8c32df878fb140151850a267f 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <haproxy/api.h>
 #include <common/cfgparse.h>
+#include <haproxy/cli.h>
 #include <haproxy/global.h>
 #include <haproxy/http_rules.h>
 #include <haproxy/pool.h>
 #include <import/ebmbtree.h>
 #include <import/ebsttree.h>
 
-#include <types/cli.h>
-
 #include <haproxy/arg.h>
-#include <proto/cli.h>
 #include <proto/log.h>
 #include <proto/http_ana.h>
 #include <haproxy/proto_tcp.h>
index e6058c5cf566c4566ace301e8d2aea59174bd0bb..5eced5b6a8d7a5e2f526ffcd58172b8000bb5f8d 100644 (file)
@@ -21,6 +21,7 @@
 #include <haproxy/capture.h>
 #include <common/cfgparse.h>
 #include <haproxy/check.h>
+#include <haproxy/cli.h>
 #include <haproxy/connection.h>
 #include <haproxy/dict.h>
 #include <haproxy/dns.h>
 #include <haproxy/tcp_rules.h>
 #include <haproxy/vars.h>
 
-#include <types/cli.h>
 #include <types/filters.h>
 
 #include <haproxy/activity.h>
 #include <haproxy/arg.h>
 #include <proto/backend.h>
 #include <proto/channel.h>
-#include <proto/cli.h>
 #include <haproxy/fd.h>
 #include <proto/filters.h>
 #include <haproxy/freq_ctr.h>
index 2c7bbb67c75648df4b4eb73c7285b4d017143c28..bb9db085ac9bdd68c398e3e5a24381febd1e860b 100644 (file)
@@ -21,9 +21,9 @@
 #include <import/ist.h>
 #include <haproxy/api.h>
 #include <haproxy/buf.h>
+#include <haproxy/cli.h>
 #include <haproxy/istbuf.h>
 #include <haproxy/list.h>
-#include <proto/cli.h>
 #include <proto/log.h>
 #include <haproxy/sink.h>
 #include <haproxy/trace.h>