tinydtls
0.8.1
Main Page
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
alert.h
Go to the documentation of this file.
1
/* alert.h -- DTLS alert protocol
2
*
3
* Copyright (C) 2012 Olaf Bergmann <bergmann@tzi.org>
4
*
5
* Permission is hereby granted, free of charge, to any person
6
* obtaining a copy of this software and associated documentation
7
* files (the "Software"), to deal in the Software without
8
* restriction, including without limitation the rights to use, copy,
9
* modify, merge, publish, distribute, sublicense, and/or sell copies
10
* of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be
14
* included in all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
* SOFTWARE.
24
*/
25
31
#ifndef _DTLS_ALERT_H_
32
#define _DTLS_ALERT_H_
33
34
typedef
enum
{
35
DTLS_ALERT_LEVEL_WARNING
=1,
36
DTLS_ALERT_LEVEL_FATAL
=2
37
}
dtls_alert_level_t
;
38
39
typedef
enum
{
40
DTLS_ALERT_CLOSE_NOTIFY
= 0,
/* close_notify */
41
DTLS_ALERT_UNEXPECTED_MESSAGE
= 10,
/* unexpected_message */
42
DTLS_ALERT_BAD_RECORD_MAC
= 20,
/* bad_record_mac */
43
DTLS_ALERT_RECORD_OVERFLOW
= 22,
/* record_overflow */
44
DTLS_ALERT_DECOMPRESSION_FAILURE
= 30,
/* decompression_failure */
45
DTLS_ALERT_HANDSHAKE_FAILURE
= 40,
/* handshake_failure */
46
DTLS_ALERT_BAD_CERTIFICATE
= 42,
/* bad_certificate */
47
DTLS_ALERT_UNSUPPORTED_CERTIFICATE
= 43,
/* unsupported_certificate */
48
DTLS_ALERT_CERTIFICATE_REVOKED
= 44,
/* certificate_revoked */
49
DTLS_ALERT_CERTIFICATE_EXPIRED
= 45,
/* certificate_expired */
50
DTLS_ALERT_CERTIFICATE_UNKNOWN
= 46,
/* certificate_unknown */
51
DTLS_ALERT_ILLEGAL_PARAMETER
= 47,
/* illegal_parameter */
52
DTLS_ALERT_UNKNOWN_CA
= 48,
/* unknown_ca */
53
DTLS_ALERT_ACCESS_DENIED
= 49,
/* access_denied */
54
DTLS_ALERT_DECODE_ERROR
= 50,
/* decode_error */
55
DTLS_ALERT_DECRYPT_ERROR
= 51,
/* decrypt_error */
56
DTLS_ALERT_PROTOCOL_VERSION
= 70,
/* protocol_version */
57
DTLS_ALERT_INSUFFICIENT_SECURITY
= 71,
/* insufficient_security */
58
DTLS_ALERT_INTERNAL_ERROR
= 80,
/* internal_error */
59
DTLS_ALERT_USER_CANCELED
= 90,
/* user_canceled */
60
DTLS_ALERT_NO_RENEGOTIATION
= 100,
/* no_renegotiation */
61
DTLS_ALERT_UNSUPPORTED_EXTENSION
= 110
/* unsupported_extension */
62
}
dtls_alert_t
;
63
64
#define DTLS_EVENT_CONNECT 0x01DC
65
#define DTLS_EVENT_CONNECTED 0x01DE
67
#define DTLS_EVENT_RENEGOTIATE 0x01DF
69
static inline int
70
dtls_alert_create
(
dtls_alert_level_t
level,
dtls_alert_t
desc)
71
{
72
return
-((level << 8) | desc);
73
}
74
75
static
inline
int
76
dtls_alert_fatal_create
(
dtls_alert_t
desc)
77
{
78
return
dtls_alert_create
(
DTLS_ALERT_LEVEL_FATAL
, desc);
79
}
80
81
#endif
/* _DTLS_ALERT_H_ */
DTLS_ALERT_HANDSHAKE_FAILURE
Definition:
alert.h:45
dtls_alert_fatal_create
static int dtls_alert_fatal_create(dtls_alert_t desc)
Definition:
alert.h:77
DTLS_ALERT_USER_CANCELED
Definition:
alert.h:59
DTLS_ALERT_LEVEL_FATAL
Definition:
alert.h:36
DTLS_ALERT_LEVEL_WARNING
Definition:
alert.h:35
dtls_alert_level_t
dtls_alert_level_t
Definition:
alert.h:34
DTLS_ALERT_CERTIFICATE_EXPIRED
Definition:
alert.h:49
DTLS_ALERT_CLOSE_NOTIFY
Definition:
alert.h:40
DTLS_ALERT_CERTIFICATE_UNKNOWN
Definition:
alert.h:50
DTLS_ALERT_NO_RENEGOTIATION
Definition:
alert.h:60
DTLS_ALERT_UNEXPECTED_MESSAGE
Definition:
alert.h:41
DTLS_ALERT_INTERNAL_ERROR
Definition:
alert.h:58
dtls_alert_create
static int dtls_alert_create(dtls_alert_level_t level, dtls_alert_t desc)
Definition:
alert.h:71
DTLS_ALERT_UNSUPPORTED_CERTIFICATE
Definition:
alert.h:47
DTLS_ALERT_UNKNOWN_CA
Definition:
alert.h:52
DTLS_ALERT_DECODE_ERROR
Definition:
alert.h:54
DTLS_ALERT_RECORD_OVERFLOW
Definition:
alert.h:43
DTLS_ALERT_UNSUPPORTED_EXTENSION
Definition:
alert.h:61
dtls_alert_t
dtls_alert_t
Definition:
alert.h:39
DTLS_ALERT_BAD_RECORD_MAC
Definition:
alert.h:42
DTLS_ALERT_CERTIFICATE_REVOKED
Definition:
alert.h:48
DTLS_ALERT_BAD_CERTIFICATE
Definition:
alert.h:46
DTLS_ALERT_DECRYPT_ERROR
Definition:
alert.h:55
DTLS_ALERT_PROTOCOL_VERSION
Definition:
alert.h:56
DTLS_ALERT_ACCESS_DENIED
Definition:
alert.h:53
DTLS_ALERT_DECOMPRESSION_FAILURE
Definition:
alert.h:44
DTLS_ALERT_INSUFFICIENT_SECURITY
Definition:
alert.h:57
DTLS_ALERT_ILLEGAL_PARAMETER
Definition:
alert.h:51
Generated on Wed Dec 3 2014 16:32:55 for tinydtls by
1.8.6