xref: /openssl/include/internal/quic_types.h (revision fa4e92a7)
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 
10 #ifndef OSSL_QUIC_TYPES_H
11 # define OSSL_QUIC_TYPES_H
12 
13 # include <openssl/ssl.h>
14 
15 /* QUIC packet number spaces. */
16 #define QUIC_PN_SPACE_INITIAL       0
17 #define QUIC_PN_SPACE_HANDSHAKE     1
18 #define QUIC_PN_SPACE_APP           2
19 #define QUIC_PN_SPACE_NUM           3
20 
21 /* QUIC packet number representation. */
22 typedef uint64_t QUIC_PN;
23 # define QUIC_PN_INVALID            UINT64_MAX
24 
ossl_quic_pn_max(QUIC_PN a,QUIC_PN b)25 static ossl_unused ossl_inline QUIC_PN ossl_quic_pn_max(QUIC_PN a, QUIC_PN b)
26 {
27     return a > b ? a : b;
28 }
29 
ossl_quic_pn_min(QUIC_PN a,QUIC_PN b)30 static ossl_unused ossl_inline QUIC_PN ossl_quic_pn_min(QUIC_PN a, QUIC_PN b)
31 {
32     return a < b ? a : b;
33 }
34 
35 #endif
36