Helper functions for NTS client. More...
Go to the source code of this file.
Detailed Description
Helper functions for NTS client.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP 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 nts_client_misc.h.
Function Documentation
◆ ntsClientChangeState()
void ntsClientChangeState | ( | NtsClientContext * | context, |
NtsClientState | newState | ||
) |
Update NTS client state.
- Parameters
-
[in] context Pointer to the NTS client context [in] newState New state to switch to
Definition at line 57 of file nts_client_misc.c.
◆ ntsClientCheckNtpTimeout()
error_t ntsClientCheckNtpTimeout | ( | NtsClientContext * | context | ) |
Determine whether a timeout error has occurred (NTP phase)
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 1326 of file nts_client_misc.c.
◆ ntsClientCheckNtsKeTimeout()
error_t ntsClientCheckNtsKeTimeout | ( | NtsClientContext * | context | ) |
Determine whether a timeout error has occurred (NTS-KE phase)
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 787 of file nts_client_misc.c.
◆ ntsClientCloseNtpConnection()
void ntsClientCloseNtpConnection | ( | NtsClientContext * | context | ) |
Close NTP connection.
- Parameters
-
[in] context Pointer to the NTS client context
Definition at line 1308 of file nts_client_misc.c.
◆ ntsClientCloseNtsKeConnection()
void ntsClientCloseNtsKeConnection | ( | NtsClientContext * | context | ) |
Close NTS-KE connection.
- Parameters
-
[in] context Pointer to the NTS client context
Definition at line 769 of file nts_client_misc.c.
◆ ntsClientDecryptNtpResponse()
error_t ntsClientDecryptNtpResponse | ( | NtsClientContext * | context, |
const IpAddr * | ipAddr, | ||
uint16_t | port, | ||
const uint8_t * | message, | ||
size_t | length | ||
) |
Decrypt NTP response.
- Parameters
-
[in] context Pointer to the NTS client context [in] ipAddr Remote IP address [in] port Remote port number [in] message Pointer to the NTP message [in] length Length of the NTP message, in bytes
- Returns
- Error code
Definition at line 1079 of file nts_client_misc.c.
◆ ntsClientEstablishNtsKeConnection()
error_t ntsClientEstablishNtsKeConnection | ( | NtsClientContext * | context | ) |
Establish NTS-KE connection.
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 162 of file nts_client_misc.c.
◆ ntsClientFormatNtsKeRequest()
error_t ntsClientFormatNtsKeRequest | ( | NtsClientContext * | context | ) |
Format NTS-KE request.
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 188 of file nts_client_misc.c.
◆ ntsClientOpenNtpConnection()
error_t ntsClientOpenNtpConnection | ( | NtsClientContext * | context | ) |
Open NTP connection.
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 823 of file nts_client_misc.c.
◆ ntsClientOpenNtsKeConnection()
error_t ntsClientOpenNtsKeConnection | ( | NtsClientContext * | context | ) |
Open NTS-KE connection.
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 74 of file nts_client_misc.c.
◆ ntsClientParseAeadAlgoNegoRecord()
error_t ntsClientParseAeadAlgoNegoRecord | ( | NtsClientContext * | context, |
const uint8_t * | body, | ||
size_t | length | ||
) |
Parse AEAD Algorithm Negotiation record.
- Parameters
-
[in] context Pointer to the NTS client context [in] body Pointer to the record body [in] length Length of the record body, in bytes
- Returns
- Error code
Definition at line 605 of file nts_client_misc.c.
◆ ntsClientParseEndOfMessageRecord()
error_t ntsClientParseEndOfMessageRecord | ( | NtsClientContext * | context, |
const uint8_t * | body, | ||
size_t | length | ||
) |
Parse End of Message record.
- Parameters
-
[in] context Pointer to the NTS client context [in] body Pointer to the record body [in] length Length of the record body, in bytes
- Returns
- Error code
Definition at line 454 of file nts_client_misc.c.
◆ ntsClientParseErrorRecord()
error_t ntsClientParseErrorRecord | ( | NtsClientContext * | context, |
const uint8_t * | body, | ||
size_t | length | ||
) |
Parse Error record.
- Parameters
-
[in] context Pointer to the NTS client context [in] body Pointer to the record body [in] length Length of the record body, in bytes
- Returns
- Error code
Definition at line 569 of file nts_client_misc.c.
◆ ntsClientParseNewCookieForNtpv4Record()
error_t ntsClientParseNewCookieForNtpv4Record | ( | NtsClientContext * | context, |
const uint8_t * | body, | ||
size_t | length | ||
) |
Parse New Cookie for NTPv4 record.
- Parameters
-
[in] context Pointer to the NTS client context [in] body Pointer to the record body [in] length Length of the record body, in bytes
- Returns
- Error code
Definition at line 651 of file nts_client_misc.c.
◆ ntsClientParseNtpResponse()
error_t ntsClientParseNtpResponse | ( | NtsClientContext * | context, |
NtpTimestamp * | timestamp | ||
) |
Parse NTP response.
- Parameters
-
[in] context Pointer to the NTS client context [out] timestamp Pointer to the NTP timestamp
- Returns
- Error code
Definition at line 1267 of file nts_client_misc.c.
◆ ntsClientParseNtpv4PortRecord()
error_t ntsClientParseNtpv4PortRecord | ( | NtsClientContext * | context, |
const uint8_t * | body, | ||
size_t | length | ||
) |
Parse NTPv4 Port Negotiation record.
- Parameters
-
[in] context Pointer to the NTS client context [in] body Pointer to the record body [in] length Length of the record body, in bytes
- Returns
- Error code
Definition at line 718 of file nts_client_misc.c.
◆ ntsClientParseNtpv4ServerRecord()
error_t ntsClientParseNtpv4ServerRecord | ( | NtsClientContext * | context, |
const uint8_t * | body, | ||
size_t | length | ||
) |
Parse NTPv4 Server Negotiation record.
- Parameters
-
[in] context Pointer to the NTS client context [in] body Pointer to the record body [in] length Length of the record body, in bytes
- Returns
- Error code
Definition at line 686 of file nts_client_misc.c.
◆ ntsClientParseNtsNextProtoNegoRecord()
error_t ntsClientParseNtsNextProtoNegoRecord | ( | NtsClientContext * | context, |
const uint8_t * | body, | ||
size_t | length | ||
) |
Parse NTS Next Protocol Negotiation record.
- Parameters
-
[in] context Pointer to the NTS client context [in] body Pointer to the record body [in] length Length of the record body, in bytes
- Returns
- Error code
Definition at line 526 of file nts_client_misc.c.
◆ ntsClientParseWarningRecord()
error_t ntsClientParseWarningRecord | ( | NtsClientContext * | context, |
const uint8_t * | body, | ||
size_t | length | ||
) |
Parse Warning record.
- Parameters
-
[in] context Pointer to the NTS client context [in] body Pointer to the record body [in] length Length of the record body, in bytes
- Returns
- Error code
Definition at line 587 of file nts_client_misc.c.
◆ ntsClientReceiveNtpResponse()
error_t ntsClientReceiveNtpResponse | ( | NtsClientContext * | context | ) |
Wait for NTP response.
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 992 of file nts_client_misc.c.
◆ ntsClientReceiveNtsKeResponse()
error_t ntsClientReceiveNtsKeResponse | ( | NtsClientContext * | context | ) |
Receive NTS-KE response.
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 316 of file nts_client_misc.c.
◆ ntsClientSendNtpRequest()
error_t ntsClientSendNtpRequest | ( | NtsClientContext * | context | ) |
Send NTP request to the server.
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 862 of file nts_client_misc.c.
◆ ntsClientSendNtsKeRequest()
error_t ntsClientSendNtsKeRequest | ( | NtsClientContext * | context | ) |
Send NTS-KE request.
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 256 of file nts_client_misc.c.
◆ ntsClientShutdownNtsKeConnection()
error_t ntsClientShutdownNtsKeConnection | ( | NtsClientContext * | context | ) |
Shutdown NTS-KE connection.
- Parameters
-
[in] context Pointer to the NTS client context
- Returns
- Error code
Definition at line 740 of file nts_client_misc.c.