API参考
载入中...
搜索中...
未找到
hitls_alpn.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
21
22#ifndef HITLS_ALPN_H
23#define HITLS_ALPN_H
24
25#include <stdint.h>
26#include "hitls_type.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
36#define HITLS_ALPN_ERR_OK 0 /* Correct execution. */
37#define HITLS_ALPN_ERR_ALERT_WARNING 1 /* Execution error, sent warning alert. */
38#define HITLS_ALPN_ERR_ALERT_FATAL 2 /* Execution error, sent fatal alert. */
39#define HITLS_ALPN_ERR_NOACK 3 /* Execution exception, ignore processing. */
40
57typedef int32_t (*HITLS_AlpnSelectCb)(HITLS_Ctx *ctx, uint8_t **selectedProto, uint8_t *selectedProtoSize,
58 uint8_t *clientAlpnList, uint32_t clientAlpnListSize, void *userData);
59
71int32_t HITLS_CFG_SetAlpnProtos(HITLS_Config *config, const uint8_t *alpnProtos, uint32_t alpnProtosLen);
72
84int32_t HITLS_CFG_SetAlpnProtosSelectCb(HITLS_Config *config, HITLS_AlpnSelectCb callback, void *userData);
85
97int32_t HITLS_SetAlpnProtos(HITLS_Ctx *ctx, const uint8_t *protos, uint32_t protosLen);
98
109int32_t HITLS_GetSelectedAlpnProto(HITLS_Ctx *ctx, uint8_t **proto, uint32_t *protoLen);
110
126int32_t HITLS_SelectAlpnProtocol(uint8_t **out, uint8_t *outLen, const uint8_t *servAlpnList, uint32_t servAlpnListLen,
127 const uint8_t *clientAlpnList, uint32_t clientAlpnListLen);
128
129#ifdef __cplusplus
130}
131#endif
132
133#endif // HITLS_ALPN_H
int32_t HITLS_GetSelectedAlpnProto(HITLS_Ctx *ctx, uint8_t **proto, uint32_t *protoLen)
Obtaining the ALPN Negotiation Result
int32_t HITLS_SetAlpnProtos(HITLS_Ctx *ctx, const uint8_t *protos, uint32_t protosLen)
Sets the client ALPN list, which is used to negotiate the application layer protocol with the server ...
int32_t HITLS_SelectAlpnProtocol(uint8_t **out, uint8_t *outLen, const uint8_t *servAlpnList, uint32_t servAlpnListLen, const uint8_t *clientAlpnList, uint32_t clientAlpnListLen)
Obtaining the ALPN Negotiation Result The server selects an appropriate ALPN based on the ALPN provid...
int32_t(* HITLS_AlpnSelectCb)(HITLS_Ctx *ctx, uint8_t **selectedProto, uint8_t *selectedProtoSize, uint8_t *clientAlpnList, uint32_t clientAlpnListSize, void *userData)
Callback prototype for selecting the ALPN protocol on the server, which is used to select the applica...
定义 hitls_alpn.h:57
int32_t HITLS_CFG_SetAlpnProtos(HITLS_Config *config, const uint8_t *alpnProtos, uint32_t alpnProtosLen)
Sets the ALPN list on the client, which is used to negotiate the application layer protocol with the ...
int32_t HITLS_CFG_SetAlpnProtosSelectCb(HITLS_Config *config, HITLS_AlpnSelectCb callback, void *userData)
Sets the ALPN selection callback on the server. The callback is used to select the application layer ...
struct TlsCtx HITLS_Ctx
HITLS context
定义 hitls_type.h:35
struct TlsConfig HITLS_Config
config context
定义 hitls_type.h:41