xref: /netbsd-src/crypto/external/bsd/openssl.old/dist/include/openssl/dtls1.h (revision 4724848cf0da353df257f730694b7882798e5daf)
1*4724848cSchristos /*
2*4724848cSchristos  * Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved.
3*4724848cSchristos  *
4*4724848cSchristos  * Licensed under the OpenSSL license (the "License").  You may not use
5*4724848cSchristos  * this file except in compliance with the License.  You can obtain a copy
6*4724848cSchristos  * in the file LICENSE in the source distribution or at
7*4724848cSchristos  * https://www.openssl.org/source/license.html
8*4724848cSchristos  */
9*4724848cSchristos 
10*4724848cSchristos #ifndef HEADER_DTLS1_H
11*4724848cSchristos # define HEADER_DTLS1_H
12*4724848cSchristos 
13*4724848cSchristos #ifdef  __cplusplus
14*4724848cSchristos extern "C" {
15*4724848cSchristos #endif
16*4724848cSchristos 
17*4724848cSchristos # define DTLS1_VERSION                   0xFEFF
18*4724848cSchristos # define DTLS1_2_VERSION                 0xFEFD
19*4724848cSchristos # define DTLS_MIN_VERSION                DTLS1_VERSION
20*4724848cSchristos # define DTLS_MAX_VERSION                DTLS1_2_VERSION
21*4724848cSchristos # define DTLS1_VERSION_MAJOR             0xFE
22*4724848cSchristos 
23*4724848cSchristos # define DTLS1_BAD_VER                   0x0100
24*4724848cSchristos 
25*4724848cSchristos /* Special value for method supporting multiple versions */
26*4724848cSchristos # define DTLS_ANY_VERSION                0x1FFFF
27*4724848cSchristos 
28*4724848cSchristos /* lengths of messages */
29*4724848cSchristos /*
30*4724848cSchristos  * Actually the max cookie length in DTLS is 255. But we can't change this now
31*4724848cSchristos  * due to compatibility concerns.
32*4724848cSchristos  */
33*4724848cSchristos # define DTLS1_COOKIE_LENGTH                     256
34*4724848cSchristos 
35*4724848cSchristos # define DTLS1_RT_HEADER_LENGTH                  13
36*4724848cSchristos 
37*4724848cSchristos # define DTLS1_HM_HEADER_LENGTH                  12
38*4724848cSchristos 
39*4724848cSchristos # define DTLS1_HM_BAD_FRAGMENT                   -2
40*4724848cSchristos # define DTLS1_HM_FRAGMENT_RETRY                 -3
41*4724848cSchristos 
42*4724848cSchristos # define DTLS1_CCS_HEADER_LENGTH                  1
43*4724848cSchristos 
44*4724848cSchristos # define DTLS1_AL_HEADER_LENGTH                   2
45*4724848cSchristos 
46*4724848cSchristos /* Timeout multipliers */
47*4724848cSchristos # define DTLS1_TMO_READ_COUNT                      2
48*4724848cSchristos # define DTLS1_TMO_WRITE_COUNT                     2
49*4724848cSchristos 
50*4724848cSchristos # define DTLS1_TMO_ALERT_COUNT                     12
51*4724848cSchristos 
52*4724848cSchristos #ifdef  __cplusplus
53*4724848cSchristos }
54*4724848cSchristos #endif
55*4724848cSchristos #endif
56