/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * Copyright (c) 2025-present Eclipse ThreadX Contributors * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** NetX Secure Component */ /** */ /** Datagram Transport Layer Security (DTLS) */ /** */ /**************************************************************************/ /**************************************************************************/ #define NX_SECURE_SOURCE_CODE #include "nx_secure_dtls.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _nx_secure_dtls_server_session_start PORTABLE C */ /* 6.4.3 */ /* AUTHOR */ /* */ /* Timothy Stapko, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function starts a DTLS session for a DTLS server. It is */ /* intended for use with the DTLS Server API - when a DTLS server */ /* instance invokes the DTLS connection callback, this function is */ /* used by the application to kick off the DTLS handshake. It may also */ /* be used for single DTLS sessions but note that the UDP socket must */ /* be initialized and ready for send/receive operations prior to */ /* calling this service. */ /* */ /* INPUT */ /* */ /* dtls_session DTLS control block */ /* wait_option Suspension option */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* _nx_secure_dtls_session_start Start the DTLS session */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* */ /**************************************************************************/ UINT _nx_secure_dtls_server_session_start(NX_SECURE_DTLS_SESSION *dtls_session, UINT wait_option) { #ifdef NX_SECURE_ENABLE_DTLS NX_UDP_SOCKET *udp_socket; UINT status; /* Get socket from the session. */ udp_socket = dtls_session->nx_secure_dtls_udp_socket; /* Call shared API. */ status = _nx_secure_dtls_session_start(dtls_session, udp_socket, NX_FALSE, wait_option); return(status); #else NX_PARAMETER_NOT_USED(dtls_session); NX_PARAMETER_NOT_USED(wait_option); return(NX_NOT_SUPPORTED); #endif /* NX_SECURE_ENABLE_DTLS */ }