]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: tevt/connection: Move enums at the end of the header file
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Jan 2025 17:19:50 +0000 (18:19 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 31 Jan 2025 09:41:50 +0000 (10:41 +0100)
Enums used to report events were placed in the connection header for
conveniance. But it is not specifically related to connection. So, they are
moved at the end of the file to have a better isolation.

include/haproxy/connection-t.h

index 73d990cb64e5e83fb281398581a4bebfafaf2a66..05561d20a6fef77f4c4ad95a699833dfd9fa3435 100644 (file)
@@ -541,98 +541,6 @@ struct conn_tlv_list {
 } __attribute__((packed));
 
 
-/* Termination events logs:
- * Each event is stored on 8 bits: 4 bits bor the event location and
- * 4 bits for the event type.
- */
-
-/* Locations for termination event logs (4-bits). But only 7 locations are
- * supported because 1 bit is reserved to distinguish frontend to backend
- * events: the msb is set to 1 for backend events.
- */
-enum term_event_loc {
-       tevt_loc_fd    = 1,
-       tevt_loc_hs    = 2,
-       tevt_loc_xprt  = 3,
-       tevt_loc_muxc  = 4,
-       tevt_loc_se    = 5,
-       tevt_loc_strm  = 6,
-};
-
-/* Types for termination event logs (4-bits) per location */
-enum fd_term_event_type {
-       fd_tevt_type_shutw       = 1,
-       fd_tevt_type_shutr       = 2,
-       fd_tevt_type_rcv_err     = 3,
-       fd_tevt_type_snd_err     = 4,
-       /* unused: 5, 6 */
-       fd_tevt_type_connect_err = 7,
-       fd_tevt_type_intercepted = 8,
-};
-
-enum hs_term_event_type {
-       /* unused: 1, 2, 3 */
-       hs_tevt_type_snd_err           = 4,
-       hs_tevt_type_truncated_shutr   = 5,
-       hs_tevt_type_truncated_rcv_err = 6,
-};
-
-enum xprt_term_event_type {
-       xprt_tevt_type_shutw   = 1,
-       xprt_tevt_type_shutr   = 2,
-       xprt_tevt_type_rcv_err = 3,
-       xprt_tevt_type_snd_err = 4,
-};
-
-enum muxc_term_event_type {
-       muxc_tevt_type_shutw            =  1,
-       muxc_tevt_type_shutr            =  2,
-       muxc_tevt_type_rcv_err          =  3,
-       muxc_tevt_type_snd_err          =  4,
-       muxc_tevt_type_truncated_shutr  =  5,
-       muxc_tevt_type_truncated_rcv_err=  6,
-
-       muxc_tevt_type_tout             =  7,
-       muxc_tevt_type_goaway_rcvd      =  8,
-       muxc_tevt_type_proto_err        =  9,
-       muxc_tevt_type_internal_err     = 10,
-       muxc_tevt_type_other_err        = 11,
-       muxc_tevt_type_graceful_shut    = 12,
-
-};
-
-enum se_term_event_type {
-       se_tevt_type_shutw            =  1,
-       se_tevt_type_eos              =  2,
-       se_tevt_type_rcv_err          =  3,
-       se_tevt_type_snd_err          =  4,
-       se_tevt_type_truncated_eos    =  5,
-       se_tevt_type_truncated_rcv_err=  6,
-       /* unused: 7 */
-       se_tevt_type_rst_rcvd         =  8,
-       se_tevt_type_proto_err        =  9,
-       se_tevt_type_internal_err     = 10,
-       se_tevt_type_other_err        = 11,
-       se_tevt_type_cancelled        = 12,
-};
-
-enum strm_term_event_type {
-       strm_tevt_type_shutw            =  1,
-       strm_tevt_type_eos              =  2,
-       strm_tevt_type_rcv_err          =  3,
-       strm_tevt_type_snd_err          =  4,
-       strm_tevt_type_truncated_eos    =  5,
-       strm_tevt_type_truncated_rcv_err=  6,
-
-       strm_tevt_type_tout             =  7,
-       strm_tevt_type_intercepted      =  8,
-
-       strm_tevt_type_proto_err        =  9,
-       strm_tevt_type_internal_err     = 10,
-       strm_tevt_type_other_err        = 11,
-       strm_tevt_type_aborted          = 12,
-};
-
 /* This structure describes a connection with its methods and data.
  * A connection may be performed to proxy or server via a local or remote
  * socket, and can also be made to an internal applet. It can support
@@ -827,6 +735,98 @@ struct idle_conns {
        __decl_thread(HA_SPINLOCK_T idle_conns_lock);
 } THREAD_ALIGNED(64);
 
+
+/* Termination events logs:
+ * Each event is stored on 8 bits: 4 bits bor the event location and
+ * 4 bits for the event type.
+ */
+
+/* Locations for termination event logs (4-bits). But only 7 locations are
+ * supported because 1 bit is reserved to distinguish frontend to backend
+ * events: the msb is set to 1 for backend events.
+ */
+enum term_event_loc {
+       tevt_loc_fd    = 1,
+       tevt_loc_hs    = 2,
+       tevt_loc_xprt  = 3,
+       tevt_loc_muxc  = 4,
+       tevt_loc_se    = 5,
+       tevt_loc_strm  = 6,
+};
+
+/* Types for termination event logs (4-bits) per location */
+enum fd_term_event_type {
+       fd_tevt_type_shutw       = 1,
+       fd_tevt_type_shutr       = 2,
+       fd_tevt_type_rcv_err     = 3,
+       fd_tevt_type_snd_err     = 4,
+       /* unused: 5, 6 */
+       fd_tevt_type_connect_err = 7,
+       fd_tevt_type_intercepted = 8,
+};
+
+enum hs_term_event_type {
+       /* unused: 1, 2, 3 */
+       hs_tevt_type_snd_err           = 4,
+       hs_tevt_type_truncated_shutr   = 5,
+       hs_tevt_type_truncated_rcv_err = 6,
+};
+
+enum xprt_term_event_type {
+       xprt_tevt_type_shutw   = 1,
+       xprt_tevt_type_shutr   = 2,
+       xprt_tevt_type_rcv_err = 3,
+       xprt_tevt_type_snd_err = 4,
+};
+
+enum muxc_term_event_type {
+       muxc_tevt_type_shutw            =  1,
+       muxc_tevt_type_shutr            =  2,
+       muxc_tevt_type_rcv_err          =  3,
+       muxc_tevt_type_snd_err          =  4,
+       muxc_tevt_type_truncated_shutr  =  5,
+       muxc_tevt_type_truncated_rcv_err=  6,
+
+       muxc_tevt_type_tout             =  7,
+       muxc_tevt_type_goaway_rcvd      =  8,
+       muxc_tevt_type_proto_err        =  9,
+       muxc_tevt_type_internal_err     = 10,
+       muxc_tevt_type_other_err        = 11,
+       muxc_tevt_type_graceful_shut    = 12,
+};
+
+enum se_term_event_type {
+       se_tevt_type_shutw            =  1,
+       se_tevt_type_eos              =  2,
+       se_tevt_type_rcv_err          =  3,
+       se_tevt_type_snd_err          =  4,
+       se_tevt_type_truncated_eos    =  5,
+       se_tevt_type_truncated_rcv_err=  6,
+       /* unused: 7 */
+       se_tevt_type_rst_rcvd         =  8,
+       se_tevt_type_proto_err        =  9,
+       se_tevt_type_internal_err     = 10,
+       se_tevt_type_other_err        = 11,
+       se_tevt_type_cancelled        = 12,
+};
+
+enum strm_term_event_type {
+       strm_tevt_type_shutw            =  1,
+       strm_tevt_type_eos              =  2,
+       strm_tevt_type_rcv_err          =  3,
+       strm_tevt_type_snd_err          =  4,
+       strm_tevt_type_truncated_eos    =  5,
+       strm_tevt_type_truncated_rcv_err=  6,
+
+       strm_tevt_type_tout             =  7,
+       strm_tevt_type_intercepted      =  8,
+
+       strm_tevt_type_proto_err        =  9,
+       strm_tevt_type_internal_err     = 10,
+       strm_tevt_type_other_err        = 11,
+       strm_tevt_type_aborted          = 12,
+};
+
 #endif /* _HAPROXY_CONNECTION_T_H */
 
 /*