• 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 CLIENT_TRANS_UDP_MANAGER_H
17 #define CLIENT_TRANS_UDP_MANAGER_H
18 
19 #include "client_trans_session_callback.h"
20 #include "client_trans_udp_manager_struct.h"
21 #include "session.h"
22 #include "softbus_def.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 int32_t ClientTransUdpMgrInit(IClientSessionCallBack *callback);
29 void ClientTransUdpMgrDeinit(void);
30 
31 int32_t TransOnUdpChannelOpened(
32     const char *sessionName, const ChannelInfo *channel, int32_t *udpPort, SocketAccessInfo *accessInfo);
33 int32_t TransOnUdpChannelOpenFailed(int32_t channelId, int32_t errCode);
34 int32_t TransOnUdpChannelClosed(int32_t channelId, ShutdownReason reason);
35 int32_t TransOnUdpChannelQosEvent(int32_t channelId, int32_t eventId, int32_t tvCount, const QosTv *tvList);
36 int32_t TransOnUdpChannelBind(int32_t channelId, int32_t channelType);
37 
38 int32_t ClientTransCloseUdpChannel(int32_t channelId, ShutdownReason reason);
39 
40 int32_t TransUdpChannelSendStream(int32_t channelId, const StreamData *data, const StreamData *ext,
41     const StreamFrameInfo *param);
42 
43 int32_t TransUdpChannelSendFile(int32_t channelId, const char *sFileList[], const char *dFileList[], uint32_t fileCnt);
44 
45 int32_t TransGetUdpChannelByFileId(int32_t dfileId, UdpChannel *udpChannel);
46 
47 int32_t TransGetUdpChannel(int32_t channelId, UdpChannel *udpChannel);
48 
49 void TransUdpDeleteFileListener(const char *sessionName);
50 
51 int32_t TransUdpOnCloseAckReceived(int32_t channelId);
52 
53 int32_t ClientEmitFileEvent(int32_t channelId);
54 
55 int32_t TransLimitChange(int32_t channelId, uint8_t tos);
56 
57 int32_t TransSetUdpChannelSessionId(int32_t channelId, int32_t sessionId);
58 
59 int32_t TransSetUdpChannelRenameHook(int32_t channelId, OnRenameFileCallback onRenameFile);
60 
61 int32_t TransUdpChannelSetStreamMultiLayer(int32_t channelId, const void *optValue);
62 
63 int32_t TransSetUdpChannelTos(int32_t channelId);
64 
65 int32_t TransGetUdpChannelTos(int32_t channelId, bool *isTosSet);
66 #ifdef __cplusplus
67 }
68 #endif
69 #endif // CLIENT_TRANS_UDP_MANAGER_H
70