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