/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * * 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 */ /* */ /* _nxe_secure_dtls_server_notify_set PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Timothy Stapko, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function checks for errors when assigning the optional notify */ /* callbacks to a DTLS server instance. */ /* */ /* INPUT */ /* */ /* server_ptr DTLS server control block */ /* disconnect_notify DTLS disconnect callback */ /* error_notify DTLS error callback */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* _nx_secure_dtls_server_notify_set Actual function call */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Timothy Stapko Initial Version 6.0 */ /* 09-30-2020 Timothy Stapko Modified comment(s), */ /* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _nxe_secure_dtls_server_notify_set(NX_SECURE_DTLS_SERVER *server_ptr, UINT (*disconnect_notify)(NX_SECURE_DTLS_SESSION *dtls_session), UINT (*error_notify)(NX_SECURE_DTLS_SESSION *dtls_session, UINT error_code)) { #ifdef NX_SECURE_ENABLE_DTLS UINT status; if(server_ptr == NX_NULL) { return(NX_PTR_ERROR); } /* Actual function call. */ status = _nx_secure_dtls_server_notify_set(server_ptr, disconnect_notify, error_notify); return(status); #else NX_PARAMETER_NOT_USED(server_ptr); NX_PARAMETER_NOT_USED(disconnect_notify); NX_PARAMETER_NOT_USED(error_notify); return(NX_NOT_SUPPORTED); #endif /* NX_SECURE_ENABLE_DTLS */ }