quic_engine_local.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2023 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_ENGINE_LOCAL_H
  10. # define OSSL_QUIC_ENGINE_LOCAL_H
  11. # include "internal/quic_engine.h"
  12. # include "internal/quic_reactor.h"
  13. # ifndef OPENSSL_NO_QUIC
  14. /*
  15. * QUIC Engine Structure
  16. * =====================
  17. *
  18. * QUIC engine internals. It is intended that only the QUIC_ENGINE, QUIC_PORT
  19. * and QUIC_CHANNEL implementations be allowed to access this structure
  20. * directly.
  21. *
  22. * Other components should not include this header.
  23. */
  24. DECLARE_LIST_OF(port, QUIC_PORT);
  25. struct quic_engine_st {
  26. /* All objects in a QUIC event domain share the same (libctx, propq). */
  27. OSSL_LIB_CTX *libctx;
  28. const char *propq;
  29. /*
  30. * Master synchronisation mutex for the entire QUIC event domain. Used for
  31. * thread assisted mode synchronisation. We don't own this; the instantiator
  32. * of the engine passes it to us and is responsible for freeing it after
  33. * engine destruction.
  34. */
  35. CRYPTO_MUTEX *mutex;
  36. /* Callback used to get the current time. */
  37. OSSL_TIME (*now_cb)(void *arg);
  38. void *now_cb_arg;
  39. /* Asynchronous I/O reactor. */
  40. QUIC_REACTOR rtor;
  41. /* List of all child ports. */
  42. OSSL_LIST(port) port_list;
  43. /* Inhibit tick for testing purposes? */
  44. unsigned int inhibit_tick : 1;
  45. };
  46. # endif
  47. #endif