1 /**************************************************************************/ 2 /* */ 3 /* Copyright (c) Microsoft Corporation. All rights reserved. */ 4 /* */ 5 /* This software is licensed under the Microsoft Software License */ 6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */ 7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ 8 /* and in the root directory of this software. */ 9 /* */ 10 /**************************************************************************/ 11 12 13 /**************************************************************************/ 14 /**************************************************************************/ 15 /** */ 16 /** NetX Secure Component */ 17 /** */ 18 /** Datagram Transport Layer Security (DTLS) */ 19 /** */ 20 /**************************************************************************/ 21 /**************************************************************************/ 22 23 #define NX_SECURE_SOURCE_CODE 24 25 #include "nx_secure_dtls.h" 26 27 /**************************************************************************/ 28 /* */ 29 /* FUNCTION RELEASE */ 30 /* */ 31 /* _nx_secure_dtls_server_notify_set PORTABLE C */ 32 /* 6.1 */ 33 /* AUTHOR */ 34 /* */ 35 /* Timothy Stapko, Microsoft Corporation */ 36 /* */ 37 /* DESCRIPTION */ 38 /* */ 39 /* This function assigns the optional notification callback routines */ 40 /* for errors and disconnect events to a DTLS session. These callbacks */ 41 /* can be used to monitor errors (and timeouts) during a DTLS */ 42 /* handshake and when DTLS connections are closed. */ 43 /* */ 44 /* INPUT */ 45 /* */ 46 /* server_ptr DTLS server control block */ 47 /* disconnect_notify DTLS disconnect callback */ 48 /* error_notify DTLS error callback */ 49 /* */ 50 /* OUTPUT */ 51 /* */ 52 /* status Completion status */ 53 /* */ 54 /* CALLS */ 55 /* */ 56 /* None */ 57 /* */ 58 /* CALLED BY */ 59 /* */ 60 /* Application Code */ 61 /* */ 62 /* RELEASE HISTORY */ 63 /* */ 64 /* DATE NAME DESCRIPTION */ 65 /* */ 66 /* 05-19-2020 Timothy Stapko Initial Version 6.0 */ 67 /* 09-30-2020 Timothy Stapko Modified comment(s), */ 68 /* resulting in version 6.1 */ 69 /* */ 70 /**************************************************************************/ _nx_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))71UINT _nx_secure_dtls_server_notify_set(NX_SECURE_DTLS_SERVER *server_ptr, 72 UINT (*disconnect_notify)(NX_SECURE_DTLS_SESSION *dtls_session), 73 UINT (*error_notify)(NX_SECURE_DTLS_SESSION *dtls_session, UINT error_code)) 74 75 76 { 77 #ifdef NX_SECURE_ENABLE_DTLS 78 79 /* Assign callbacks. */ 80 server_ptr->nx_secure_dtls_disconnect_notify = disconnect_notify; 81 server_ptr->nx_secure_dtls_error_notify = error_notify; 82 83 return(NX_SUCCESS); 84 #else 85 NX_PARAMETER_NOT_USED(server_ptr); 86 NX_PARAMETER_NOT_USED(disconnect_notify); 87 NX_PARAMETER_NOT_USED(error_notify); 88 89 return(NX_NOT_SUPPORTED); 90 #endif /* NX_SECURE_ENABLE_DTLS */ 91 } 92 93