diff options
author | Pauli <pauli@openssl.org> | 2023-06-26 19:30:51 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2023-07-19 13:02:07 +1000 |
commit | 157c40e4d0a2c901e2dc0ee29b80a079a548d008 (patch) | |
tree | a3e6d1898633c29082ce5153f1734bee18bc2532 /include | |
parent | 7b2a3a1e9d5246fb0f2935f152d0daec715f79f9 (diff) |
remove duplicate defines, add comment
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21441)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/quic_types.h | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/include/internal/quic_types.h b/include/internal/quic_types.h index bc111fb8db..bc7c51c49a 100644 --- a/include/internal/quic_types.h +++ b/include/internal/quic_types.h @@ -18,17 +18,22 @@ # ifndef OPENSSL_NO_QUIC /* QUIC encryption levels. */ -# define QUIC_ENC_LEVEL_INITIAL 0 -# define QUIC_ENC_LEVEL_HANDSHAKE 1 -# define QUIC_ENC_LEVEL_0RTT 2 -# define QUIC_ENC_LEVEL_1RTT 3 -# define QUIC_ENC_LEVEL_NUM 4 +enum { + QUIC_ENC_LEVEL_INITIAL = 0, + QUIC_ENC_LEVEL_HANDSHAKE, + QUIC_ENC_LEVEL_0RTT, + QUIC_ENC_LEVEL_1RTT, + QUIC_ENC_LEVEL_NUM /* Must be the ultimate entry */ +}; /* QUIC packet number spaces. */ -# define QUIC_PN_SPACE_INITIAL 0 -# define QUIC_PN_SPACE_HANDSHAKE 1 -# define QUIC_PN_SPACE_APP 2 -# define QUIC_PN_SPACE_NUM 3 +enum { + QUIC_PN_SPACE_INITIAL = 0, + QUIC_PN_SPACE_HANDSHAKE, + /* New entries must go here, so that QUIC_PN_SPACE_APP is the penultimate */ + QUIC_PN_SPACE_APP, + QUIC_PN_SPACE_NUM /* Must be the ultimate entry */ +}; static ossl_unused ossl_inline uint32_t ossl_quic_enc_level_to_pn_space(uint32_t enc_level) @@ -47,12 +52,6 @@ ossl_quic_enc_level_to_pn_space(uint32_t enc_level) } } -/* QUIC packet number spaces. */ -# define QUIC_PN_SPACE_INITIAL 0 -# define QUIC_PN_SPACE_HANDSHAKE 1 -# define QUIC_PN_SPACE_APP 2 -# define QUIC_PN_SPACE_NUM 3 - /* QUIC packet number representation. */ typedef uint64_t QUIC_PN; # define QUIC_PN_INVALID UINT64_MAX |