mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-20 21:31:28 +02:00
Previous commit removed access/manipulation to QUIC CID global tree outside of quic_cid module. This ensures that proper locking is always performed. This commit finalizes this cleanup by marking CID global tree as static only to quic_cid source file. Initialization of this tree is removed from proto_quic and now performed using dedicated initcalls quic_alloc_global_cid_tree(). As a side change, complete CID global tree documentation, in particular to explain CID global tree artificial splitting and ODCID handling. Overall, the code is now clearer and safer.
45 lines
1.2 KiB
C
45 lines
1.2 KiB
C
#ifndef _HAPROXY_QUIC_CID_T_H
|
|
#define _HAPROXY_QUIC_CID_T_H
|
|
|
|
#include <import/ebtree-t.h>
|
|
#include <haproxy/quic_tp-t.h>
|
|
#include <haproxy/thread.h>
|
|
|
|
struct quic_cid_tree {
|
|
struct eb_root root;
|
|
__decl_thread(HA_RWLOCK_T lock);
|
|
};
|
|
|
|
/* QUIC connection ID maximum length for version 1. */
|
|
#define QUIC_CID_MAXLEN 20 /* bytes */
|
|
|
|
/* QUIC connection id data.
|
|
*
|
|
* This struct is used by ebmb_node structs as last member of flexible arrays.
|
|
* So do not change the order of the member of quic_cid struct.
|
|
* <data> member must be the first one.
|
|
*/
|
|
struct quic_cid {
|
|
unsigned char data[QUIC_CID_MAXLEN];
|
|
unsigned char len; /* size of QUIC CID */
|
|
};
|
|
|
|
/* QUIC connection id attached to a QUIC connection.
|
|
*
|
|
* This structure is used to match received packets DCIDs with the
|
|
* corresponding QUIC connection.
|
|
*/
|
|
struct quic_connection_id {
|
|
struct eb64_node seq_num;
|
|
uint64_t retire_prior_to;
|
|
unsigned char stateless_reset_token[QUIC_STATELESS_RESET_TOKEN_LEN];
|
|
|
|
struct ebmb_node node; /* node for receiver tree, cid.data as key */
|
|
struct quic_cid cid; /* CID data */
|
|
|
|
struct quic_conn *qc; /* QUIC connection using this CID */
|
|
uint tid; /* Attached Thread ID for the connection. */
|
|
};
|
|
|
|
#endif /* _HAPROXY_QUIC_CID_T_H */
|