]>
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" | |
19 | ||
6292519c HL |
20 | # ifndef OPENSSL_NO_QUIC |
21 | ||
0ede517c HL |
22 | /* |
23 | * QUIC Frame-in-Flight Dispatcher (FIFD) | |
24 | * ====================================== | |
25 | */ | |
26 | struct quic_fifd_st { | |
27 | /* Internal data; use the ossl_quic_fifd functions. */ | |
28 | QUIC_CFQ *cfq; | |
29 | OSSL_ACKM *ackm; | |
30 | QUIC_TXPIM *txpim; | |
31 | QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id, | |
a73078b7 | 32 | uint32_t pn_space, |
0ede517c HL |
33 | void *arg); |
34 | void *get_sstream_by_id_arg; | |
35 | void (*regen_frame)(uint64_t frame_type, | |
36 | uint64_t stream_id, | |
a73078b7 | 37 | QUIC_TXPIM_PKT *pkt, |
0ede517c HL |
38 | void *arg); |
39 | void *regen_frame_arg; | |
9cacba43 HL |
40 | void (*confirm_frame)(uint64_t frame_type, |
41 | uint64_t stream_id, | |
42 | QUIC_TXPIM_PKT *pkt, | |
43 | void *arg); | |
44 | void *confirm_frame_arg; | |
5d27e7e9 HL |
45 | void (*sstream_updated)(uint64_t stream_id, |
46 | void *arg); | |
47 | void *sstream_updated_arg; | |
0ede517c HL |
48 | }; |
49 | ||
50 | int ossl_quic_fifd_init(QUIC_FIFD *fifd, | |
51 | QUIC_CFQ *cfq, | |
52 | OSSL_ACKM *ackm, | |
53 | QUIC_TXPIM *txpim, | |
54 | /* stream_id is UINT64_MAX for the crypto stream */ | |
55 | QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id, | |
a73078b7 | 56 | uint32_t pn_space, |
0ede517c HL |
57 | void *arg), |
58 | void *get_sstream_by_id_arg, | |
59 | /* stream_id is UINT64_MAX if not applicable */ | |
60 | void (*regen_frame)(uint64_t frame_type, | |
61 | uint64_t stream_id, | |
a73078b7 | 62 | QUIC_TXPIM_PKT *pkt, |
0ede517c | 63 | void *arg), |
5d27e7e9 | 64 | void *regen_frame_arg, |
9cacba43 HL |
65 | void (*confirm_frame)(uint64_t frame_type, |
66 | uint64_t stream_id, | |
67 | QUIC_TXPIM_PKT *pkt, | |
68 | void *arg), | |
69 | void *confirm_frame_arg, | |
5d27e7e9 HL |
70 | void (*sstream_updated)(uint64_t stream_id, |
71 | void *arg), | |
72 | void *sstream_updated_arg); | |
0ede517c HL |
73 | |
74 | void ossl_quic_fifd_cleanup(QUIC_FIFD *fifd); /* (no-op) */ | |
75 | ||
76 | int ossl_quic_fifd_pkt_commit(QUIC_FIFD *fifd, QUIC_TXPIM_PKT *pkt); | |
77 | ||
6292519c HL |
78 | # endif |
79 | ||
0ede517c | 80 | #endif |