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