tinydtls
0.8.6
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
alert.h
Go to the documentation of this file.
1
/*******************************************************************************
2
*
3
* Copyright (c) 2011, 2012, 2013, 2014, 2015 Olaf Bergmann (TZI) and others.
4
* All rights reserved. This program and the accompanying materials
5
* are made available under the terms of the Eclipse Public License v1.0
6
* and Eclipse Distribution License v. 1.0 which accompanies this distribution.
7
*
8
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
9
* and the Eclipse Distribution License is available at
10
* http://www.eclipse.org/org/documents/edl-v10.php.
11
*
12
* Contributors:
13
* Olaf Bergmann - initial API and implementation
14
* Hauke Mehrtens - memory optimization, ECC integration
15
*
16
*******************************************************************************/
17
23
#ifndef _DTLS_ALERT_H_
24
#define _DTLS_ALERT_H_
25
26
typedef
enum
{
27
DTLS_ALERT_LEVEL_WARNING
=1,
28
DTLS_ALERT_LEVEL_FATAL
=2
29
}
dtls_alert_level_t
;
30
31
typedef
enum
{
32
DTLS_ALERT_CLOSE_NOTIFY
= 0,
/* close_notify */
33
DTLS_ALERT_UNEXPECTED_MESSAGE
= 10,
/* unexpected_message */
34
DTLS_ALERT_BAD_RECORD_MAC
= 20,
/* bad_record_mac */
35
DTLS_ALERT_RECORD_OVERFLOW
= 22,
/* record_overflow */
36
DTLS_ALERT_DECOMPRESSION_FAILURE
= 30,
/* decompression_failure */
37
DTLS_ALERT_HANDSHAKE_FAILURE
= 40,
/* handshake_failure */
38
DTLS_ALERT_BAD_CERTIFICATE
= 42,
/* bad_certificate */
39
DTLS_ALERT_UNSUPPORTED_CERTIFICATE
= 43,
/* unsupported_certificate */
40
DTLS_ALERT_CERTIFICATE_REVOKED
= 44,
/* certificate_revoked */
41
DTLS_ALERT_CERTIFICATE_EXPIRED
= 45,
/* certificate_expired */
42
DTLS_ALERT_CERTIFICATE_UNKNOWN
= 46,
/* certificate_unknown */
43
DTLS_ALERT_ILLEGAL_PARAMETER
= 47,
/* illegal_parameter */
44
DTLS_ALERT_UNKNOWN_CA
= 48,
/* unknown_ca */
45
DTLS_ALERT_ACCESS_DENIED
= 49,
/* access_denied */
46
DTLS_ALERT_DECODE_ERROR
= 50,
/* decode_error */
47
DTLS_ALERT_DECRYPT_ERROR
= 51,
/* decrypt_error */
48
DTLS_ALERT_PROTOCOL_VERSION
= 70,
/* protocol_version */
49
DTLS_ALERT_INSUFFICIENT_SECURITY
= 71,
/* insufficient_security */
50
DTLS_ALERT_INTERNAL_ERROR
= 80,
/* internal_error */
51
DTLS_ALERT_USER_CANCELED
= 90,
/* user_canceled */
52
DTLS_ALERT_NO_RENEGOTIATION
= 100,
/* no_renegotiation */
53
DTLS_ALERT_UNSUPPORTED_EXTENSION
= 110
/* unsupported_extension */
54
}
dtls_alert_t
;
55
56
#define DTLS_EVENT_CONNECT 0x01DC
57
#define DTLS_EVENT_CONNECTED 0x01DE
59
#define DTLS_EVENT_RENEGOTIATE 0x01DF
61
static inline int
62
dtls_alert_create
(
dtls_alert_level_t
level,
dtls_alert_t
desc)
63
{
64
return
-((level << 8) | desc);
65
}
66
67
static
inline
int
68
dtls_alert_fatal_create
(
dtls_alert_t
desc)
69
{
70
return
dtls_alert_create
(
DTLS_ALERT_LEVEL_FATAL
, desc);
71
}
72
73
#endif
/* _DTLS_ALERT_H_ */
DTLS_ALERT_HANDSHAKE_FAILURE
Definition:
alert.h:37
dtls_alert_fatal_create
static int dtls_alert_fatal_create(dtls_alert_t desc)
Definition:
alert.h:69
DTLS_ALERT_USER_CANCELED
Definition:
alert.h:51
DTLS_ALERT_LEVEL_FATAL
Definition:
alert.h:28
DTLS_ALERT_LEVEL_WARNING
Definition:
alert.h:27
dtls_alert_level_t
dtls_alert_level_t
Definition:
alert.h:26
DTLS_ALERT_CERTIFICATE_EXPIRED
Definition:
alert.h:41
DTLS_ALERT_CLOSE_NOTIFY
Definition:
alert.h:32
DTLS_ALERT_CERTIFICATE_UNKNOWN
Definition:
alert.h:42
DTLS_ALERT_NO_RENEGOTIATION
Definition:
alert.h:52
DTLS_ALERT_UNEXPECTED_MESSAGE
Definition:
alert.h:33
DTLS_ALERT_INTERNAL_ERROR
Definition:
alert.h:50
dtls_alert_create
static int dtls_alert_create(dtls_alert_level_t level, dtls_alert_t desc)
Definition:
alert.h:63
DTLS_ALERT_UNSUPPORTED_CERTIFICATE
Definition:
alert.h:39
DTLS_ALERT_UNKNOWN_CA
Definition:
alert.h:44
DTLS_ALERT_DECODE_ERROR
Definition:
alert.h:46
DTLS_ALERT_RECORD_OVERFLOW
Definition:
alert.h:35
DTLS_ALERT_UNSUPPORTED_EXTENSION
Definition:
alert.h:53
dtls_alert_t
dtls_alert_t
Definition:
alert.h:31
DTLS_ALERT_BAD_RECORD_MAC
Definition:
alert.h:34
DTLS_ALERT_CERTIFICATE_REVOKED
Definition:
alert.h:40
DTLS_ALERT_BAD_CERTIFICATE
Definition:
alert.h:38
DTLS_ALERT_DECRYPT_ERROR
Definition:
alert.h:47
DTLS_ALERT_PROTOCOL_VERSION
Definition:
alert.h:48
DTLS_ALERT_ACCESS_DENIED
Definition:
alert.h:45
DTLS_ALERT_DECOMPRESSION_FAILURE
Definition:
alert.h:36
DTLS_ALERT_INSUFFICIENT_SECURITY
Definition:
alert.h:49
DTLS_ALERT_ILLEGAL_PARAMETER
Definition:
alert.h:43
Generated on Thu Oct 31 2019 17:28:28 for tinydtls by
1.8.11