Home | History | Annotate | Line # | Download | only in internal
quic_fifd.h revision 1.1
      1 /*
      2  * Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
      3  *
      4  * Licensed under the Apache License 2.0 (the "License").  You may not use
      5  * this file except in compliance with the License.  You can obtain a copy
      6  * in the file LICENSE in the source distribution or at
      7  * https://www.openssl.org/source/license.html
      8  */
      9 
     10 #ifndef OSSL_QUIC_FIFD_H
     11 # define OSSL_QUIC_FIFD_H
     12 
     13 # include <openssl/ssl.h>
     14 # include "internal/quic_types.h"
     15 # include "internal/quic_cfq.h"
     16 # include "internal/quic_ackm.h"
     17 # include "internal/quic_txpim.h"
     18 # include "internal/quic_stream.h"
     19 # include "internal/qlog.h"
     20 
     21 # ifndef OPENSSL_NO_QUIC
     22 
     23 /*
     24  * QUIC Frame-in-Flight Dispatcher (FIFD)
     25  * ======================================
     26  */
     27 struct quic_fifd_st {
     28     /* Internal data; use the ossl_quic_fifd functions. */
     29     QUIC_CFQ       *cfq;
     30     OSSL_ACKM      *ackm;
     31     QUIC_TXPIM     *txpim;
     32     QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id,
     33                                        uint32_t pn_space,
     34                                        void *arg);
     35     void           *get_sstream_by_id_arg;
     36     void          (*regen_frame)(uint64_t frame_type,
     37                                  uint64_t stream_id,
     38                                  QUIC_TXPIM_PKT *pkt,
     39                                  void *arg);
     40     void           *regen_frame_arg;
     41     void          (*confirm_frame)(uint64_t frame_type,
     42                                    uint64_t stream_id,
     43                                    QUIC_TXPIM_PKT *pkt,
     44                                    void *arg);
     45     void           *confirm_frame_arg;
     46     void          (*sstream_updated)(uint64_t stream_id,
     47                                    void *arg);
     48     void           *sstream_updated_arg;
     49     QLOG         *(*get_qlog_cb)(void *arg);
     50     void           *get_qlog_cb_arg;
     51 };
     52 
     53 int ossl_quic_fifd_init(QUIC_FIFD *fifd,
     54                         QUIC_CFQ *cfq,
     55                         OSSL_ACKM *ackm,
     56                         QUIC_TXPIM *txpim,
     57                         /* stream_id is UINT64_MAX for the crypto stream */
     58                         QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id,
     59                                                            uint32_t pn_space,
     60                                                            void *arg),
     61                         void *get_sstream_by_id_arg,
     62                         /* stream_id is UINT64_MAX if not applicable */
     63                         void (*regen_frame)(uint64_t frame_type,
     64                                             uint64_t stream_id,
     65                                             QUIC_TXPIM_PKT *pkt,
     66                                             void *arg),
     67                         void *regen_frame_arg,
     68                         void (*confirm_frame)(uint64_t frame_type,
     69                                              uint64_t stream_id,
     70                                              QUIC_TXPIM_PKT *pkt,
     71                                              void *arg),
     72                         void *confirm_frame_arg,
     73                         void (*sstream_updated)(uint64_t stream_id,
     74                                                 void *arg),
     75                         void *sstream_updated_arg,
     76                         QLOG *(*get_qlog_cb)(void *arg),
     77                         void *get_qlog_cb_arg);
     78 
     79 void ossl_quic_fifd_cleanup(QUIC_FIFD *fifd); /* (no-op) */
     80 
     81 int ossl_quic_fifd_pkt_commit(QUIC_FIFD *fifd, QUIC_TXPIM_PKT *pkt);
     82 
     83 void ossl_quic_fifd_set_qlog_cb(QUIC_FIFD *fifd, QLOG *(*get_qlog_cb)(void *arg),
     84                                 void *arg);
     85 
     86 # endif
     87 
     88 #endif
     89