API参考
载入中...
搜索中...
未找到
pack_extensions.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_EXTENSIONS_H
17#define PACK_EXTENSIONS_H
18
19#include <stdint.h>
20#include "tls.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/*
27 * Hook function for packing extensions of client and server.
28 */
29typedef int32_t (*PACK_EXT_FUNC)(const TLS_Ctx *ctx, PackPacket *pkt);
30
34typedef struct {
35 uint16_t exMsgType;
36 bool needPack;
37 PACK_EXT_FUNC packFunc;
39
40typedef void (*GET_EXTSIZE_FUNC)(const TLS_Ctx *ctx, uint32_t *exSize);
41
42typedef struct {
43 bool needCheck;
44 GET_EXTSIZE_FUNC getSizeFunc;
46
56int32_t PackClientExtension(const TLS_Ctx *ctx, PackPacket *pkt);
57
67int32_t PackServerExtension(const TLS_Ctx *ctx, PackPacket *pkt);
68
79int32_t PackEmptyExtension(uint16_t exMsgType, bool needPack, PackPacket *pkt);
90int32_t PackExtensionHeader(uint16_t exMsgType, uint16_t exMsgLen, PackPacket *pkt);
91
92int32_t PackRecordSizeLimit(const TLS_Ctx *ctx, PackPacket *pkt);
93
94int32_t PackServerSelectAlpnProto(const TLS_Ctx *ctx, PackPacket *pkt);
95
96int32_t PackClientCAList(const TLS_Ctx *ctx, PackPacket *pkt);
97#ifdef __cplusplus
98}
99#endif /* end __cplusplus */
100
101#endif /* end PACK_EXTENSIONS_H */
定义 pack_extensions.h:42
定义 pack_extensions.h:34
bool needPack
定义 pack_extensions.h:36
PACK_EXT_FUNC packFunc
定义 pack_extensions.h:37
uint16_t exMsgType
定义 pack_extensions.h:35
定义 tls.h:325