• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2024 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 TRANS_CLIENT_PROXY_H
17 #define TRANS_CLIENT_PROXY_H
18 
19 #include "socket.h"
20 #include "softbus_def.h"
21 #include "softbus_trans_def.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 typedef struct {
28     int32_t msgChannelId;
29     int32_t msgChannelType;
30     int32_t msgPid;
31     int32_t msgMessageType;
32     const char *msgPkgName;
33     const char *msgUuid;
34     const char *msgUdid;
35 }ChannelMsg;
36 
37 int32_t ClientIpcOnChannelOpened(const char *pkgName, const char *sessionName, const ChannelInfo *channel, int32_t pid);
38 int32_t ClientIpcOnChannelBind(ChannelMsg *data);
39 int32_t ClientIpcOnChannelOpenFailed(ChannelMsg *data, int32_t errCode);
40 int32_t ClientIpcOnChannelLinkDown(ChannelMsg *data, const char *networkId, const char *peerIp, int32_t routeType);
41 int32_t ClientIpcOnChannelClosed(ChannelMsg *data);
42 int32_t ClientIpcOnChannelMsgReceived(ChannelMsg *data, TransReceiveData *receiveData);
43 int32_t ClientIpcOnChannelQosEvent(const char *pkgName, const QosParam *param);
44 int32_t InformPermissionChange(int32_t state, const char *pkgName, int32_t pid);
45 int32_t ClientIpcSetChannelInfo(
46     const char *pkgName, const char *sessionName, int32_t sessionId, const TransInfo *transInfo, int32_t pid);
47 int32_t ClientIpcOnTransLimitChange(const char *pkgName, int32_t pid, int32_t channelId, uint8_t tos);
48 int32_t CheckServiceIsRegistered(const char *pkgName, int32_t pid);
49 void RegisterPermissionChangeCallback(void);
50 int32_t ClientIpcChannelOnQos(ChannelMsg *data, QoSEvent event, const QosTV *qos, uint32_t count);
51 int32_t ClientIpcCheckCollabRelation(const char *pkgName, int32_t pid,
52     const CollabInfo *sourceInfo, const CollabInfo *sinkInfo, const TransInfo *transInfo);
53 int32_t ClientIpcBrProxyOpened(const char *pkgName, int32_t channelId,
54     const char *brMac, const char *uuid, int32_t reason);
55 int32_t ClientIpcBrProxyReceivedData(const char *pkgName, int32_t channelId, const uint8_t *data, uint32_t len);
56 int32_t ClientIpcBrProxyStateChanged(const char *pkgName, int32_t channelId, int32_t channelState);
57 int32_t ClientIpcQueryPermission(const char *pkgName, const char *bundleName, bool *isEmpowered);
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 #endif