quic_fifd.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2022 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. /*
  18. * QUIC Frame-in-Flight Dispatcher (FIFD)
  19. * ======================================
  20. */
  21. struct quic_fifd_st {
  22. /* Internal data; use the ossl_quic_fifd functions. */
  23. QUIC_CFQ *cfq;
  24. OSSL_ACKM *ackm;
  25. QUIC_TXPIM *txpim;
  26. QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id,
  27. uint32_t pn_space,
  28. void *arg);
  29. void *get_sstream_by_id_arg;
  30. void (*regen_frame)(uint64_t frame_type,
  31. uint64_t stream_id,
  32. QUIC_TXPIM_PKT *pkt,
  33. void *arg);
  34. void *regen_frame_arg;
  35. };
  36. int ossl_quic_fifd_init(QUIC_FIFD *fifd,
  37. QUIC_CFQ *cfq,
  38. OSSL_ACKM *ackm,
  39. QUIC_TXPIM *txpim,
  40. /* stream_id is UINT64_MAX for the crypto stream */
  41. QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id,
  42. uint32_t pn_space,
  43. void *arg),
  44. void *get_sstream_by_id_arg,
  45. /* stream_id is UINT64_MAX if not applicable */
  46. void (*regen_frame)(uint64_t frame_type,
  47. uint64_t stream_id,
  48. QUIC_TXPIM_PKT *pkt,
  49. void *arg),
  50. void *regen_frame_arg);
  51. void ossl_quic_fifd_cleanup(QUIC_FIFD *fifd); /* (no-op) */
  52. int ossl_quic_fifd_pkt_commit(QUIC_FIFD *fifd, QUIC_TXPIM_PKT *pkt);
  53. #endif