1060ff233Sopenharmony_ci/* 2060ff233Sopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3060ff233Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4060ff233Sopenharmony_ci * you may not use this file except in compliance with the License. 5060ff233Sopenharmony_ci * You may obtain a copy of the License at 6060ff233Sopenharmony_ci * 7060ff233Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8060ff233Sopenharmony_ci * 9060ff233Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10060ff233Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11060ff233Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12060ff233Sopenharmony_ci * See the License for the specific language governing permissions and 13060ff233Sopenharmony_ci * limitations under the License. 14060ff233Sopenharmony_ci */ 15060ff233Sopenharmony_ci 16060ff233Sopenharmony_ci#include "trans_server_proxy.h" 17060ff233Sopenharmony_ci 18060ff233Sopenharmony_ci#include "lnn_connection_addr_utils.h" 19060ff233Sopenharmony_ci#include "softbus_def.h" 20060ff233Sopenharmony_ci#include "softbus_errcode.h" 21060ff233Sopenharmony_ci#include "trans_channel_manager.h" 22060ff233Sopenharmony_ci#include "trans_session_manager.h" 23060ff233Sopenharmony_ci#include "trans_session_service.h" 24060ff233Sopenharmony_ci 25060ff233Sopenharmony_ciint32_t TransServerProxyInit(void) 26060ff233Sopenharmony_ci{ 27060ff233Sopenharmony_ci return SOFTBUS_OK; 28060ff233Sopenharmony_ci} 29060ff233Sopenharmony_ci 30060ff233Sopenharmony_civoid TransServerProxyDeInit(void) 31060ff233Sopenharmony_ci{ 32060ff233Sopenharmony_ci return; 33060ff233Sopenharmony_ci} 34060ff233Sopenharmony_ci 35060ff233Sopenharmony_ciint32_t ServerIpcCreateSessionServer(const char *pkgName, const char *sessionName) 36060ff233Sopenharmony_ci{ 37060ff233Sopenharmony_ci return TransCreateSessionServer(pkgName, sessionName, 0, 0); 38060ff233Sopenharmony_ci} 39060ff233Sopenharmony_ci 40060ff233Sopenharmony_ciint32_t ServerIpcRemoveSessionServer(const char *pkgName, const char *sessionName) 41060ff233Sopenharmony_ci{ 42060ff233Sopenharmony_ci return TransRemoveSessionServer(pkgName, sessionName); 43060ff233Sopenharmony_ci} 44060ff233Sopenharmony_ci 45060ff233Sopenharmony_ciint32_t ServerIpcOpenSession(const SessionParam *param, TransInfo *info) 46060ff233Sopenharmony_ci{ 47060ff233Sopenharmony_ci return TransOpenSession(param, info); 48060ff233Sopenharmony_ci} 49060ff233Sopenharmony_ci 50060ff233Sopenharmony_ciint32_t ServerIpcOpenAuthSession(const char *sessionName, const ConnectionAddr *addrInfo) 51060ff233Sopenharmony_ci{ 52060ff233Sopenharmony_ci if ((sessionName == NULL) || (addrInfo == NULL)) { 53060ff233Sopenharmony_ci return SOFTBUS_INVALID_PARAM; 54060ff233Sopenharmony_ci } 55060ff233Sopenharmony_ci 56060ff233Sopenharmony_ci ConnectOption connOpt; 57060ff233Sopenharmony_ci if (!LnnConvertAddrToOption(addrInfo, &connOpt)) { 58060ff233Sopenharmony_ci return SOFTBUS_MEM_ERR; 59060ff233Sopenharmony_ci } 60060ff233Sopenharmony_ci return TransOpenAuthChannel(sessionName, &connOpt, ""); 61060ff233Sopenharmony_ci} 62060ff233Sopenharmony_ci 63060ff233Sopenharmony_ciint32_t ServerIpcNotifyAuthSuccess(int32_t channelId, int32_t channelType) 64060ff233Sopenharmony_ci{ 65060ff233Sopenharmony_ci return TransNotifyAuthSuccess(channelId, channelType); 66060ff233Sopenharmony_ci} 67060ff233Sopenharmony_ci 68060ff233Sopenharmony_ciint32_t ServerIpcCloseChannel(const char *sessionName, int32_t channelId, int32_t channelType) 69060ff233Sopenharmony_ci{ 70060ff233Sopenharmony_ci return TransCloseChannel(sessionName, channelId, channelType); 71060ff233Sopenharmony_ci} 72060ff233Sopenharmony_ci 73060ff233Sopenharmony_ciint32_t ServerIpcCloseChannelWithStatistics(int32_t channelId, int32_t channelType, uint64_t laneId, 74060ff233Sopenharmony_ci const void *dataInfo, uint32_t len) 75060ff233Sopenharmony_ci{ 76060ff233Sopenharmony_ci (void)channelId; 77060ff233Sopenharmony_ci (void)channelType; 78060ff233Sopenharmony_ci (void)laneId; 79060ff233Sopenharmony_ci (void)dataInfo; 80060ff233Sopenharmony_ci (void)len; 81060ff233Sopenharmony_ci return SOFTBUS_NOT_IMPLEMENT; 82060ff233Sopenharmony_ci} 83060ff233Sopenharmony_ci 84060ff233Sopenharmony_ciint32_t ServerIpcReleaseResources(int32_t channelId) 85060ff233Sopenharmony_ci{ 86060ff233Sopenharmony_ci return TransReleaseUdpResources(channelId); 87060ff233Sopenharmony_ci} 88060ff233Sopenharmony_ci 89060ff233Sopenharmony_ciint32_t ServerIpcSendMessage(int32_t channelId, int32_t channelType, const void *data, uint32_t len, int32_t msgType) 90060ff233Sopenharmony_ci{ 91060ff233Sopenharmony_ci return TransSendMsg(channelId, channelType, data, len, msgType); 92060ff233Sopenharmony_ci} 93060ff233Sopenharmony_ci 94060ff233Sopenharmony_ciint32_t ServerIpcQosReport(int32_t channelId, int32_t chanType, int32_t appType, int32_t quality) 95060ff233Sopenharmony_ci{ 96060ff233Sopenharmony_ci (void)channelId; 97060ff233Sopenharmony_ci (void)chanType; 98060ff233Sopenharmony_ci (void)appType; 99060ff233Sopenharmony_ci (void)quality; 100060ff233Sopenharmony_ci return SOFTBUS_NOT_IMPLEMENT; 101060ff233Sopenharmony_ci} 102060ff233Sopenharmony_ci 103060ff233Sopenharmony_ciint32_t ServerIpcGrantPermission(int uid, int pid, const char *sessionName) 104060ff233Sopenharmony_ci{ 105060ff233Sopenharmony_ci (void)uid; 106060ff233Sopenharmony_ci (void)pid; 107060ff233Sopenharmony_ci (void)sessionName; 108060ff233Sopenharmony_ci return SOFTBUS_NOT_IMPLEMENT; 109060ff233Sopenharmony_ci} 110060ff233Sopenharmony_ci 111060ff233Sopenharmony_ciint32_t ServerIpcRemovePermission(const char *sessionName) 112060ff233Sopenharmony_ci{ 113060ff233Sopenharmony_ci (void)sessionName; 114060ff233Sopenharmony_ci return SOFTBUS_NOT_IMPLEMENT; 115060ff233Sopenharmony_ci} 116060ff233Sopenharmony_ci 117060ff233Sopenharmony_ciint32_t ServerIpcStreamStats(int32_t channelId, int32_t channelType, const StreamSendStats *data) 118060ff233Sopenharmony_ci{ 119060ff233Sopenharmony_ci (void)channelId; 120060ff233Sopenharmony_ci (void)channelType; 121060ff233Sopenharmony_ci (void)data; 122060ff233Sopenharmony_ci return SOFTBUS_NOT_IMPLEMENT; 123060ff233Sopenharmony_ci} 124060ff233Sopenharmony_ci 125060ff233Sopenharmony_ciint32_t ServerIpcRippleStats(int32_t channelId, int32_t channelType, const TrafficStats *data) 126060ff233Sopenharmony_ci{ 127060ff233Sopenharmony_ci (void)channelId; 128060ff233Sopenharmony_ci (void)channelType; 129060ff233Sopenharmony_ci (void)data; 130060ff233Sopenharmony_ci return SOFTBUS_NOT_IMPLEMENT; 131060ff233Sopenharmony_ci} 132060ff233Sopenharmony_ci 133060ff233Sopenharmony_ciint32_t ServerIpcEvaluateQos(const char *peerNetworkId, TransDataType dataType, const QosTV *qos, uint32_t qosCount) 134060ff233Sopenharmony_ci{ 135060ff233Sopenharmony_ci (void)peerNetworkId; 136060ff233Sopenharmony_ci (void)dataType; 137060ff233Sopenharmony_ci (void)qos; 138060ff233Sopenharmony_ci (void)qosCount; 139060ff233Sopenharmony_ci return SOFTBUS_NOT_IMPLEMENT; 140060ff233Sopenharmony_ci}