• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 #include <iostream>
17 #include <cstring>
18 #include <thread>
19 #include <securec.h>
20 
21 #include "socket.h"
22 
23 constexpr int32_t DH_SUCCESS = 0;
Socket(SocketInfo info)24 int Socket(SocketInfo info)
25 {
26     (void)info;
27     return DH_SUCCESS;
28 }
29 
Listen(int32_t socket,const QosTV qos[],uint32_t qosCount,const ISocketListener * listener)30 int Listen(int32_t socket, const QosTV qos[], uint32_t qosCount, const ISocketListener *listener)
31 {
32     (void)socket;
33     (void)qos;
34     (void)qosCount;
35     (void)listener;
36     return DH_SUCCESS;
37 }
38 
Bind(int32_t socket,const QosTV qos[],uint32_t qosCount,const ISocketListener * listener)39 int Bind(int32_t socket, const QosTV qos[], uint32_t qosCount, const ISocketListener *listener)
40 {
41     (void)socket;
42     (void)qos;
43     (void)qosCount;
44     (void)listener;
45     return DH_SUCCESS;
46 }
47 
Shutdown(int32_t socket)48 void Shutdown(int32_t socket)
49 {
50     (void)socket;
51 }
52 
SendBytes(int32_t socket,const void * data,uint32_t len)53 int SendBytes(int32_t socket, const void *data, uint32_t len)
54 {
55     (void)socket;
56     (void)data;
57     (void)len;
58     return DH_SUCCESS;
59 }
60 
SendMessage(int32_t socket,const void * data,uint32_t len)61 int SendMessage(int32_t socket, const void *data, uint32_t len)
62 {
63     (void)socket;
64     (void)data;
65     (void)len;
66     return DH_SUCCESS;
67 }
68 
SendStream(int32_t socket,const StreamData * data,const StreamData * ext,const StreamFrameInfo * param)69 int SendStream(int32_t socket, const StreamData *data, const StreamData *ext, const StreamFrameInfo *param)
70 {
71     (void)socket;
72     (void)data;
73     (void)ext;
74     (void)param;
75     return DH_SUCCESS;
76 }
77 
SendFile(int32_t socket,const char * sFileList[],const char * dFileList[],uint32_t fileCnt)78 int SendFile(int32_t socket, const char *sFileList[], const char *dFileList[], uint32_t fileCnt)
79 {
80     (void)socket;
81     (void)sFileList;
82     (void)dFileList;
83     (void)fileCnt;
84     return DH_SUCCESS;
85 }
86 
EvaluateQos(const char * peerNetworkId,TransDataType dataType,const QosTV * qos,uint32_t qosCount)87 int32_t EvaluateQos(const char *peerNetworkId, TransDataType dataType, const QosTV *qos, uint32_t qosCount)
88 {
89     (void)peerNetworkId;
90     (void)dataType;
91     (void)qos;
92     (void)qosCount;
93     return DH_SUCCESS;
94 }