dtls_record.h
Go to the documentation of this file.
1 /**
2  * @file dtls_record.h
3  * @brief DTLS record protocol
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneSSL Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _DTLS_RECORD_H
30 #define _DTLS_RECORD_H
31 
32 //Dependencies
33 #include "tls.h"
34 
35 //C++ guard
36 #ifdef __cplusplus
37  extern "C" {
38 #endif
39 
40 //DTLS related functions
42  const uint8_t *data, size_t length, TlsContentType contentType);
43 
45  uint8_t **data, size_t *length, TlsContentType *contentType);
46 
47 error_t dtlsWriteRecord(TlsContext *context, const uint8_t *data,
48  size_t length, TlsContentType contentType);
49 
52 
54 
56  TlsEncryptionEngine *encryptionEngine, const DtlsHandshake *message);
57 
59  const DtlsHandshake *message);
60 
61 error_t dtlsReadDatagram(TlsContext *context, uint8_t *data,
62  size_t size, size_t *length);
63 
64 error_t dtlsTick(TlsContext *context);
65 
67 
68 //C++ guard
69 #ifdef __cplusplus
70  }
71 #endif
72 
73 #endif
TLS (Transport Layer Security)
uint16_t version
Definition: dtls_misc.h:163
error_t dtlsTick(TlsContext *context)
Manage retransmission timer.
Definition: dtls_record.c:1219
error_t dtlsWriteRecord(TlsContext *context, const uint8_t *data, size_t length, TlsContentType contentType)
Send a DTLS record.
Definition: dtls_record.c:223
uint8_t message[]
Definition: chap.h:150
__start_packed struct @59 DtlsHandshake
DTLS handshake message.
void dtlsIncSequenceNumber(DtlsSequenceNumber *seqNum)
Increment sequence number.
Definition: dtls_record.c:1272
error_t dtlsWriteProtocolData(TlsContext *context, const uint8_t *data, size_t length, TlsContentType contentType)
Write protocol data.
Definition: dtls_record.c:56
__start_packed struct @55 DtlsSequenceNumber
Sequence number.
TlsContentType
Content type.
Definition: tls.h:910
error_t dtlsReadRecord(TlsContext *context)
Receive a DTLS record.
Definition: dtls_record.c:317
Encryption engine.
Definition: tls.h:1926
error_t dtlsReassembleHandshakeMessage(TlsContext *context, const DtlsHandshake *message)
Handshake message reassembly algorithm.
Definition: dtls_record.c:1000
error_t dtlsReadProtocolData(TlsContext *context, uint8_t **data, size_t *length, TlsContentType *contentType)
Read protocol data.
Definition: dtls_record.c:126
error_t dtlsReadDatagram(TlsContext *context, uint8_t *data, size_t size, size_t *length)
Receive a datagram.
Definition: dtls_record.c:1140
error_t
Error codes.
Definition: error.h:40
DtlsSequenceNumber seqNum
Definition: dtls_misc.h:165
uint8_t data[]
Definition: dtls_misc.h:167
error_t dtlsFragmentHandshakeMessage(TlsContext *context, uint16_t version, TlsEncryptionEngine *encryptionEngine, const DtlsHandshake *message)
Handshake message fragmentation.
Definition: dtls_record.c:856
error_t dtlsSendFlight(TlsContext *context)
Send the buffered flight of messages.
Definition: dtls_record.c:695
error_t dtlsProcessRecord(TlsContext *context)
Process incoming DTLS record.
Definition: dtls_record.c:419
uint8_t length
Definition: dtls_misc.h:140
#define TlsContext
Definition: tls.h:34