DTLS record protocol. More...
#include "tls.h"
#include "tls_common.h"
#include "tls_record.h"
#include "tls_record_encryption.h"
#include "tls_record_decryption.h"
#include "tls_misc.h"
#include "dtls_misc.h"
#include "dtls_record.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL TLS_TRACE_LEVEL |
Functions | |
error_t | dtlsWriteProtocolData (TlsContext *context, const uint8_t *data, size_t length, TlsContentType contentType) |
Write protocol data. More... | |
error_t | dtlsReadProtocolData (TlsContext *context, uint8_t **data, size_t *length, TlsContentType *contentType) |
Read protocol data. More... | |
error_t | dtlsWriteRecord (TlsContext *context, const uint8_t *data, size_t length, TlsContentType contentType) |
Send a DTLS record. More... | |
error_t | dtlsReadRecord (TlsContext *context) |
Receive a DTLS record. More... | |
error_t | dtlsProcessRecord (TlsContext *context) |
Process incoming DTLS record. More... | |
error_t | dtlsSendFlight (TlsContext *context) |
Send the buffered flight of messages. More... | |
error_t | dtlsFragmentHandshakeMessage (TlsContext *context, uint16_t version, TlsEncryptionEngine *encryptionEngine, const DtlsHandshake *message) |
Handshake message fragmentation. More... | |
error_t | dtlsReassembleHandshakeMessage (TlsContext *context, const DtlsHandshake *message) |
Handshake message reassembly algorithm. More... | |
error_t | dtlsReadDatagram (TlsContext *context, uint8_t *data, size_t size, size_t *length) |
Receive a datagram. More... | |
error_t | dtlsTick (TlsContext *context) |
Manage retransmission timer. More... | |
void | dtlsIncSequenceNumber (DtlsSequenceNumber *seqNum) |
Increment sequence number. More... | |
Detailed Description
DTLS record protocol.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneSSL Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file dtls_record.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL TLS_TRACE_LEVEL |
Definition at line 32 of file dtls_record.c.
Function Documentation
◆ dtlsFragmentHandshakeMessage()
error_t dtlsFragmentHandshakeMessage | ( | TlsContext * | context, |
uint16_t | version, | ||
TlsEncryptionEngine * | encryptionEngine, | ||
const DtlsHandshake * | message | ||
) |
Handshake message fragmentation.
- Parameters
-
[in] context Pointer to the TLS context [in] version DTLS version to be used [in] encryptionEngine Pointer to the encryption engine [in] message Pointer the handshake message to be fragmented
- Returns
- Error code
Definition at line 892 of file dtls_record.c.
◆ dtlsIncSequenceNumber()
void dtlsIncSequenceNumber | ( | DtlsSequenceNumber * | seqNum | ) |
Increment sequence number.
- Parameters
-
[in,out] seqNum Pointer to the 48-bit sequence number
Definition at line 1309 of file dtls_record.c.
◆ dtlsProcessRecord()
error_t dtlsProcessRecord | ( | TlsContext * | context | ) |
Process incoming DTLS record.
- Parameters
-
[in] context Pointer to the TLS context
- Returns
- Error code
Definition at line 423 of file dtls_record.c.
◆ dtlsReadDatagram()
error_t dtlsReadDatagram | ( | TlsContext * | context, |
uint8_t * | data, | ||
size_t | size, | ||
size_t * | length | ||
) |
Receive a datagram.
- Parameters
-
[in] context Pointer to the TLS context [out] data Buffer where to store the incoming datagram [in] size Maximum number of bytes that can be received [out] length Number of bytes that have been received
- Returns
- Error code
Definition at line 1177 of file dtls_record.c.
◆ dtlsReadProtocolData()
error_t dtlsReadProtocolData | ( | TlsContext * | context, |
uint8_t ** | data, | ||
size_t * | length, | ||
TlsContentType * | contentType | ||
) |
Read protocol data.
- Parameters
-
[in] context Pointer to the TLS context [out] data Pointer to the received data [out] length Number of data bytes that were received [out] contentType Higher level protocol
- Returns
- Error code
Definition at line 130 of file dtls_record.c.
◆ dtlsReadRecord()
error_t dtlsReadRecord | ( | TlsContext * | context | ) |
Receive a DTLS record.
- Parameters
-
[in] context Pointer to the TLS context
- Returns
- Error code
Definition at line 321 of file dtls_record.c.
◆ dtlsReassembleHandshakeMessage()
error_t dtlsReassembleHandshakeMessage | ( | TlsContext * | context, |
const DtlsHandshake * | message | ||
) |
Handshake message reassembly algorithm.
- Parameters
-
[in] context Pointer to the TLS context [in] message Pointer the newly arrived fragment
- Returns
- Error code
Definition at line 1037 of file dtls_record.c.
◆ dtlsSendFlight()
error_t dtlsSendFlight | ( | TlsContext * | context | ) |
Send the buffered flight of messages.
- Parameters
-
[in] context Pointer to the TLS context
- Returns
- Error code
Definition at line 725 of file dtls_record.c.
◆ dtlsTick()
error_t dtlsTick | ( | TlsContext * | context | ) |
Manage retransmission timer.
- Parameters
-
[in] context Pointer to the TLS context
- Returns
- Error code
Definition at line 1256 of file dtls_record.c.
◆ dtlsWriteProtocolData()
error_t dtlsWriteProtocolData | ( | TlsContext * | context, |
const uint8_t * | data, | ||
size_t | length, | ||
TlsContentType | contentType | ||
) |
Write protocol data.
- Parameters
-
[in] context Pointer to the TLS context [in] data Pointer to the data buffer [in] length Number of data bytes to be written [in] contentType Higher level protocol
- Returns
- Error code
Definition at line 58 of file dtls_record.c.
◆ dtlsWriteRecord()
error_t dtlsWriteRecord | ( | TlsContext * | context, |
const uint8_t * | data, | ||
size_t | length, | ||
TlsContentType | contentType | ||
) |
Send a DTLS record.
- Parameters
-
[in] context Pointer to the TLS context [in] data Pointer to the record data [in] length Length of the record data [in] contentType Record type
- Returns
- Error code
Definition at line 227 of file dtls_record.c.