From: Hugo Landau Date: Fri, 8 Sep 2023 11:21:47 +0000 (+0100) Subject: QLOG: Events: Implement connectivity:connection_started X-Git-Tag: openssl-3.3.0-alpha1~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cecbc5400aa2f8172865b368b41c3df50b5a64d;p=thirdparty%2Fopenssl.git QLOG: Events: Implement connectivity:connection_started Reviewed-by: Matt Caswell Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/22037) --- diff --git a/include/internal/qlog_event_helpers.h b/include/internal/qlog_event_helpers.h new file mode 100644 index 00000000000..e26f4205613 --- /dev/null +++ b/include/internal/qlog_event_helpers.h @@ -0,0 +1,21 @@ +/* + * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OSSL_QLOG_EVENT_HELPERS_H +# define OSSL_QLOG_EVENT_HELPERS_H + +# include +# include "internal/qlog.h" +# include "internal/quic_types.h" + +/* connectivity:connection_started */ +void ossl_qlog_event_connectivity_connection_started(QLOG *qlog, + const QUIC_CONN_ID *init_dcid); + +#endif diff --git a/include/internal/qlog_events.h b/include/internal/qlog_events.h index efaec6cc497..d9542d9f5ad 100644 --- a/include/internal/qlog_events.h +++ b/include/internal/qlog_events.h @@ -6,3 +6,4 @@ * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +QLOG_EVENT(connectivity, connection_started) diff --git a/ssl/quic/build.info b/ssl/quic/build.info index ec31f25306f..231e6bc4e88 100644 --- a/ssl/quic/build.info +++ b/ssl/quic/build.info @@ -17,6 +17,7 @@ SOURCE[$LIBSSL]=quic_trace.c SOURCE[$LIBSSL]=quic_srtm.c quic_srt_gen.c SOURCE[$LIBSSL]=quic_lcidm.c quic_rcidm.c SOURCE[$LIBSSL]=quic_types.c +SOURCE[$LIBSSL]=qlog_event_helpers.c IF[{- !$disabled{qlog} -}] SOURCE[$LIBSSL]=json_enc.c qlog.c SHARED_SOURCE[$LIBSSL]=../../crypto/getenv.c diff --git a/ssl/quic/qlog_event_helpers.c b/ssl/quic/qlog_event_helpers.c new file mode 100644 index 00000000000..0cbd616096a --- /dev/null +++ b/ssl/quic/qlog_event_helpers.c @@ -0,0 +1,23 @@ +/* + * Copyright 2023 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include "internal/qlog_event_helpers.h" +#include "internal/common.h" +#include "internal/quic_channel.h" + +void ossl_qlog_event_connectivity_connection_started(QLOG *qlog, + const QUIC_CONN_ID *init_dcid) +{ +#ifndef OPENSSL_NO_QLOG + QLOG_EVENT_BEGIN(qlog, connectivity, connection_started) + QLOG_STR("protocol", "quic"); + QLOG_CID("dst_cid", init_dcid); + QLOG_EVENT_END() +#endif +} diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index eb731f2c531..5b1610ee408 100644 --- a/ssl/quic/quic_channel.c +++ b/ssl/quic/quic_channel.c @@ -14,6 +14,7 @@ #include "internal/quic_rx_depack.h" #include "internal/quic_lcidm.h" #include "internal/quic_srtm.h" +#include "internal/qlog_event_helpers.h" #include "../ssl_local.h" #include "quic_channel_local.h" #include "quic_port_local.h" @@ -2451,6 +2452,9 @@ int ossl_quic_channel_start(QUIC_CHANNEL *ch) ch->state = QUIC_CHANNEL_STATE_ACTIVE; ch->doing_proactive_ver_neg = 0; /* not currently supported */ + ossl_qlog_event_connectivity_connection_started(ch_get_qlog(ch), + &ch->init_dcid); + /* Handshake layer: start (e.g. send CH). */ if (!ch_tick_tls(ch, /*channel_only=*/0)) return 0;