2 * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
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
10 #ifndef OPENSSL_QUIC_H
11 # define OPENSSL_QUIC_H
14 # include <openssl/macros.h>
15 # include <openssl/ssl.h>
17 # ifndef OPENSSL_NO_QUIC
24 * Method used for non-thread-assisted QUIC client operation.
26 __owur const SSL_METHOD *OSSL_QUIC_client_method(void);
29 * Method used for thread-assisted QUIC client operation.
31 __owur const SSL_METHOD *OSSL_QUIC_client_thread_method(void);
34 * QUIC transport error codes (RFC 9000 s. 20.1)
36 # define OSSL_QUIC_ERR_NO_ERROR 0x00
37 # define OSSL_QUIC_ERR_INTERNAL_ERROR 0x01
38 # define OSSL_QUIC_ERR_CONNECTION_REFUSED 0x02
39 # define OSSL_QUIC_ERR_FLOW_CONTROL_ERROR 0x03
40 # define OSSL_QUIC_ERR_STREAM_LIMIT_ERROR 0x04
41 # define OSSL_QUIC_ERR_STREAM_STATE_ERROR 0x05
42 # define OSSL_QUIC_ERR_FINAL_SIZE_ERROR 0x06
43 # define OSSL_QUIC_ERR_FRAME_ENCODING_ERROR 0x07
44 # define OSSL_QUIC_ERR_TRANSPORT_PARAMETER_ERROR 0x08
45 # define OSSL_QUIC_ERR_CONNECTION_ID_LIMIT_ERROR 0x09
46 # define OSSL_QUIC_ERR_PROTOCOL_VIOLATION 0x0A
47 # define OSSL_QUIC_ERR_INVALID_TOKEN 0x0B
48 # define OSSL_QUIC_ERR_APPLICATION_ERROR 0x0C
49 # define OSSL_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED 0x0D
50 # define OSSL_QUIC_ERR_KEY_UPDATE_ERROR 0x0E
51 # define OSSL_QUIC_ERR_AEAD_LIMIT_REACHED 0x0F
52 # define OSSL_QUIC_ERR_NO_VIABLE_PATH 0x10
54 /* Inclusive range for handshake-specific errors. */
55 # define OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN 0x0100
56 # define OSSL_QUIC_ERR_CRYPTO_ERR_END 0x01FF
58 # define OSSL_QUIC_ERR_CRYPTO_ERR(X) \
59 (OSSL_QUIC_ERR_CRYPTO_ERR_BEGIN + (X))
65 # endif /* OPENSSL_NO_QUIC */