1 /*
2  * Copyright (c) 2021 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 SOFTBUS_PROXYCHANNEL_SESSION_H
17 #define SOFTBUS_PROXYCHANNEL_SESSION_H
18 
19 #include "stdint.h"
20 #include "softbus_def.h"
21 #include "softbus_trans_def.h"
22 #include "softbus_proxychannel_message.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 typedef enum {
29     PROXY_FLAG_BYTES = 0,
30     PROXY_FLAG_ACK = 1,
31     PROXY_FLAG_MESSAGE = 2,
32     PROXY_FILE_FIRST_FRAME = 3,
33     PROXY_FILE_ONGOINE_FRAME = 4,
34     PROXY_FILE_LAST_FRAME = 5,
35     PROXY_FILE_ONLYONE_FRAME = 6,
36     PROXY_FILE_ALLFILE_SENT = 7,
37     PROXY_FILE_CRC_CHECK_FRAME = 8,
38     PROXY_FILE_RESULT_FRAME = 9,
39     PROXY_FILE_ACK_REQUEST_SENT = 10,
40     PROXY_FILE_ACK_RESPONSE_SENT = 11,
41     PROXY_FLAG_ASYNC_MESSAGE = 12,
42 } ProxyPacketType;
43 
44 int32_t TransProxyPostSessionData(int32_t channelId, const unsigned char *data, uint32_t len, SessionPktType flags);
45 int32_t TransOnNormalMsgReceived(const char *pkgName, int32_t pid, int32_t channelId, const char *data, uint32_t len);
46 int32_t TransProxyDelSliceProcessorByChannelId(int32_t channelId);
47 int32_t NotifyClientMsgReceived(const char *pkgName, int32_t pid, int32_t channelId, TransReceiveData *receiveData);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif
54