diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-09-08 14:10:06 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2024-02-02 11:49:34 +0000 |
commit | 5849dbe52e6657db0b653b93d1eb5bab34f43351 (patch) | |
tree | ad9f42fd58577e8cede8c56925eb47dfc247d673 | |
parent | fff66adfc885c3d229333e28aa2cf225d3be098c (diff) | |
download | openssl-5849dbe52e6657db0b653b93d1eb5bab34f43351.tar.gz |
QLOG: Events: Implement transport:packet_received
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22037)
-rw-r--r-- | include/internal/qlog_event_helpers.h | 8 | ||||
-rw-r--r-- | include/internal/qlog_events.h | 1 | ||||
-rw-r--r-- | ssl/quic/qlog_event_helpers.c | 14 | ||||
-rw-r--r-- | ssl/quic/quic_channel.c | 7 |
4 files changed, 30 insertions, 0 deletions
diff --git a/include/internal/qlog_event_helpers.h b/include/internal/qlog_event_helpers.h index e1a9bcf534..83defe043b 100644 --- a/include/internal/qlog_event_helpers.h +++ b/include/internal/qlog_event_helpers.h @@ -45,4 +45,12 @@ void ossl_qlog_event_transport_packet_sent(QLOG *qlog, size_t numn_iovec, uint64_t datagram_id); +/* transport:packet_received */ +void ossl_qlog_event_transport_packet_received(QLOG *qlog, + const QUIC_PKT_HDR *hdr, + QUIC_PN pn, + const OSSL_QTX_IOVEC *iovec, + size_t numn_iovec, + uint64_t datagram_id); + #endif diff --git a/include/internal/qlog_events.h b/include/internal/qlog_events.h index 06706b5952..e79b952461 100644 --- a/include/internal/qlog_events.h +++ b/include/internal/qlog_events.h @@ -11,4 +11,5 @@ QLOG_EVENT(connectivity, connection_state_updated) QLOG_EVENT(connectivity, connection_closed) QLOG_EVENT(transport, parameters_set) QLOG_EVENT(transport, packet_sent) +QLOG_EVENT(transport, packet_received) QLOG_EVENT(recovery, packet_lost) diff --git a/ssl/quic/qlog_event_helpers.c b/ssl/quic/qlog_event_helpers.c index ad2e87ff3d..16fd8ae74e 100644 --- a/ssl/quic/qlog_event_helpers.c +++ b/ssl/quic/qlog_event_helpers.c @@ -611,3 +611,17 @@ void ossl_qlog_event_transport_packet_sent(QLOG *qlog, QLOG_EVENT_END() #endif } + +void ossl_qlog_event_transport_packet_received(QLOG *qlog, + const QUIC_PKT_HDR *hdr, + QUIC_PN pn, + const OSSL_QTX_IOVEC *iovec, + size_t num_iovec, + uint64_t datagram_id) +{ +#ifndef OPENSSL_NO_QLOG + QLOG_EVENT_BEGIN(qlog, transport, packet_received) + log_packet(qlog, hdr, pn, iovec, num_iovec, datagram_id); + QLOG_EVENT_END() +#endif +} diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index 274765b731..b76f825d0e 100644 --- a/ssl/quic/quic_channel.c +++ b/ssl/quic/quic_channel.c @@ -2098,6 +2098,7 @@ static void ch_rx_handle_packet(QUIC_CHANNEL *ch, int channel_only) { uint32_t enc_level; int old_have_processed_any_pkt = ch->have_processed_any_pkt; + OSSL_QTX_IOVEC iovec; assert(ch->qrx_pkt != NULL); @@ -2184,6 +2185,12 @@ static void ch_rx_handle_packet(QUIC_CHANNEL *ch, int channel_only) return; } + iovec.buf = ch->qrx_pkt->hdr->data; + iovec.buf_len = ch->qrx_pkt->hdr->len; + ossl_qlog_event_transport_packet_received(ch_get_qlog(ch), ch->qrx_pkt->hdr, + ch->qrx_pkt->pn, &iovec, 1, + ch->qrx_pkt->datagram_id); + /* Handle incoming packet. */ switch (ch->qrx_pkt->hdr->type) { case QUIC_PKT_TYPE_RETRY: |