]>
Commit | Line | Data |
---|---|---|
0ede517c | 1 | /* |
da1c088f | 2 | * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved. |
0ede517c HL |
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" | |
3e528780 | 19 | # include "internal/qlog.h" |
0ede517c | 20 | |
6292519c HL |
21 | # ifndef OPENSSL_NO_QUIC |
22 | ||
0ede517c HL |
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, | |
a73078b7 | 33 | uint32_t pn_space, |
0ede517c HL |
34 | void *arg); |
35 | void *get_sstream_by_id_arg; | |
36 | void (*regen_frame)(uint64_t frame_type, | |
37 | uint64_t stream_id, | |
a73078b7 | 38 | QUIC_TXPIM_PKT *pkt, |
0ede517c HL |
39 | void *arg); |
40 | void *regen_frame_arg; | |
9cacba43 HL |
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; | |
5d27e7e9 HL |
46 | void (*sstream_updated)(uint64_t stream_id, |
47 | void *arg); | |
48 | void *sstream_updated_arg; | |
3e528780 | 49 | QLOG *qlog; |
0ede517c HL |
50 | }; |
51 | ||
52 | int ossl_quic_fifd_init(QUIC_FIFD *fifd, | |
53 | QUIC_CFQ *cfq, | |
54 | OSSL_ACKM *ackm, | |
55 | QUIC_TXPIM *txpim, | |
56 | /* stream_id is UINT64_MAX for the crypto stream */ | |
57 | QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id, | |
a73078b7 | 58 | uint32_t pn_space, |
0ede517c HL |
59 | void *arg), |
60 | void *get_sstream_by_id_arg, | |
61 | /* stream_id is UINT64_MAX if not applicable */ | |
62 | void (*regen_frame)(uint64_t frame_type, | |
63 | uint64_t stream_id, | |
a73078b7 | 64 | QUIC_TXPIM_PKT *pkt, |
0ede517c | 65 | void *arg), |
5d27e7e9 | 66 | void *regen_frame_arg, |
9cacba43 HL |
67 | void (*confirm_frame)(uint64_t frame_type, |
68 | uint64_t stream_id, | |
69 | QUIC_TXPIM_PKT *pkt, | |
70 | void *arg), | |
71 | void *confirm_frame_arg, | |
5d27e7e9 HL |
72 | void (*sstream_updated)(uint64_t stream_id, |
73 | void *arg), | |
3e528780 HL |
74 | void *sstream_updated_arg, |
75 | QLOG *qlog); | |
0ede517c HL |
76 | |
77 | void ossl_quic_fifd_cleanup(QUIC_FIFD *fifd); /* (no-op) */ | |
78 | ||
79 | int ossl_quic_fifd_pkt_commit(QUIC_FIFD *fifd, QUIC_TXPIM_PKT *pkt); | |
80 | ||
6292519c HL |
81 | # endif |
82 | ||
0ede517c | 83 | #endif |