summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-09-08 13:32:17 +0100
committerHugo Landau <hlandau@openssl.org>2024-02-02 11:49:34 +0000
commitfaf0912a2f0ef4450f0f7082b177b1990662b809 (patch)
tree017689c35491a37c271bc2a60085b2862c324907 /ssl
parent40c835dac7e68528bfdc9322041ac93ef274c37d (diff)
QLOG: Events: Implement recovery:packet_lost
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22037)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/quic/qlog_event_helpers.c36
-rw-r--r--ssl/quic/quic_fifd.c3
2 files changed, 39 insertions, 0 deletions
diff --git a/ssl/quic/qlog_event_helpers.c b/ssl/quic/qlog_event_helpers.c
index d8deac6e02..d31a60b2f8 100644
--- a/ssl/quic/qlog_event_helpers.c
+++ b/ssl/quic/qlog_event_helpers.c
@@ -145,3 +145,39 @@ void ossl_qlog_event_connectivity_connection_closed(QLOG *qlog,
QLOG_EVENT_END()
#endif
}
+
+#ifndef OPENSSL_NO_QLOG
+static const char *quic_pkt_type_to_qlog(uint32_t pkt_type)
+{
+ switch (pkt_type) {
+ case QUIC_PKT_TYPE_INITIAL:
+ return "initial";
+ case QUIC_PKT_TYPE_HANDSHAKE:
+ return "handshake";
+ case QUIC_PKT_TYPE_0RTT:
+ return "0RTT";
+ case QUIC_PKT_TYPE_1RTT:
+ return "1RTT";
+ case QUIC_PKT_TYPE_VERSION_NEG:
+ return "version_negotiation";
+ case QUIC_PKT_TYPE_RETRY:
+ return "retry";
+ default:
+ return "unknown";
+ }
+}
+#endif
+
+void ossl_qlog_event_recovery_packet_lost(QLOG *qlog,
+ const QUIC_TXPIM_PKT *tpkt)
+{
+#ifndef OPENSSL_NO_QLOG
+ QLOG_EVENT_BEGIN(qlog, recovery, packet_lost)
+ QLOG_BEGIN("header")
+ QLOG_STR("packet_type", quic_pkt_type_to_qlog(tpkt->pkt_type));
+ if (ossl_quic_pkt_type_has_pn(tpkt->pkt_type))
+ QLOG_U64("packet_number", tpkt->ackm_pkt.pkt_num);
+ QLOG_END()
+ QLOG_EVENT_END()
+#endif
+}
diff --git a/ssl/quic/quic_fifd.c b/ssl/quic/quic_fifd.c
index 14ae8f07ba..acd836eff3 100644
--- a/ssl/quic/quic_fifd.c
+++ b/ssl/quic/quic_fifd.c
@@ -9,6 +9,7 @@
#include "internal/quic_fifd.h"
#include "internal/quic_wire.h"
+#include "internal/qlog_event_helpers.h"
DEFINE_LIST_OF(tx_history, OSSL_ACKM_TX_PKT);
@@ -119,6 +120,8 @@ static void on_lost(void *arg)
QUIC_CFQ_ITEM *cfq_item, *cfq_item_next;
int sstream_updated;
+ ossl_qlog_event_recovery_packet_lost(fifd->qlog, pkt);
+
/* STREAM and CRYPTO stream chunks, FIN and stream FC frames */
for (i = 0; i < num_chunks; ++i) {
sstream = fifd->get_sstream_by_id(chunks[i].stream_id,