API参考
载入中...
搜索中...
未找到
pack.h
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
23extern "C" {
24#endif
25
35int32_t HS_PackMsg(TLS_Ctx *ctx, HS_MsgType type);
36
47int32_t PackAppendUint8ToBuf(PackPacket *pkt, uint8_t value);
48
59int32_t PackAppendUint16ToBuf(PackPacket *pkt, uint16_t value);
60
71int32_t PackAppendUint24ToBuf(PackPacket *pkt, uint32_t value);
72
83int32_t PackAppendUint32ToBuf(PackPacket *pkt, uint32_t value);
84
95int32_t PackAppendUint64ToBuf(PackPacket *pkt, uint64_t value);
96
108int32_t PackAppendDataToBuf(PackPacket *pkt, const uint8_t *data, uint32_t size);
109
123int32_t PackReserveBytes(PackPacket *pkt, uint32_t size, uint8_t **reservedBuf);
124
139int32_t PackStartLengthField(PackPacket *pkt, uint32_t size, uint32_t *allocatedPosition);
140
150int32_t PackSkipBytes(PackPacket *pkt, uint32_t size);
151
158void PackCloseUint8Field(const PackPacket *pkt, uint32_t position);
159
166void PackCloseUint16Field(const PackPacket *pkt, uint32_t position);
167
174void PackCloseUint24Field(const PackPacket *pkt, uint32_t position);
175
189int32_t PackGetSubBuffer(const PackPacket *pkt, uint32_t start, uint32_t *length, uint8_t **buf);
190#ifdef __cplusplus
191}
192#endif /* end __cplusplus */
193
194#endif
定义 tls.h:325