1 /*************************************************************************** 2 * Copyright (c) 2024 Microsoft Corporation 3 * 4 * This program and the accompanying materials are made available under the 5 * terms of the MIT License which is available at 6 * https://opensource.org/licenses/MIT. 7 * 8 * SPDX-License-Identifier: MIT 9 **************************************************************************/ 10 11 12 /**************************************************************************/ 13 /**************************************************************************/ 14 /** */ 15 /** NetX Secure Component */ 16 /** */ 17 /** Transport Layer Security (TLS) */ 18 /** */ 19 /**************************************************************************/ 20 /**************************************************************************/ 21 22 #define NX_SECURE_SOURCE_CODE 23 24 25 #include "nx_secure_tls.h" 26 27 /* Bring in externs for caller checking code. */ 28 29 NX_SECURE_CALLER_CHECKING_EXTERNS 30 31 /**************************************************************************/ 32 /* */ 33 /* FUNCTION RELEASE */ 34 /* */ 35 /* _nxe_secure_tls_session_packet_pool_set PORTABLE C */ 36 /* 6.2.0 */ 37 /* AUTHOR */ 38 /* */ 39 /* Yanwu Cai, Microsoft Corporation */ 40 /* */ 41 /* DESCRIPTION */ 42 /* */ 43 /* This function checks for errors when setting the packet pool. */ 44 /* */ 45 /* INPUT */ 46 /* */ 47 /* tls_session TLS control block */ 48 /* packet_pool Pointer to the packet pool */ 49 /* */ 50 /* OUTPUT */ 51 /* */ 52 /* status Completion status */ 53 /* */ 54 /* CALLS */ 55 /* */ 56 /* _nx_secure_tls_session_packet_pool_set */ 57 /* Actual packet pool set */ 58 /* */ 59 /* CALLED BY */ 60 /* */ 61 /* Application Code */ 62 /* */ 63 /* RELEASE HISTORY */ 64 /* */ 65 /* DATE NAME DESCRIPTION */ 66 /* */ 67 /* 10-31-2022 Yanwu Cai Initial Version 6.2.0 */ 68 /* */ 69 /**************************************************************************/ _nxe_secure_tls_session_packet_pool_set(NX_SECURE_TLS_SESSION * tls_session,NX_PACKET_POOL * packet_pool)70UINT _nxe_secure_tls_session_packet_pool_set(NX_SECURE_TLS_SESSION *tls_session, 71 NX_PACKET_POOL *packet_pool) 72 { 73 UINT status; 74 75 76 if (tls_session == NX_NULL) 77 { 78 return(NX_PTR_ERROR); 79 } 80 81 /* Make sure the session is initialized. */ 82 if(tls_session -> nx_secure_tls_id != NX_SECURE_TLS_ID) 83 { 84 return(NX_SECURE_TLS_SESSION_UNINITIALIZED); 85 } 86 87 /* Check for appropriate caller. */ 88 NX_THREADS_ONLY_CALLER_CHECKING 89 90 /* We want to be able to set the packet pool to NX_NULL to use the default packet pool, so don't check for it. */ 91 status = _nx_secure_tls_session_packet_pool_set(tls_session, packet_pool); 92 93 return(status); 94 } 95 96