]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: include: move spoe.h to haproxy/spoe{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Jun 2020 20:35:49 +0000 (22:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:58 +0000 (10:18 +0200)
Only minor change was to make sure all defines were before the structs
in spoe-t.h, everything else went smoothly.

contrib/mod_defender/defender.c
contrib/mod_defender/spoa.c
contrib/modsecurity/modsec_wrapper.c
contrib/modsecurity/spoa.c
include/haproxy/spoe-t.h [moved from include/types/spoe.h with 98% similarity]
include/haproxy/spoe.h [moved from include/proto/spoe.h with 98% similarity]
src/flt_spoe.c

index 8bc3e9735de4804ab8bda6a838a8ab09bb7b8e12..5e759b50ab246e049b0acb8222e35e98d02cbee8 100644 (file)
 #include <haproxy/api.h>
 #include <haproxy/tools.h>
 #include <haproxy/chunk.h>
+#include <haproxy/spoe.h>
 #include <haproxy/time.h>
 
-#include <proto/spoe.h>
-
 #include <http_core.h>
 #include <http_main.h>
 #include <http_log.h>
index b4c990b4a646e8f91fab040a541b10d445dc4076..35b3dd8ab7dae0b7c80c558e7df2c5a476f3e8dc 100644 (file)
@@ -33,8 +33,7 @@
 
 #include <haproxy/list.h>
 #include <haproxy/chunk.h>
-
-#include <proto/spoe.h>
+#include <haproxy/spoe.h>
 
 #include "spoa.h"
 #include "defender.h"
index 740767454779235e70cc891d91b196b264589e4b..b5840c348de8ef9583144dfa664c4b0ae19c2ed1 100644 (file)
 #include <haproxy/global.h>
 #include <haproxy/hlua.h>
 #include <haproxy/log.h>
+#include <haproxy/spoe.h>
 #include <haproxy/time.h>
 
 #include <types/stream.h>
 
 #include <haproxy/arg.h>
-#include <proto/spoe.h>
 
 #include <api.h>
 
index b9d61ed4be6dc9f93d4fd65017cae7bc2e5009b2..2c0b5459cadc317b00b973957be7f526e29f4ed1 100644 (file)
@@ -38,8 +38,7 @@
 
 #include <haproxy/list.h>
 #include <haproxy/chunk.h>
-
-#include <proto/spoe.h>
+#include <haproxy/spoe.h>
 
 #include "spoa.h"
 #include "modsec_wrapper.h"
similarity index 98%
rename from include/types/spoe.h
rename to include/haproxy/spoe-t.h
index f3edf862ddd7394bd496f1e909e2d6befc12ca7c..9b0df17ee1a5e1c08e7ead6b915ddede7f582dd6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/types/spoe.h
+ * include/haproxy/spoe-t.h
  * Macros, variables and structures for the SPOE filter.
  *
  * Copyright (C) 2017 HAProxy Technologies, Christopher Faulet <cfaulet@haproxy.com>
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _TYPES_SPOE_H
-#define _TYPES_SPOE_H
+#ifndef _HAPROXY_SPOE_T_H
+#define _HAPROXY_SPOE_T_H
 
 #include <sys/time.h>
 
+#include <haproxy/buf-t.h>
 #include <haproxy/dynbuf-t.h>
 #include <haproxy/filters-t.h>
+#include <haproxy/freq_ctr-t.h>
 #include <haproxy/list-t.h>
 #include <haproxy/proxy-t.h>
-#include <haproxy/thread.h>
-
-#include <haproxy/freq_ctr-t.h>
 #include <haproxy/sample-t.h>
-#include <types/stream.h>
 #include <haproxy/task-t.h>
+#include <haproxy/thread-t.h>
+#include <types/stream.h>
 
 /* Type of list of messages */
 #define SPOE_MSGS_BY_EVENT 0x01
 #define SPOE_FRM_FL_FIN         0x00000001
 #define SPOE_FRM_FL_ABRT        0x00000002
 
+/* Masks to get data type or flags value */
+#define SPOE_DATA_T_MASK  0x0F
+#define SPOE_DATA_FL_MASK 0xF0
+
+/* Flags to set Boolean values */
+#define SPOE_DATA_FL_FALSE 0x00
+#define SPOE_DATA_FL_TRUE  0x10
+
 /* All possible states for a SPOE context */
 enum spoe_ctx_state {
        SPOE_CTX_ST_NONE = 0,
@@ -161,6 +169,36 @@ enum spoe_vars_scope {
        SPOE_SCOPE_RES,      /* <=> SCOPE_RES  */
 };
 
+/* Frame Types sent by HAProxy and by agents */
+enum spoe_frame_type {
+       SPOE_FRM_T_UNSET = 0,
+
+       /* Frames sent by HAProxy */
+       SPOE_FRM_T_HAPROXY_HELLO = 1,
+       SPOE_FRM_T_HAPROXY_DISCON,
+       SPOE_FRM_T_HAPROXY_NOTIFY,
+
+       /* Frames sent by the agents */
+       SPOE_FRM_T_AGENT_HELLO = 101,
+       SPOE_FRM_T_AGENT_DISCON,
+       SPOE_FRM_T_AGENT_ACK
+};
+
+/* All supported data types */
+enum spoe_data_type {
+       SPOE_DATA_T_NULL = 0,
+       SPOE_DATA_T_BOOL,
+       SPOE_DATA_T_INT32,
+       SPOE_DATA_T_UINT32,
+       SPOE_DATA_T_INT64,
+       SPOE_DATA_T_UINT64,
+       SPOE_DATA_T_IPV4,
+       SPOE_DATA_T_IPV6,
+       SPOE_DATA_T_STR,
+       SPOE_DATA_T_BIN,
+       SPOE_DATA_TYPES
+};
+
 
 /* Describe an argument that will be linked to a message. It is a sample fetch,
  * with an optional name. */
@@ -371,43 +409,4 @@ struct spoe_appctx {
        } frag_ctx; /* Info about fragmented frames, unused for unfragmented frames */
 };
 
-/* Frame Types sent by HAProxy and by agents */
-enum spoe_frame_type {
-       SPOE_FRM_T_UNSET = 0,
-
-       /* Frames sent by HAProxy */
-       SPOE_FRM_T_HAPROXY_HELLO = 1,
-       SPOE_FRM_T_HAPROXY_DISCON,
-       SPOE_FRM_T_HAPROXY_NOTIFY,
-
-       /* Frames sent by the agents */
-       SPOE_FRM_T_AGENT_HELLO = 101,
-       SPOE_FRM_T_AGENT_DISCON,
-       SPOE_FRM_T_AGENT_ACK
-};
-
-/* All supported data types */
-enum spoe_data_type {
-       SPOE_DATA_T_NULL = 0,
-       SPOE_DATA_T_BOOL,
-       SPOE_DATA_T_INT32,
-       SPOE_DATA_T_UINT32,
-       SPOE_DATA_T_INT64,
-       SPOE_DATA_T_UINT64,
-       SPOE_DATA_T_IPV4,
-       SPOE_DATA_T_IPV6,
-       SPOE_DATA_T_STR,
-       SPOE_DATA_T_BIN,
-       SPOE_DATA_TYPES
-};
-
-/* Masks to get data type or flags value */
-#define SPOE_DATA_T_MASK  0x0F
-#define SPOE_DATA_FL_MASK 0xF0
-
-/* Flags to set Boolean values */
-#define SPOE_DATA_FL_FALSE 0x00
-#define SPOE_DATA_FL_TRUE  0x10
-
-
-#endif /* _TYPES_SPOE_H */
+#endif /* _HAPROXY_SPOE_T_H */
similarity index 98%
rename from include/proto/spoe.h
rename to include/haproxy/spoe.h
index d9e90982016249f8ce8494b60271c9097a955e35..8e123e30498460ef489279f09e2ac50894116969 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/proto/spoe.h
+ * include/haproxy/spoe.h
  * Encoding/Decoding functions for the SPOE filters (and other helpers).
  *
  * Copyright (C) 2017 HAProxy Technologies, Christopher Faulet <cfaulet@haproxy.com>
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef _PROTO_SPOE_H
-#define _PROTO_SPOE_H
+#ifndef _HAPROXY_SPOE_H
+#define _HAPROXY_SPOE_H
 
+#include <haproxy/api.h>
 #include <haproxy/intops.h>
 #include <haproxy/sample-t.h>
-
-#include <types/spoe.h>
+#include <haproxy/spoe-t.h>
 
 
 /* Encode a buffer. Its length <len> is encoded as a varint, followed by a copy
@@ -348,4 +348,4 @@ spoe_decode_data(char **buf, char *end, struct sample *smp)
        return r;
 }
 
-#endif /* _PROTO_SPOE_H */
+#endif /* _HAPROXY_SPOE_H */
index ec393b20ab3922f195d807dc2874c519054ae49b..35a99c6c7c041851e8a19e8a645e38eede4892e1 100644 (file)
@@ -26,6 +26,7 @@
 #include <haproxy/pool.h>
 #include <haproxy/proxy.h>
 #include <haproxy/session.h>
+#include <haproxy/spoe.h>
 #include <haproxy/stream_interface.h>
 #include <haproxy/task.h>
 #include <haproxy/tcp_rules.h>
 
 #include <haproxy/arg-t.h>
 #include <haproxy/global.h>
-#include <types/spoe.h>
 
 #include <haproxy/arg.h>
 #include <proto/backend.h>
 #include <haproxy/freq_ctr.h>
-#include <proto/spoe.h>
 #include <proto/stream.h>
 
 #if defined(DEBUG_SPOE) || defined(DEBUG_FULL)