• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef G_ENHANCE_SDK_FUNC_H
17 #define G_ENHANCE_SDK_FUNC_H
18 
19 #include "client_trans_file_struct.h"
20 
21 #define FILLP_TYPES_ERR_OK_INVALID true
22 #ifdef FILLP_TYPES_ENHANCE_ENABLED
23 #include "include/fillptypes.h"
24 #else
25 #include "fillptypes.h"
26 #endif
27 #include "stdint.h"
28 #include "trans_type.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 typedef void (*BusCenterExProxyDeInitFunc)(void);
35 typedef int32_t (*DiscRecoveryPolicyFunc)(void);
36 typedef int32_t (*CheckFileSchemaFunc)(int32_t sessionId, FileSchemaListener *fileSchemaListener);
37 typedef int32_t (*SetSchemaCallbackFunc)(FileSchema fileSchema, const char *sFileList[], uint32_t fileCnt);
38 typedef int32_t (*SetExtSocketOptFunc)(
39     int32_t socket, OptLevel level, OptType optType, void *optValue, uint32_t optValueSize);
40 typedef int32_t (*GetExtSocketOptFunc)(
41     int32_t socket, OptLevel level, OptType optType, void *optValue, int32_t *optValueSize);
42 typedef int32_t (*TransFileSchemaInitFunc)(void);
43 typedef void (*TransFileSchemaDeinitFunc)(void);
44 typedef int32_t (*VtpSetSocketMultiLayerFunc)(int fd, OnFrameEvt *cb, const void *para);
45 typedef bool (*IsVtpFrameSentEvtFunc)(const FtEventCbkInfo *info);
46 typedef int (*HandleVtpFrameEvtFunc)(int fd, OnFrameEvt cb, const FtEventCbkInfo *info);
47 typedef int32_t (*TransOnPagingConnectFunc)(const int32_t socket, const ChannelInfo *channel);
48 
49 typedef struct TagClientEnhanceFuncList {
50     BusCenterExProxyDeInitFunc busCenterExProxyDeInit;
51     DiscRecoveryPolicyFunc discRecoveryPolicy;
52     CheckFileSchemaFunc checkFileSchema;
53     SetSchemaCallbackFunc setSchemaCallback;
54     SetExtSocketOptFunc setExtSocketOpt;
55     GetExtSocketOptFunc getExtSocketOpt;
56     TransFileSchemaInitFunc transFileSchemaInit;
57     TransFileSchemaDeinitFunc transFileSchemaDeinit;
58     VtpSetSocketMultiLayerFunc vtpSetSocketMultiLayer;
59     IsVtpFrameSentEvtFunc isVtpFrameSentEvt;
60     HandleVtpFrameEvtFunc handleVtpFrameEvt;
61     TransOnPagingConnectFunc transOnPagingConnect;
62 } ClientEnhanceFuncList;
63 
64 ClientEnhanceFuncList *ClientEnhanceFuncListGet(void);
65 int32_t ClientRegisterEnhanceFunc(void *soHandle);
66 void ClientRegisterEnhanceFuncCheck(void *sdkFunc);
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif