REORG: tevt/connection: Move enums at the end of the header file

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.
This commit is contained in:
Christopher Faulet 2025-01-21 18:19:50 +01:00
parent 487d6b09f1
commit 990854ee0d

View 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 */
/*