quic_fifd.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. #ifndef OSSL_QUIC_FIFD_H
  10. # define OSSL_QUIC_FIFD_H
  11. # include <openssl/ssl.h>
  12. # include "internal/quic_types.h"
  13. # include "internal/quic_cfq.h"
  14. # include "internal/quic_ackm.h"
  15. # include "internal/quic_txpim.h"
  16. # include "internal/quic_stream.h"
  17. # include "internal/qlog.h"
  18. # ifndef OPENSSL_NO_QUIC
  19. /*
  20. * QUIC Frame-in-Flight Dispatcher (FIFD)
  21. * ======================================
  22. */
  23. struct quic_fifd_st {
  24. /* Internal data; use the ossl_quic_fifd functions. */
  25. QUIC_CFQ *cfq;
  26. OSSL_ACKM *ackm;
  27. QUIC_TXPIM *txpim;
  28. QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id,
  29. uint32_t pn_space,
  30. void *arg);
  31. void *get_sstream_by_id_arg;
  32. void (*regen_frame)(uint64_t frame_type,
  33. uint64_t stream_id,
  34. QUIC_TXPIM_PKT *pkt,
  35. void *arg);
  36. void *regen_frame_arg;
  37. void (*confirm_frame)(uint64_t frame_type,
  38. uint64_t stream_id,
  39. QUIC_TXPIM_PKT *pkt,
  40. void *arg);
  41. void *confirm_frame_arg;
  42. void (*sstream_updated)(uint64_t stream_id,
  43. void *arg);
  44. void *sstream_updated_arg;
  45. QLOG *(*get_qlog_cb)(void *arg);
  46. void *get_qlog_cb_arg;
  47. };
  48. int ossl_quic_fifd_init(QUIC_FIFD *fifd,
  49. QUIC_CFQ *cfq,
  50. OSSL_ACKM *ackm,
  51. QUIC_TXPIM *txpim,
  52. /* stream_id is UINT64_MAX for the crypto stream */
  53. QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id,
  54. uint32_t pn_space,
  55. void *arg),
  56. void *get_sstream_by_id_arg,
  57. /* stream_id is UINT64_MAX if not applicable */
  58. void (*regen_frame)(uint64_t frame_type,
  59. uint64_t stream_id,
  60. QUIC_TXPIM_PKT *pkt,
  61. void *arg),
  62. void *regen_frame_arg,
  63. void (*confirm_frame)(uint64_t frame_type,
  64. uint64_t stream_id,
  65. QUIC_TXPIM_PKT *pkt,
  66. void *arg),
  67. void *confirm_frame_arg,
  68. void (*sstream_updated)(uint64_t stream_id,
  69. void *arg),
  70. void *sstream_updated_arg,
  71. QLOG *(*get_qlog_cb)(void *arg),
  72. void *get_qlog_cb_arg);
  73. void ossl_quic_fifd_cleanup(QUIC_FIFD *fifd); /* (no-op) */
  74. int ossl_quic_fifd_pkt_commit(QUIC_FIFD *fifd, QUIC_TXPIM_PKT *pkt);
  75. void ossl_quic_fifd_set_qlog_cb(QUIC_FIFD *fifd, QLOG *(*get_qlog_cb)(void *arg),
  76. void *arg);
  77. # endif
  78. #endif