• 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_TRANS_FUNC_H
17 #define G_ENHANCE_TRANS_FUNC_H
18 
19 #include "stdint.h"
20 
21 #include "lnn_lane_interface_struct.h"
22 #include "softbus_def.h"
23 #include "softbus_proxychannel_message_struct.h"
24 #include "softbus_trans_def.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif // __cplusplus
29 
30 typedef int32_t (*InitQosFunc)(void);
31 typedef int32_t (*NotifyQosChannelOpenedFunc)(const ChannelInfo *chanInfo);
32 typedef void (*NotifyQosChannelClosedFunc)(int32_t channelId, int32_t channelType);
33 typedef void (*GetExtQosInfoFunc)(
34     const SessionParam *param, QosInfo *qosInfo, uint32_t index, AllocExtendInfo *extendInfo);
35 typedef int32_t (*SetDefaultQdiscFunc)(void);
36 typedef int32_t (*TransReversePullUpFunc)(const uint32_t chatMode, const uint32_t businessFlag, const char *pkgName);
37 typedef int32_t (*TransGetPkgnameByBusinessFlagFunc)(const uint32_t businessFlag, char *pkgName, const uint32_t pkgLen);
38 typedef int32_t (*InitSoftbusPagingResPullFunc)(void);
39 typedef void (*DeInitSoftbusPagingResPullFunc)(void);
40 typedef int32_t (*InitSoftbusPagingFunc)(void);
41 typedef void (*DeInitSoftbusPagingFunc)(void);
42 typedef void (*TransPagingDeathCallbackFunc)(const char *pkgName, int32_t pid);
43 typedef bool (*TransHasAndUpdatePagingListenFunc)(ProxyChannelInfo *info);
44 typedef int32_t (*TransPagingGetPidAndDataByFlgFunc)(
45     bool isClient, uint32_t businessFlag, int32_t *pid, char *data, uint32_t *len);
46 typedef int32_t (*TransDelPagingInfoByBusinessFlagFunc)(uint32_t businessFlag);
47 typedef int32_t (*ClientOpenHtpChannelFunc)(
48     int32_t channelId, int64_t requestId, const char *localMac, const char *remoteMac);
49 typedef int32_t (*ServerOpenHtpChannelFunc)(const char *remoteIp, int64_t flIdentity);
50 typedef int32_t (*CloseHtpChannelFunc)(int32_t channelId);
51 typedef void (*ServerUpdateHtpChannelFunc)(int64_t flIdentity, int32_t channelId);
52 typedef bool (*CheckHtpPermissionFunc)(int32_t uid);
53 typedef void (*TransProcessGroupTalkieInfoFunc)(const char *pkgName);
54 typedef bool (*IsInWhitelistFunc)(const char *app);
55 
56 typedef struct TagTransEnhanceFuncList {
57     InitQosFunc initQos;
58     NotifyQosChannelOpenedFunc notifyQosChannelOpened;
59     NotifyQosChannelClosedFunc notifyQosChannelClosed;
60     GetExtQosInfoFunc getExtQosInfo;
61     SetDefaultQdiscFunc setDefaultQdisc;
62     TransReversePullUpFunc transReversePullUp;
63     TransGetPkgnameByBusinessFlagFunc transGetPkgnameByBusinessFlag;
64     InitSoftbusPagingResPullFunc initSoftbusPagingResPull;
65     DeInitSoftbusPagingResPullFunc deInitSoftbusPagingResPull;
66     InitSoftbusPagingFunc initSoftbusPaging;
67     DeInitSoftbusPagingFunc deInitSoftbusPaging;
68     TransPagingDeathCallbackFunc transPagingDeathCallback;
69     TransHasAndUpdatePagingListenFunc transHasAndUpdatePagingListen;
70     TransPagingGetPidAndDataByFlgFunc transPagingGetPidAndDataByFlg;
71     TransDelPagingInfoByBusinessFlagFunc transDelPagingInfoByBusinessFlag;
72     ClientOpenHtpChannelFunc clientOpenHtpChannel;
73     ServerOpenHtpChannelFunc serverOpenHtpChannel;
74     CloseHtpChannelFunc closeHtpChannel;
75     ServerUpdateHtpChannelFunc serverUpdateHtpChannel;
76     CheckHtpPermissionFunc checkHtpPermission;
77     TransProcessGroupTalkieInfoFunc transProcessGroupTalkieInfo;
78     IsInWhitelistFunc isInWhitelist;
79 } TransEnhanceFuncList;
80 
81 TransEnhanceFuncList *TransEnhanceFuncListGet(void);
82 int32_t TransRegisterEnhanceFunc(void *soHandle);
83 
84 #ifdef __cplusplus
85 }
86 #endif // __cplusplus
87 #endif // G_ENHANCE_TRANS_FUNC
88