summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-09-08 12:21:47 +0100
committerHugo Landau <hlandau@openssl.org>2024-02-02 11:49:34 +0000
commit4cecbc5400aa2f8172865b368b41c3df50b5a64d (patch)
treec069a4dc1d7b67128127314e09cf5da175365f64 /ssl
parent2031c0e928f19d2fbdc88d4f5ac4424d700099d9 (diff)
QLOG: Events: Implement connectivity:connection_started
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/build.info1
-rw-r--r--ssl/quic/qlog_event_helpers.c23
-rw-r--r--ssl/quic/quic_channel.c4
3 files changed, 28 insertions, 0 deletions
diff --git a/ssl/quic/build.info b/ssl/quic/build.info
index ec31f25306..231e6bc4e8 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 0000000000..0cbd616096
--- /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 eb731f2c53..5b1610ee40 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;