1 #ifndef _HAPROXY_TX_T_H
2 #define _HAPROXY_TX_T_H
4 #define QUIC_MIN_CC_PKTSIZE 128
5 #define QUIC_DGRAM_HEADLEN (sizeof(uint16_t) + sizeof(void *))
6 #define QUIC_MAX_CC_BUFSIZE (2 * (QUIC_MIN_CC_PKTSIZE + QUIC_DGRAM_HEADLEN))
8 #include <import/eb64tree.h>
9 #include <haproxy/list-t.h>
11 extern struct pool_head *pool_head_quic_tx_packet;
12 extern struct pool_head *pool_head_quic_cc_buf;
14 /* Flag a sent packet as being an ack-eliciting packet. */
15 #define QUIC_FL_TX_PACKET_ACK_ELICITING (1UL << 0)
16 /* Flag a sent packet as containing a PADDING frame. */
17 #define QUIC_FL_TX_PACKET_PADDING (1UL << 1)
18 /* Flag a sent packet as being in flight. */
19 #define QUIC_FL_TX_PACKET_IN_FLIGHT (QUIC_FL_TX_PACKET_ACK_ELICITING | QUIC_FL_TX_PACKET_PADDING)
20 /* Flag a sent packet as containing a CONNECTION_CLOSE frame */
21 #define QUIC_FL_TX_PACKET_CC (1UL << 2)
22 /* Flag a sent packet as containing an ACK frame */
23 #define QUIC_FL_TX_PACKET_ACK (1UL << 3)
24 /* Flag a sent packet as being coalesced to another one in the same datagram */
25 #define QUIC_FL_TX_PACKET_COALESCED (1UL << 4)
26 /* Flag a sent packet as being probing with old data */
27 #define QUIC_FL_TX_PACKET_PROBE_WITH_OLD_DATA (1UL << 5)
29 /* Structure to store enough information about TX QUIC packets. */
30 struct quic_tx_packet {
31 /* List entry point. */
35 /* This is not the packet length but the length of outstanding data
36 * for in flight TX packet.
39 struct eb64_node pn_node;
40 /* The list of frames of this packet. */
42 /* The time this packet was sent (ms). */
43 unsigned int time_sent;
44 /* Packet number spakce. */
45 struct quic_pktns *pktns;
48 /* Reference counter */
50 /* Next packet in the same datagram */
51 struct quic_tx_packet *next;
52 /* Previous packet in the same datagram */
53 struct quic_tx_packet *prev;
54 /* Largest acknowledged packet number if this packet contains an ACK frame */
55 int64_t largest_acked_pn;
59 /* Return value for qc_build_pkt(). */
60 enum qc_build_pkt_err {
61 QC_BUILD_PKT_ERR_NONE = 0,
62 QC_BUILD_PKT_ERR_ALLOC, /* memory allocation failure */
63 QC_BUILD_PKT_ERR_ENCRYPT, /* error during encryption operation */
64 QC_BUILD_PKT_ERR_BUFROOM, /* no more room in input buf or congestion window */
67 #endif /* _HAPROXY_TX_T_H */