quic.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 OPENSSL_QUIC_H
  10. # define OPENSSL_QUIC_H
  11. # pragma once
  12. # include <openssl/macros.h>
  13. # include <openssl/ssl.h>
  14. # ifndef OPENSSL_NO_QUIC
  15. # ifdef __cplusplus
  16. extern "C" {
  17. # endif
  18. /*
  19. * Method used for non-thread-assisted QUIC client operation.
  20. */
  21. __owur const SSL_METHOD *OSSL_QUIC_client_method(void);
  22. /*
  23. * Method used for thread-assisted QUIC client operation.
  24. */
  25. __owur const SSL_METHOD *OSSL_QUIC_client_thread_method(void);
  26. /*
  27. * QUIC transport error codes (RFC 9000 s. 20.1)
  28. */
  29. # define OSSL_QUIC_ERR_NO_ERROR 0x00
  30. # define OSSL_QUIC_ERR_INTERNAL_ERROR 0x01
  31. # define OSSL_QUIC_ERR_CONNECTION_REFUSED 0x02
  32. # define OSSL_QUIC_ERR_FLOW_CONTROL_ERROR 0x03
  33. # define OSSL_QUIC_ERR_STREAM_LIMIT_ERROR 0x04
  34. # define OSSL_QUIC_ERR_STREAM_STATE_ERROR 0x05
  35. # define OSSL_QUIC_ERR_FINAL_SIZE_ERROR 0x06
  36. # define OSSL_QUIC_ERR_FRAME_ENCODING_ERROR 0x07
  37. # define OSSL_QUIC_ERR_TRANSPORT_PARAMETER_ERROR 0x08
  38. # define OSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR 0x09
  39. # define OSSL_QUIC_ERR_PROTOCOL_VIOLATION 0x0A
  40. # define OSSL_QUIC_ERR_INVALID_TOKEN 0x0B
  41. # define OSSL_QUIC_ERR_APPLICATION_ERROR 0x0C
  42. # define OSSL_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED 0x0D
  43. # define OSSL_QUIC_ERR_KEY_UPDATE_ERROR 0x0E
  44. # define OSSL_QUIC_ERR_AEAD_LIMIT_REACHED 0x0F
  45. # define OSSL_QUIC_ERR_NO_VIABLE_PATH 0x10
  46. /* Inclusive range for handshake-specific errors. */
  47. # define OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN 0x0100
  48. # define OSSL_QUIC_ERR_CRYPTO_ERR_END 0x01FF
  49. # define OSSL_QUIC_ERR_CRYPTO_ERR(X) \
  50. (OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN + (X))
  51. /* Local errors. */
  52. # define OSSL_QUIC_LOCAL_ERR_IDLE_TIMEOUT \
  53. ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  54. # ifdef __cplusplus
  55. }
  56. # endif
  57. # endif /* OPENSSL_NO_QUIC */
  58. #endif