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 /*    _nxe_secure_dtls_server_start                       PORTABLE C      */
32 /*                                                           6.1          */
33 /*  AUTHOR                                                                */
34 /*                                                                        */
35 /*    Timothy Stapko, Microsoft Corporation                               */
36 /*                                                                        */
37 /*  DESCRIPTION                                                           */
38 /*                                                                        */
39 /*    This function checks for errors when starting a DTLS server.        */
40 /*                                                                        */
41 /*  INPUT                                                                 */
42 /*                                                                        */
43 /*    server_ptr                            DTLS server control block     */
44 /*                                                                        */
45 /*  OUTPUT                                                                */
46 /*                                                                        */
47 /*    status                                Completion status             */
48 /*                                                                        */
49 /*  CALLS                                                                 */
50 /*                                                                        */
51 /*    _nx_secure_dtls_server_start          Actual function call          */
52 /*                                                                        */
53 /*  CALLED BY                                                             */
54 /*                                                                        */
55 /*    Application Code                                                    */
56 /*                                                                        */
57 /*  RELEASE HISTORY                                                       */
58 /*                                                                        */
59 /*    DATE              NAME                      DESCRIPTION             */
60 /*                                                                        */
61 /*  05-19-2020     Timothy Stapko           Initial Version 6.0           */
62 /*  09-30-2020     Timothy Stapko           Modified comment(s),          */
63 /*                                            resulting in version 6.1    */
64 /*                                                                        */
65 /**************************************************************************/
_nxe_secure_dtls_server_start(NX_SECURE_DTLS_SERVER * server_ptr)66 UINT _nxe_secure_dtls_server_start(NX_SECURE_DTLS_SERVER *server_ptr)
67 {
68 #ifdef NX_SECURE_ENABLE_DTLS
69 UINT status;
70 
71     /* Check pointer */
72     if(server_ptr == NX_NULL)
73     {
74         return(NX_PTR_ERROR);
75     }
76 
77     /* Bind the UDP socket to the assigned port. */
78     status =  _nx_secure_dtls_server_start(server_ptr);
79 
80     return(status);
81 #else
82     NX_PARAMETER_NOT_USED(server_ptr);
83 
84     return(NX_NOT_SUPPORTED);
85 #endif /* NX_SECURE_ENABLE_DTLS */
86 }
87 
88