/*
- * 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,
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. */
} 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 */
/*
- * 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
return r;
}
-#endif /* _PROTO_SPOE_H */
+#endif /* _HAPROXY_SPOE_H */
#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)