1 /* 2 * This file is part of the openHiTLS project. 3 * 4 * openHiTLS is licensed under the Mulan PSL v2. 5 * You can use this software according to the terms and conditions of the Mulan PSL v2. 6 * You may obtain a copy of Mulan PSL v2 at: 7 * 8 * http://license.coscl.org.cn/MulanPSL2 9 * 10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 13 * See the Mulan PSL v2 for more details. 14 */ 15 16 #ifndef PACK_H 17 #define PACK_H 18 19 #include "tls.h" 20 #include "hs_msg.h" 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 /** 27 * @brief Pack handshake messages 28 * 29 * @param ctx [IN] TLS context 30 * @param type [IN] Message type 31 * @param buf [OUT] Returned handshake message 32 * @param bufLen [IN] Input buffer size 33 * @param usedLen [OUT] Returned message length 34 * 35 * @retval HITLS_SUCCESS 36 * @retval For other error codes, see hitls_error.h 37 */ 38 int32_t HS_PackMsg(TLS_Ctx *ctx, HS_MsgType type, uint8_t *buf, uint32_t bufLen, uint32_t *usedLen); 39 40 #ifdef __cplusplus 41 } 42 #endif /* end __cplusplus */ 43 44 #endif