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_proxychannel_message.h" 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 typedef enum { 28 PROXY_FLAG_BYTES = 0, 29 PROXY_FLAG_ACK = 1, 30 PROXY_FLAG_MESSAGE = 2, 31 PROXY_FILE_FIRST_FRAME = 3, 32 PROXY_FILE_ONGOINE_FRAME = 4, 33 PROXY_FILE_LAST_FRAME = 5, 34 PROXY_FILE_ONLYONE_FRAME = 6, 35 PROXY_FILE_ALLFILE_SENT = 7, 36 PROXY_FILE_CRC_CHECK_FRAME = 8, 37 PROXY_FILE_RESULT_FRAME = 9, 38 PROXY_FILE_ACK_REQUEST_SENT = 10, 39 PROXY_FILE_ACK_RESPONSE_SENT = 11, 40 PROXY_FLAG_ASYNC_MESSAGE = 12, 41 } ProxyPacketType; 42 43 typedef enum { 44 PROXY_CHANNEL_PRORITY_MESSAGE = 0, 45 PROXY_CHANNEL_PRORITY_BYTES = 1, 46 PROXY_CHANNEL_PRORITY_FILE = 2, 47 PROXY_CHANNEL_PRORITY_BUTT = 3, 48 } ProxyChannelPriority; 49 50 int32_t TransProxyPostSessionData(int32_t channelId, const uint8_t *data, uint32_t len, SessionPktType flags); 51 int32_t TransOnNormalMsgReceived(const char *pkgName, int32_t channelId, const char *data, uint32_t len); 52 int32_t TransOnAuthMsgReceived(const char *pkgName, int32_t channelId, const char *data, uint32_t len); 53 int32_t TransProxyDelSliceProcessorByChannelId(int32_t channelId); 54 void TransSliceManagerDeInit(void); 55 int32_t TransSliceManagerInit(void); 56 57 #ifdef __cplusplus 58 } 59 #endif 60 61 #endif 62