From 262ee28611289848e7f1d8fdbab5333eb79924d1 Mon Sep 17 00:00:00 2001 From: Dima Date: Tue, 1 Nov 2022 20:29:40 +0300 Subject: [PATCH] Stub some bsd functions Co-authored-by: Lunar-Pixel <83507264+Lunar-Pixel@users.noreply.github.com> --- .../skyline/services/socket/bsd/IClient.cpp | 63 +++++++++++++ .../cpp/skyline/services/socket/bsd/IClient.h | 90 +++++++++++++++++++ 2 files changed, 153 insertions(+) diff --git a/app/src/main/cpp/skyline/services/socket/bsd/IClient.cpp b/app/src/main/cpp/skyline/services/socket/bsd/IClient.cpp index b2293ea9..316daaae 100644 --- a/app/src/main/cpp/skyline/services/socket/bsd/IClient.cpp +++ b/app/src/main/cpp/skyline/services/socket/bsd/IClient.cpp @@ -15,7 +15,70 @@ namespace skyline::service::socket { return {}; } + Result IClient::Select(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + Result IClient::Poll(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { return {}; } + + Result IClient::Recv(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::RecvFrom(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::Send(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::SendTo(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + response.Push(0); + return {}; + } + + Result IClient::Accept(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::Bind(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::Connect(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::Listen(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::SetSockOpt(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::Shutdown(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::ShutdownAllSockets(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::Write(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } + + Result IClient::Read(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + response.Push(0); + response.Push(0); + return {}; + } + + Result IClient::Close(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + return {}; + } } diff --git a/app/src/main/cpp/skyline/services/socket/bsd/IClient.h b/app/src/main/cpp/skyline/services/socket/bsd/IClient.h index dd423810..9ed6e0cb 100644 --- a/app/src/main/cpp/skyline/services/socket/bsd/IClient.h +++ b/app/src/main/cpp/skyline/services/socket/bsd/IClient.h @@ -25,15 +25,105 @@ namespace skyline::service::socket { */ Result StartMonitoring(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** + * @brief Selects the socket + */ + Result Select(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** * @brief Polls the socket for events */ Result Poll(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** + * @brief Receives message from the socket + */ + Result Recv(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Receives message from the socket + */ + Result RecvFrom(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Transmits one or more messages to the socket + */ + Result Send(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Transmits one or more messages to the socket + */ + Result SendTo(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Accepts a connection on the socket + */ + Result Accept(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Assigns the local protocol address to a socket + */ + Result Bind(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Initiates a connection on a socket + */ + Result Connect(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Places a socket in a state in which it is listening for an incoming connection + */ + Result Listen(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Manipulates the options associated with a socket + */ + Result SetSockOpt(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Shutdowns the socket + */ + Result Shutdown(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Shutdowns all sockets + */ + Result ShutdownAllSockets(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Writes to the socket + */ + Result Write(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Reads from the socket + */ + Result Read(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + + /** + * @brief Closes the socket + */ + Result Close(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + SERVICE_DECL( SFUNC(0x0, IClient, RegisterClient), SFUNC(0x1, IClient, StartMonitoring), + SFUNC(0x5, IClient, Select), SFUNC(0x6, IClient, Poll), + SFUNC(0x8, IClient, Recv), + SFUNC(0x9, IClient, RecvFrom), + SFUNC(0xA, IClient, Send), + SFUNC(0xB, IClient, SendTo), + SFUNC(0xC, IClient, Accept), + SFUNC(0xD, IClient, Bind), + SFUNC(0xE, IClient, Connect), + SFUNC(0x12, IClient, Listen), + SFUNC(0x15, IClient, SetSockOpt), + SFUNC(0x16, IClient, Shutdown), + SFUNC(0x17, IClient, ShutdownAllSockets), + SFUNC(0x18, IClient, Write), + SFUNC(0x19, IClient, Read), + SFUNC(0x1A, IClient, Close) ) }; }