mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
MINOR: quic: Implement a packet number space identification function
Implement quic_pktns_char() to identify a packet number space from a quic_conn object. Usefull only for traces.
This commit is contained in:
parent
dc6b339733
commit
411b6f73b7
@ -322,6 +322,23 @@ static inline char quic_packet_type_enc_level_char(int packet_type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return a character to identify the packet number space <pktns> of <qc> QUIC
|
||||||
|
* connection. 'I' for Initial packet number space, 'H' for Handshake packet
|
||||||
|
* space, and 'A' for Application data number space, or '-' if not found.
|
||||||
|
*/
|
||||||
|
static inline char quic_pktns_char(const struct quic_conn *qc,
|
||||||
|
const struct quic_pktns *pktns)
|
||||||
|
{
|
||||||
|
if (pktns == &qc->pktns[QUIC_TLS_PKTNS_01RTT])
|
||||||
|
return 'A';
|
||||||
|
else if (pktns == &qc->pktns[QUIC_TLS_PKTNS_HANDSHAKE])
|
||||||
|
return 'H';
|
||||||
|
else if (pktns == &qc->pktns[QUIC_TLS_PKTNS_INITIAL])
|
||||||
|
return 'I';
|
||||||
|
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
|
||||||
/* Return the TLS encryption level to be used for <packet_type>
|
/* Return the TLS encryption level to be used for <packet_type>
|
||||||
* QUIC packet type.
|
* QUIC packet type.
|
||||||
* Returns -1 if there is no TLS encryption level for <packet_type>
|
* Returns -1 if there is no TLS encryption level for <packet_type>
|
||||||
|
@ -614,9 +614,7 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace
|
|||||||
const struct list *lost_pkts = a3;
|
const struct list *lost_pkts = a3;
|
||||||
|
|
||||||
if (pktns) {
|
if (pktns) {
|
||||||
chunk_appendf(&trace_buf, " pktns=%s",
|
chunk_appendf(&trace_buf, " pktns=%c", quic_pktns_char(qc, pktns));
|
||||||
pktns == &qc->pktns[QUIC_TLS_PKTNS_INITIAL] ? "I" :
|
|
||||||
pktns == &qc->pktns[QUIC_TLS_PKTNS_01RTT] ? "01RTT": "H");
|
|
||||||
if (pktns->tx.loss_time)
|
if (pktns->tx.loss_time)
|
||||||
chunk_appendf(&trace_buf, " loss_time=%dms",
|
chunk_appendf(&trace_buf, " loss_time=%dms",
|
||||||
TICKS_TO_MS(tick_remain(now_ms, pktns->tx.loss_time)));
|
TICKS_TO_MS(tick_remain(now_ms, pktns->tx.loss_time)));
|
||||||
@ -639,9 +637,8 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace
|
|||||||
chunk_appendf(&trace_buf, " ifae_pkts=%llu",
|
chunk_appendf(&trace_buf, " ifae_pkts=%llu",
|
||||||
(unsigned long long)*ifae_pkts);
|
(unsigned long long)*ifae_pkts);
|
||||||
if (pktns) {
|
if (pktns) {
|
||||||
chunk_appendf(&trace_buf, " pktns=%s pp=%d",
|
chunk_appendf(&trace_buf, " pktns=%c pp=%d",
|
||||||
pktns == &qc->pktns[QUIC_TLS_PKTNS_INITIAL] ? "I" :
|
quic_pktns_char(qc, pktns),
|
||||||
pktns == &qc->pktns[QUIC_TLS_PKTNS_01RTT] ? "01RTT": "H",
|
|
||||||
pktns->tx.pto_probe);
|
pktns->tx.pto_probe);
|
||||||
if (mask & (QUIC_EV_CONN_STIMER|QUIC_EV_CONN_SPTO)) {
|
if (mask & (QUIC_EV_CONN_STIMER|QUIC_EV_CONN_SPTO)) {
|
||||||
if (pktns->tx.in_flight)
|
if (pktns->tx.in_flight)
|
||||||
@ -677,10 +674,9 @@ static void quic_trace(enum trace_level level, uint64_t mask, const struct trace
|
|||||||
const struct quic_frame *frm;
|
const struct quic_frame *frm;
|
||||||
if (pkt->flags & QUIC_FL_TX_PACKET_ACK)
|
if (pkt->flags & QUIC_FL_TX_PACKET_ACK)
|
||||||
chunk_appendf(&trace_buf, " ack");
|
chunk_appendf(&trace_buf, " ack");
|
||||||
chunk_appendf(&trace_buf, " pn=%lu(%s) iflen=%llu",
|
chunk_appendf(&trace_buf, " pn=%lu(%c) iflen=%llu",
|
||||||
(unsigned long)pkt->pn_node.key,
|
(unsigned long)pkt->pn_node.key,
|
||||||
pkt->pktns == &qc->pktns[QUIC_TLS_PKTNS_INITIAL] ? "I" :
|
quic_pktns_char(qc, pkt->pktns),
|
||||||
pkt->pktns == &qc->pktns[QUIC_TLS_PKTNS_01RTT] ? "01RTT": "H",
|
|
||||||
(unsigned long long)pkt->in_flight_len);
|
(unsigned long long)pkt->in_flight_len);
|
||||||
chunk_appendf(&trace_buf, " rx.bytes=%llu tx.bytes=%llu",
|
chunk_appendf(&trace_buf, " rx.bytes=%llu tx.bytes=%llu",
|
||||||
(unsigned long long)qc->rx.bytes,
|
(unsigned long long)qc->rx.bytes,
|
||||||
|
Loading…
Reference in New Issue
Block a user