nts_client.c
error_t ntsClientGetTimestamp(NtsClientContext *context, NtpTimestamp *timestamp)
Retrieve current time from NTS server.
Definition: nts_client.c:209
error_t ntsClientRegisterTlsInitCallback(NtsClientContext *context, NtsClientTlsInitCallback callback)
Register TLS initialization callback function.
Definition: nts_client.c:111
void ntsClientChangeState(NtsClientContext *context, NtsClientState newState)
Update NTS client state.
Definition: nts_client_misc.c:57
error_t ntsClientOpenNtpConnection(NtsClientContext *context)
Open NTP connection.
Definition: nts_client_misc.c:823
error_t ntsClientOpenNtsKeConnection(NtsClientContext *context)
Open NTS-KE connection.
Definition: nts_client_misc.c:74
error_t(* NtsClientTlsInitCallback)(NtsClientContext *context, TlsContext *tlsContext)
TLS initialization callback function.
Definition: nts_client.h:162
@ NTS_CLIENT_STATE_NTS_KE_DISCONNECTING
Definition: nts_client.h:149
void ntsClientDeinit(NtsClientContext *context)
Release NTS client context.
Definition: nts_client.c:452
void ntsClientCloseNtpConnection(NtsClientContext *context)
Close NTP connection.
Definition: nts_client_misc.c:1308
NTS client (Network Time Security)
void tlsFreeSessionState(TlsSessionState *session)
Properly dispose a session state.
Definition: tls.c:2753
error_t ntsClientRegisterRandCallback(NtsClientContext *context, NtsClientRandCallback callback)
Register random data generation callback function.
Definition: nts_client.c:133
error_t ntsClientInit(NtsClientContext *context)
Initialize NTS client context.
Definition: nts_client.c:56
error_t ntsClientSendNtpRequest(NtsClientContext *context)
Send NTP request to the server.
Definition: nts_client_misc.c:862
error_t ntsClientShutdownNtsKeConnection(NtsClientContext *context)
Shutdown NTS-KE connection.
Definition: nts_client_misc.c:740
uint32_t ntsClientGetKissCode(NtsClientContext *context)
Retrieve the kiss code from a Kiss-of-Death message.
Definition: nts_client.c:426
error_t getHostByName(NetInterface *interface, const char_t *name, IpAddr *ipAddr, uint_t flags)
Resolve a host name into an IP address.
Definition: socket.c:2274
error_t ntsClientSetTimeout(NtsClientContext *context, systime_t timeout)
Set communication timeout.
Definition: nts_client.c:90
error_t ntsClientReceiveNtpResponse(NtsClientContext *context)
Wait for NTP response.
Definition: nts_client_misc.c:992
error_t ntsClientReceiveNtsKeResponse(NtsClientContext *context)
Receive NTS-KE response.
Definition: nts_client_misc.c:316
error_t ntsClientEstablishNtsKeConnection(NtsClientContext *context)
Establish NTS-KE connection.
Definition: nts_client_misc.c:162
error_t ntsClientBindToInterface(NtsClientContext *context, NetInterface *interface)
Bind the NTS client to a particular network interface.
Definition: nts_client.c:155
void ntsClientCloseNtsKeConnection(NtsClientContext *context)
Close NTS-KE connection.
Definition: nts_client_misc.c:769
error_t ntsClientParseNtpResponse(NtsClientContext *context, NtpTimestamp *timestamp)
Parse NTP response.
Definition: nts_client_misc.c:1267
error_t ntsClientSendNtsKeRequest(NtsClientContext *context)
Send NTS-KE request.
Definition: nts_client_misc.c:256
error_t ntsClientCheckNtsKeTimeout(NtsClientContext *context)
Determine whether a timeout error has occurred (NTS-KE phase)
Definition: nts_client_misc.c:787
error_t(* NtsClientRandCallback)(uint8_t *data, size_t length)
Random data generation callback function.
Definition: nts_client.h:170
error_t ntsClientSetServerAddr(NtsClientContext *context, const IpAddr *serverIpAddr, uint16_t serverPort)
Specify the IP address of the NTS server.
Definition: nts_client.c:178
TCP/IP stack core.
error_t tlsInitSessionState(TlsSessionState *session)
Initialize session state.
Definition: tls.c:2610
error_t ntsClientFormatNtsKeRequest(NtsClientContext *context)
Format NTS-KE request.
Definition: nts_client_misc.c:188
#define NTS_CLIENT_INIT_NTP_RETRANSMIT_TIMEOUT
Definition: nts_client.h:62
Debugging facilities.
Helper functions for NTS client.