QLOG: Wiring: QUIC FIFD
authorHugo Landau <hlandau@openssl.org>
Fri, 8 Sep 2023 12:30:56 +0000 (13:30 +0100)
committerHugo Landau <hlandau@openssl.org>
Fri, 2 Feb 2024 11:49:34 +0000 (11:49 +0000)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22037)

include/internal/quic_fifd.h
include/internal/quic_txp.h
ssl/quic/quic_channel.c
ssl/quic/quic_fifd.c
ssl/quic/quic_txp.c
test/quic_fifd_test.c

index a260ec4471d14476f6bb6f5c4bd839af4cb995ff..1271bd5bc4916497ef63061562a990ecc1ebb098 100644 (file)
@@ -16,6 +16,7 @@
 # include "internal/quic_ackm.h"
 # include "internal/quic_txpim.h"
 # include "internal/quic_stream.h"
+# include "internal/qlog.h"
 
 # ifndef OPENSSL_NO_QUIC
 
@@ -45,6 +46,7 @@ struct quic_fifd_st {
     void          (*sstream_updated)(uint64_t stream_id,
                                    void *arg);
     void           *sstream_updated_arg;
+    QLOG           *qlog;
 };
 
 int ossl_quic_fifd_init(QUIC_FIFD *fifd,
@@ -69,7 +71,8 @@ int ossl_quic_fifd_init(QUIC_FIFD *fifd,
                         void *confirm_frame_arg,
                         void (*sstream_updated)(uint64_t stream_id,
                                                 void *arg),
-                        void *sstream_updated_arg);
+                        void *sstream_updated_arg,
+                        QLOG *qlog);
 
 void ossl_quic_fifd_cleanup(QUIC_FIFD *fifd); /* (no-op) */
 
index 7c00c4141939acbee8500f332dc0fd274a46d1a8..6f1debb1d996270ffee0a2ce40edfc97fd0b3127 100644 (file)
@@ -21,6 +21,7 @@
 # include "internal/quic_fc.h"
 # include "internal/bio_addr.h"
 # include "internal/time.h"
+# include "internal/qlog.h"
 
 # ifndef OPENSSL_NO_QUIC
 
@@ -49,6 +50,7 @@ typedef struct ossl_quic_tx_packetiser_args_st {
     OSSL_CC_DATA    *cc_data;   /* QUIC Congestion Controller Instance */
     OSSL_TIME       (*now)(void *arg);  /* Callback to get current time. */
     void            *now_arg;
+    QLOG            *qlog;      /* Optional QLOG instance */
 
     /*
      * Injected dependencies - crypto streams.
index 9e8f30bf1ebd6b2058954a97c5ce01f9d8d68e17..2b1838bb912b994f17776a51cb7212d0f65f048f 100644 (file)
@@ -262,6 +262,7 @@ static int ch_init(QUIC_CHANNEL *ch)
     txp_args.cc_data                = ch->cc_data;
     txp_args.now                    = get_time;
     txp_args.now_arg                = ch;
+    txp_args.qlog                   = ch_get_qlog(ch);
 
     for (pn_space = QUIC_PN_SPACE_INITIAL; pn_space < QUIC_PN_SPACE_NUM; ++pn_space) {
         ch->crypto_send[pn_space] = ossl_quic_sstream_new(INIT_CRYPTO_SEND_BUF_LEN);
index a3dd1db978a960c7c498fb499a8185764af4f808..14ae8f07baa9ad8082f5cf8c5aa299f598471979 100644 (file)
@@ -34,7 +34,8 @@ int ossl_quic_fifd_init(QUIC_FIFD *fifd,
                         void *confirm_frame_arg,
                         void (*sstream_updated)(uint64_t stream_id,
                                                 void *arg),
-                        void *sstream_updated_arg)
+                        void *sstream_updated_arg,
+                        QLOG *qlog)
 {
     if (cfq == NULL || ackm == NULL || txpim == NULL
         || get_sstream_by_id == NULL || regen_frame == NULL)
@@ -51,6 +52,7 @@ int ossl_quic_fifd_init(QUIC_FIFD *fifd,
     fifd->confirm_frame_arg     = confirm_frame_arg;
     fifd->sstream_updated       = sstream_updated;
     fifd->sstream_updated_arg   = sstream_updated_arg;
+    fifd->qlog                  = qlog;
     return 1;
 }
 
index f26f1e81a1bf6e2d3b5023a2fc1284878fb8d3a1..b18f8c0e38e344f0b7fb737735fa5dca4eb3ecb7 100644 (file)
@@ -481,7 +481,8 @@ OSSL_QUIC_TX_PACKETISER *ossl_quic_tx_packetiser_new(const OSSL_QUIC_TX_PACKETIS
                              get_sstream_by_id, txp,
                              on_regen_notify, txp,
                              on_confirm_notify, txp,
-                             on_sstream_updated, txp)) {
+                             on_sstream_updated, txp,
+                             args->qlog)) {
         OPENSSL_free(txp);
         return NULL;
     }
index 4e0f252fa48370724a41bbf04acc5bf7661aa1a0..e560e5a253ca1242281f65c416a04691b3c8e0b8 100644 (file)
@@ -338,7 +338,8 @@ static int test_fifd(int idx)
                                           get_sstream_by_id, NULL,
                                           regen_frame, NULL,
                                           confirm_frame, NULL,
-                                          sstream_updated, NULL)))
+                                          sstream_updated, NULL,
+                                          NULL)))
         goto err;
 
     for (i = 0; i < OSSL_NELEM(info.sstream); ++i)