/base/security/device_security_level/test/dslm_unit_test/ |
H A D | dslm_test_link.c | 17 #include "socket.h" 29 void UtRemoveSocketNode(int32_t socket, ShutdownReason reason, bool isServer) in UtRemoveSocketNode() argument 31 RemoveSocketNode(socket, reason, isServer); in UtRemoveSocketNode() 39 bool UtGetIdentityBySocketId(int32_t socket, bool isServer, DeviceIdentify *identity) in UtGetIdentityBySocketId() argument 41 return GetIdentityBySocketId(socket, isServer, identity); in UtGetIdentityBySocketId() 44 void UtServerOnBind(int32_t socket, PeerSocketInfo info) in UtServerOnBind() argument 46 ServerOnBind(socket, info); in UtServerOnBind() 49 void UtClientOnBind(int socket, const DeviceIdentify *devId) in UtClientOnBind() argument 51 ClientOnBind(socket, devId); in UtClientOnBind() 54 void UtServerOnShutdown(int32_t socket, ShutdownReaso argument 59 UtClientOnShutdown(int32_t socket, ShutdownReason reason) UtClientOnShutdown() argument 69 UtCreateOrRestartSocketCloseTimerWithLock(int32_t socket) UtCreateOrRestartSocketCloseTimerWithLock() argument 74 UtGetIdentityByServerSocket(int32_t socket, DeviceIdentify *identity) UtGetIdentityByServerSocket() argument 79 UtGetIdentityByClientSocket(int32_t socket, DeviceIdentify *identity) UtGetIdentityByClientSocket() argument 84 UtCreateSocketNodeInfo(int32_t socket, const DeviceIdentify *identity) UtCreateSocketNodeInfo() argument 89 UtServerOnBytes(int32_t socket, const void *data, unsigned int dataLen) UtServerOnBytes() argument 94 UtClientOnBytes(int32_t socket, const void *data, unsigned int dataLen) UtClientOnBytes() argument 104 UtBindSync(int32_t socket, const DeviceIdentify *devId) UtBindSync() argument 114 UtGetSocketBySocketList(const DeviceIdentify *devId, bool isServer, int32_t *socket) UtGetSocketBySocketList() argument [all...] |
H A D | dslm_test_link.h | 37 void UtRemoveSocketNode(int32_t socket, ShutdownReason reason, bool isServer); 41 bool UtGetIdentityBySocketId(int32_t socket, bool isServer, DeviceIdentify *identity); 43 void UtServerOnBind(int32_t socket, PeerSocketInfo info); 45 void UtClientOnBind(int socket, const DeviceIdentify *devId); 47 void UtServerOnShutdown(int32_t socket, ShutdownReason reason); 49 void UtClientOnShutdown(int32_t socket, ShutdownReason reason); 53 void UtCreateOrRestartSocketCloseTimerWithLock(int32_t socket); 55 bool UtGetIdentityByServerSocket(int32_t socket, DeviceIdentify *identity); 57 bool UtGetIdentityByClientSocket(int32_t socket, DeviceIdentify *identity); 59 SocketNodeInfo *UtCreateSocketNodeInfo(int32_t socket, cons [all...] |
H A D | dslm_msg_interface_mock.h | 22 #include "socket.h" 48 virtual int32_t Listen(int32_t socket, const QosTV qos[], uint32_t qosCount, const ISocketListener *listener) = 0; 50 virtual int32_t Bind(int32_t socket, const QosTV qos[], uint32_t qosCount, const ISocketListener *listener) = 0; 52 virtual int32_t SendBytes(int32_t socket, const void *data, uint32_t len) = 0; 54 virtual void Shutdown(int32_t socket) = 0; 72 (int32_t socket, const QosTV qos[], uint32_t qosCount, const ISocketListener *listener), (override)); 73 MOCK_METHOD(int32_t, Bind, (int32_t socket, const QosTV qos[], uint32_t qosCount, 75 MOCK_METHOD(int32_t, SendBytes, (int32_t socket, const void *data, uint32_t len), (override)); 76 MOCK_METHOD(void, Shutdown, (int32_t socket), (override));
|
H A D | dslm_msg_interface_mock.cpp | 147 int32_t SendBytes(int32_t socket, const void *data, uint32_t len) in SendBytes() argument 149 static_cast<void>(socket); in SendBytes() 155 int32_t Bind(int32_t socket, const QosTV qos[], uint32_t qosCount, const ISocketListener *listener) in Bind() argument 158 return interface->Bind(socket, qos, qosCount, listener); in Bind() 163 void Shutdown(int32_t socket) in Shutdown() argument 166 interface->Shutdown(socket); in Shutdown() 170 int32_t Listen(int32_t socket, const QosTV qos[], uint32_t qosCount, const ISocketListener *listener) in Listen() argument 173 return interface->Listen(socket, qos, qosCount, listener); in Listen()
|
/base/security/access_token/services/tokensyncmanager/src/remote/ |
H A D | soft_bus_socket_listener.cpp | 21 #include "socket.h" 37 void SoftBusSocketListener::OnBind(int32_t socket, PeerSocketInfo info) in OnBind() argument 39 ACCESSTOKEN_LOG_INFO(LABEL, "Socket fd is %{public}d.", socket); in OnBind() 41 if (socket <= Constant::INVALID_SOCKET_FD) { in OnBind() 48 auto iter = socketBindMap_.find(socket); in OnBind() 50 socketBindMap_.insert(std::pair<int32_t, std::string>(socket, peerNetworkId)); in OnBind() 56 void SoftBusSocketListener::OnShutdown(int32_t socket, ShutdownReason reason) in OnShutdown() argument 58 ACCESSTOKEN_LOG_INFO(LABEL, "Socket fd %{public}d shutdown because %{public}u.", socket, reason); in OnShutdown() 60 if (socket <= Constant::INVALID_SOCKET_FD) { in OnShutdown() 67 auto iter = socketBindMap_.find(socket); in OnShutdown() 73 GetNetworkIdBySocket(const int32_t socket, std::string& networkId) GetNetworkIdBySocket() argument 89 OnClientBytes(int32_t socket, const void *data, uint32_t dataLen) OnClientBytes() argument 114 OnServiceBytes(int32_t socket, const void *data, uint32_t dataLen) OnServiceBytes() argument [all...] |
H A D | soft_bus_channel.cpp | 72 int socket = SoftBusManager::GetInstance().BindService(deviceId_); in BuildConnection() local 73 if (socket == Constant::INVALID_SOCKET_FD) { in BuildConnection() 77 socketFd_ = socket; in BuildConnection() 107 ACCESSTOKEN_LOG_DEBUG(LABEL, "Socket is in using, cancel close socket"); in CloseConnection() 111 ACCESSTOKEN_LOG_INFO(LABEL, "Close socket for device: %{public}s", in CloseConnection() 117 ACCESSTOKEN_LOG_DEBUG(LABEL, "Close socket after %{public}d ms", WAIT_SESSION_CLOSE_MILLISECONDS); in CloseConnection() 212 void SoftBusChannel::HandleDataReceived(int socket, const unsigned char *bytes, int length) in HandleDataReceived() argument 218 if (socket <= 0 || length <= 0) { in HandleDataReceived() 219 ACCESSTOKEN_LOG_ERROR(LABEL, "Invalid params: socket: %{public}d, data length: %{public}d", socket, lengt in HandleDataReceived() 351 int socket = SoftBusManager::GetInstance().BindService(deviceId_); CheckSessionMayReopenLocked() local 376 HandleRequest(int socket, const std::string &id, const std::string &commandName, const std::string &jsonPayload) HandleRequest() argument 444 SendResponseBytes(int socket, const unsigned char *bytes, const int bytesLength) SendResponseBytes() argument [all...] |
/base/security/device_security_level/baselib/msglib/src/standard/ |
H A D | messenger_device_socket_manager.c | 21 #include "socket.h" 61 int32_t socket; member 140 static void RemoveSocketNode(int32_t socket, ShutdownReason reason, bool isServer) in RemoveSocketNode() argument 150 if (info->socket == socket) { in RemoveSocketNode() 159 static void ServerOnShutdown(int32_t socket, ShutdownReason reason) in ServerOnShutdown() argument 161 if (socket == 0) { in ServerOnShutdown() 164 RemoveSocketNode(socket, reason, true); in ServerOnShutdown() 167 static void ClientOnShutdown(int32_t socket, ShutdownReason reason) in ClientOnShutdown() argument 169 if (socket in ClientOnShutdown() 185 uint32_t socket = (uint32_t)input; TimerProcessWaitingTimeOut() local 193 CreateOrRestartSocketCloseTimer(int32_t socket) CreateOrRestartSocketCloseTimer() argument 219 CreateOrRestartSocketCloseTimerWithLock(int32_t socket) CreateOrRestartSocketCloseTimerWithLock() argument 228 GetIdentityBySocketId(int32_t socket, bool isServer, DeviceIdentify *identity) GetIdentityBySocketId() argument 255 GetIdentityByServerSocket(int32_t socket, DeviceIdentify *identity) GetIdentityByServerSocket() argument 260 GetIdentityByClientSocket(int32_t socket, DeviceIdentify *identity) GetIdentityByClientSocket() argument 265 CreateSocketNodeInfo(int32_t socket, const DeviceIdentify *identity) CreateSocketNodeInfo() argument 288 ProcessBindDevice(int socket, const DeviceIdentify *devId, bool isServer) ProcessBindDevice() argument 329 ServerOnBind(int32_t socket, PeerSocketInfo info) ServerOnBind() argument 339 ClientOnBind(int socket, const DeviceIdentify *devId) ClientOnBind() argument 344 ServerOnBytes(int32_t socket, const void *data, unsigned int dataLen) ServerOnBytes() argument 361 ClientOnBytes(int32_t socket, const void *data, unsigned int dataLen) ClientOnBytes() argument 414 int32_t socket = Socket(socketInfo); ProcessCreateServer() local 437 int32_t socket = 0; CreateServer() local 516 GetSocketBySocketList(const DeviceIdentify *devId, bool isServer, int32_t *socket) GetSocketBySocketList() argument 541 GetSocketByClientSocketList(const DeviceIdentify *devId, int32_t *socket) GetSocketByClientSocketList() argument 579 ClientOnFakeBind(int32_t socket, PeerSocketInfo info) ClientOnFakeBind() argument 584 BindSync(int32_t socket, const DeviceIdentify *devId) BindSync() argument 676 int32_t socket = Socket(socketInfo); PrepareBindSocket() local 698 int32_t socket = 0; BindSyncWithPthread() local 748 int32_t socket = 0; MessengerSendMsgTo() local [all...] |
/base/telephony/call_manager/services/distributed_call/src/transmission/ |
H A D | client_session.cpp | 31 TELEPHONY_LOGI("client socket %{public}d already connect", socket_); in Connect() 35 int32_t socket = CreateSocket(peerDevId, localName, peerName); in Connect() local 36 if (socket <= INVALID_SOCKET_ID) { in Connect() 43 int32_t ret = BindAsync(socket, qos, sizeof(qos) / sizeof(qos[0]), &listener_); in Connect() 44 TELEPHONY_LOGI("async bind socket %{public}d result %{public}d", socket, ret); in Connect() 52 TELEPHONY_LOGI("close client socket %{public}d success", socket_); in Disconnect() 57 void ClientSession::OnSessionBind(int32_t socket) in OnSessionBind() argument 61 socket_ = socket; in OnSessionBind() 63 TELEPHONY_LOGI("session %{public}d bind success", socket); in OnSessionBind() 69 OnSessionShutdown(int32_t socket) OnSessionShutdown() argument 91 int32_t socket = Socket(socketInfo); CreateSocket() local [all...] |
H A D | server_session.cpp | 29 TELEPHONY_LOGE("create server socket fail, empty local name"); in Create() 35 TELEPHONY_LOGI("server socket %{public}d already exist", serverSocket_); in Create() 47 int32_t socket = Socket(socketInfo); in Create() local 48 if (socket <= INVALID_SOCKET_ID) { in Create() 49 TELEPHONY_LOGE("create server socket fail %{public}d", socket); in Create() 57 int32_t ret = Listen(socket, qos, sizeof(qos) / sizeof(qos[0]), &listener_); in Create() 59 TELEPHONY_LOGE("start listen socket %{public}d fail, result %{public}d", socket, ret); in Create() 62 TELEPHONY_LOGI("create server socket in Create() 78 OnSessionBind(int32_t socket) OnSessionBind() argument 93 OnSessionShutdown(int32_t socket) OnSessionShutdown() argument [all...] |
H A D | session_adapter.cpp | 43 int32_t socket = INVALID_SOCKET_ID; in SendMsg() local 47 TELEPHONY_LOGE("send msg fail, invalid socket %{public}d", socket_); in SendMsg() 50 socket = socket_; in SendMsg() 52 int32_t ret = SendBytes(socket, data, len); in SendMsg() 54 TELEPHONY_LOGE("send socket %{public}d msg fail, result %{public}d", socket, ret); in SendMsg() 58 void SessionAdapter::OnReceiveMsg(int32_t socket, const char* data, uint32_t dataLen) in OnReceiveMsg() argument 62 if (socket != socket_) { in OnReceiveMsg() 63 TELEPHONY_LOGW("socket %{public}d not match %{public}d", socket, socket in OnReceiveMsg() 72 OnBind(int32_t socket, PeerSocketInfo info) OnBind() argument 81 OnShutdown(int32_t socket, ShutdownReason reason) OnShutdown() argument 90 OnBytes(int32_t socket, const void *data, uint32_t dataLen) OnBytes() argument 98 OnError(int32_t socket, int32_t errCode) OnError() argument [all...] |
H A D | transmission_manager.cpp | 57 void TransmissionManager::OnBind(int32_t socket) in OnBind() argument 65 session->OnSessionBind(socket); in OnBind() 69 void TransmissionManager::OnShutdown(int32_t socket) in OnShutdown() argument 77 session->OnSessionShutdown(socket); in OnShutdown() 81 void TransmissionManager::OnReceiveMsg(int32_t socket, const char* data, uint32_t dataLen) in OnReceiveMsg() argument 89 session->OnReceiveMsg(socket, data, dataLen); in OnReceiveMsg()
|
/base/security/access_token/services/tokensyncmanager/test/mock/include/ |
H A D | socket.h | 31 * @file socket.h 35 * This file provides data transmission capabilities, including creating and removing a socket server, 36 * opening and closing sessions, receiving data, and querying basic socket information. \n 72 * @brief Defines the description of the socket. 78 char *name; /**< My socket name */ 79 char *peerName; /**< Peer socket name */ 86 * @brief Defines the description of the socket. 92 char *name; /**< Peer socket name */ 95 TransDataType dataType; /**< Data type of peer socket*/ 238 * @brief Defines socket callback [all...] |
/base/security/access_token/services/tokensyncmanager/include/remote/ |
H A D | soft_bus_socket_listener.h | 23 #include "socket.h"
30 static void OnBind(int32_t socket, PeerSocketInfo info);
31 static void OnShutdown(int32_t socket, ShutdownReason reason);
32 static void OnClientBytes(int32_t socket, const void *data, uint32_t dataLen);
33 static void OnServiceBytes(int32_t socket, const void *data, uint32_t dataLen);
35 static void OnQos(int32_t socket, QoSEvent eventId, const QosTV *qos, uint32_t qosCount) {};
in OnQos() argument 42 static bool GetNetworkIdBySocket(const int32_t socket, std::string& networkId);
|
/base/msdp/device_status/intention/adapters/dsoftbus_adapter/src/ |
H A D | dsoftbus_adapter_impl.cpp | 194 int32_t socket = FindConnection(networkId); in SendPacket() local 195 if (socket < 0) { in SendPacket() 208 int32_t ret = ::SendBytes(socket, buffer.Data(), buffer.Size()); in SendPacket() 220 int32_t socket = FindConnection(networkId); in SendParcel() local 221 if (socket < 0) { in SendParcel() 225 int32_t ret = ::SendBytes(socket, reinterpret_cast<const void*>(parcel.GetData()), parcel.GetDataSize()); in SendParcel() 251 int32_t socket = elem.second.socket_; in BroadcastPacket() local 252 if (socket < 0) { in BroadcastPacket() 256 if (int32_t ret = ::SendBytes(socket, buffer.Data(), buffer.Size()); ret != SOFTBUS_OK) { in BroadcastPacket() 272 static void OnBindLink(int32_t socket, PeerSocketInf argument 277 OnShutdownLink(int32_t socket, ShutdownReason reason) OnShutdownLink() argument 282 OnBytesAvailable(int32_t socket, const void *data, uint32_t dataLen) OnBytesAvailable() argument 287 OnBind(int32_t socket, PeerSocketInfo info) OnBind() argument 314 OnShutdown(int32_t socket, ShutdownReason reason) OnShutdown() argument 340 OnBytes(int32_t socket, const void *data, uint32_t dataLen) OnBytes() argument 366 InitSocket(SocketInfo info, int32_t socketType, int32_t &socket) InitSocket() argument 504 ConfigTcpAlive(int32_t socket) ConfigTcpAlive() argument [all...] |
/base/startup/init/services/modules/init_context/ |
H A D | init_context.c | 24 #include <sys/socket.h> 46 static int CreateSocketPair(int socket[2]); 54 close(arg->socket[0]); in SubInitRun() 56 SubInitMain(arg->type, arg->socket[1], arg->socket[1]); in SubInitRun() 57 close(arg->socket[1]); in SubInitRun() 85 int ret = CreateSocketPair(arg.socket); in SubInitStart() 86 PLUGIN_CHECK(ret == 0, return -1, "Failed to create socket for %d", type); in SubInitStart() 91 close(arg.socket[0]); in SubInitStart() 92 close(arg.socket[ in SubInitStart() 156 CreateSocketPair(int socket[2]) CreateSocketPair() argument [all...] |
/base/telephony/call_manager/services/distributed_call/include/transmission/ |
H A D | session_adapter.h | 21 #include "transport/socket.h" 48 virtual void OnSessionBind(int32_t socket) = 0; 49 virtual void OnSessionShutdown(int32_t socket) = 0; 53 void OnReceiveMsg(int32_t socket, const char* data, uint32_t dataLen); 55 static void OnBind(int32_t socket, PeerSocketInfo info); 56 static void OnShutdown(int32_t socket, ShutdownReason reason); 57 static void OnBytes(int32_t socket, const void *data, uint32_t dataLen); 58 static void OnError(int32_t socket, int32_t errCode);
|
H A D | transmission_manager.h | 31 void OnBind(int32_t socket); 32 void OnShutdown(int32_t socket); 33 void OnReceiveMsg(int32_t socket, const char* data, uint32_t dataLen);
|
/base/msdp/device_status/intention/adapters/dsoftbus_adapter/include/ |
H A D | dsoftbus_adapter_impl.h | 23 #include "socket.h" 58 Session(int32_t socket) : socket_(socket) {} in Session() 88 void OnBind(int32_t socket, PeerSocketInfo info); 89 void OnShutdown(int32_t socket, ShutdownReason reason); 90 void OnBytes(int32_t socket, const void *data, uint32_t dataLen); 96 int32_t InitSocket(SocketInfo info, int32_t socketType, int32_t &socket); 102 void ConfigTcpAlive(int32_t socket);
|
/base/tee/tee_client/services/teecd/include/ |
H A D | tee_ca_auth.h | 15 #include <sys/socket.h>
19 int RecvCaMsg(int socket, CaRevMsg *caInfo);
|
/base/msdp/device_status/intention/ipc/socket/src/ |
H A D | socket_client.cpp | 64 auto socket = SocketConnection::Connect( in Connect() local 68 CHKPF(socket); in Connect() 70 auto errCode = eventHandler_->AddFileDescriptorListener(socket->GetFd(), in Connect() 71 AppExecFwk::FILE_DESCRIPTOR_INPUT_EVENT, socket, "DeviceStatusTask"); in Connect() 73 FI_HILOGE("AddFileDescriptorListener(%{public}d) failed (%{public}u)", socket->GetFd(), errCode); in Connect() 76 socket_ = socket; in Connect()
|
H A D | socket_connection.cpp | 18 #include <sys/socket.h> 44 std::shared_ptr<SocketConnection> SocketConnection::Connect(std::function<int32_t()> socket, in Connect() argument 48 CHKPP(socket); in Connect() 49 int32_t sockFd = socket(); in Connect()
|
/base/security/device_security_level/test/dslm_fuzz_test/mock/ |
H A D | mock.cpp | 19 #include "socket.h" 29 int32_t Listen(int32_t socket, const QosTV qos[], uint32_t qosCount, const ISocketListener *listener) in Listen() argument 34 void Shutdown(int32_t socket) in Shutdown() argument
|
/base/hiviewdfx/hilog/frameworks/libhilog/socket/ |
H A D | socket.cpp | 16 #include "socket.h" 20 #include <sys/socket.h> 50 int tmpFd = TEMP_FAILURE_RETRY(socket(AF_UNIX, socketType, 0)); in GenerateFD() 53 res = TEMP_FAILURE_RETRY(socket(AF_UNIX, socketType, 0)); in GenerateFD() 65 int fd = TEMP_FAILURE_RETRY(socket(AF_UNIX, socketType, 0)); in Create() 68 std::cout << "Create socket failed: " << fd << std::endl; in Create()
|
/base/tee/tee_client/services/teecd/src/ |
H A D | tee_ca_auth.c | 83 int RecvCaMsg(int socket, CaRevMsg *caInfo)
in RecvCaMsg() argument 113 FD_SET(socket, &fds);
in RecvCaMsg() 114 ret = select(socket + 1, &fds, NULL, NULL, &timeout);
in RecvCaMsg() 116 tloge("teecd socket timeout or err, err=%d.\n", errno);
in RecvCaMsg() 119 ret = (int)recvmsg(socket, &message, 0);
in RecvCaMsg()
|
/base/msdp/device_status/test/fuzztest/dsoftbusadapter_fuzzer/ |
H A D | dsoftbusadapter_fuzzer.cpp | 181 int32_t socket = GetData<int32_t>(); in InitSocketFuzzTest() local 184 int32_t *g_data = new int32_t(socket); in InitSocketFuzzTest() 194 DSoftbusAdapterImpl::GetInstance()->InitSocket(info, socket, socket); in InitSocketFuzzTest() 195 DSoftbusAdapterImpl::GetInstance()->ConfigTcpAlive(socket); in InitSocketFuzzTest() 196 DSoftbusAdapterImpl::GetInstance()->OnShutdown(socket, SHUTDOWN_REASON_UNKNOWN); in InitSocketFuzzTest() 197 DSoftbusAdapterImpl::GetInstance()->OnBytes(socket, g_data, dataLen); in InitSocketFuzzTest()
|