diff options
author | Liam <byteslice@airmail.cc> | 2023-02-19 20:42:12 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-03-01 16:39:49 +0100 |
commit | 65be230fdda302b25447f2f09b06e3238bd09e79 (patch) | |
tree | 68250d7bc8151041b236dcd79483df98938952cd /src/core/hle/service/sockets | |
parent | sm:: remove unused member (diff) | |
download | yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.gz yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.bz2 yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.lz yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.xz yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.zst yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.zip |
Diffstat (limited to 'src/core/hle/service/sockets')
-rw-r--r-- | src/core/hle/service/sockets/bsd.cpp | 66 | ||||
-rw-r--r-- | src/core/hle/service/sockets/bsd.h | 64 | ||||
-rw-r--r-- | src/core/hle/service/sockets/sfdnsres.cpp | 8 | ||||
-rw-r--r-- | src/core/hle/service/sockets/sfdnsres.h | 4 |
4 files changed, 71 insertions, 71 deletions
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 2789fa1ed..bce45d321 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -11,8 +11,8 @@ #include "common/microprofile.h" #include "common/socket_types.h" #include "core/core.h" -#include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_thread.h" +#include "core/hle/service/ipc_helpers.h" #include "core/hle/service/sockets/bsd.h" #include "core/hle/service/sockets/sockets_translate.h" #include "core/internal_network/network.h" @@ -42,7 +42,7 @@ void BSD::PollWork::Execute(BSD* bsd) { std::tie(ret, bsd_errno) = bsd->PollImpl(write_buffer, read_buffer, nfds, timeout); } -void BSD::PollWork::Response(Kernel::HLERequestContext& ctx) { +void BSD::PollWork::Response(HLERequestContext& ctx) { if (write_buffer.size() > 0) { ctx.WriteBuffer(write_buffer); } @@ -57,7 +57,7 @@ void BSD::AcceptWork::Execute(BSD* bsd) { std::tie(ret, bsd_errno) = bsd->AcceptImpl(fd, write_buffer); } -void BSD::AcceptWork::Response(Kernel::HLERequestContext& ctx) { +void BSD::AcceptWork::Response(HLERequestContext& ctx) { if (write_buffer.size() > 0) { ctx.WriteBuffer(write_buffer); } @@ -73,7 +73,7 @@ void BSD::ConnectWork::Execute(BSD* bsd) { bsd_errno = bsd->ConnectImpl(fd, addr); } -void BSD::ConnectWork::Response(Kernel::HLERequestContext& ctx) { +void BSD::ConnectWork::Response(HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 4}; rb.Push(ResultSuccess); rb.Push<s32>(bsd_errno == Errno::SUCCESS ? 0 : -1); @@ -84,7 +84,7 @@ void BSD::RecvWork::Execute(BSD* bsd) { std::tie(ret, bsd_errno) = bsd->RecvImpl(fd, flags, message); } -void BSD::RecvWork::Response(Kernel::HLERequestContext& ctx) { +void BSD::RecvWork::Response(HLERequestContext& ctx) { ctx.WriteBuffer(message); IPC::ResponseBuilder rb{ctx, 4}; @@ -97,7 +97,7 @@ void BSD::RecvFromWork::Execute(BSD* bsd) { std::tie(ret, bsd_errno) = bsd->RecvFromImpl(fd, flags, message, addr); } -void BSD::RecvFromWork::Response(Kernel::HLERequestContext& ctx) { +void BSD::RecvFromWork::Response(HLERequestContext& ctx) { ctx.WriteBuffer(message, 0); if (!addr.empty()) { ctx.WriteBuffer(addr, 1); @@ -114,7 +114,7 @@ void BSD::SendWork::Execute(BSD* bsd) { std::tie(ret, bsd_errno) = bsd->SendImpl(fd, flags, message); } -void BSD::SendWork::Response(Kernel::HLERequestContext& ctx) { +void BSD::SendWork::Response(HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 4}; rb.Push(ResultSuccess); rb.Push<s32>(ret); @@ -125,14 +125,14 @@ void BSD::SendToWork::Execute(BSD* bsd) { std::tie(ret, bsd_errno) = bsd->SendToImpl(fd, flags, message, addr); } -void BSD::SendToWork::Response(Kernel::HLERequestContext& ctx) { +void BSD::SendToWork::Response(HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 4}; rb.Push(ResultSuccess); rb.Push<s32>(ret); rb.PushEnum(bsd_errno); } -void BSD::RegisterClient(Kernel::HLERequestContext& ctx) { +void BSD::RegisterClient(HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 3}; @@ -141,7 +141,7 @@ void BSD::RegisterClient(Kernel::HLERequestContext& ctx) { rb.Push<s32>(0); // bsd errno } -void BSD::StartMonitoring(Kernel::HLERequestContext& ctx) { +void BSD::StartMonitoring(HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; @@ -149,7 +149,7 @@ void BSD::StartMonitoring(Kernel::HLERequestContext& ctx) { rb.Push(ResultSuccess); } -void BSD::Socket(Kernel::HLERequestContext& ctx) { +void BSD::Socket(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const u32 domain = rp.Pop<u32>(); const u32 type = rp.Pop<u32>(); @@ -166,7 +166,7 @@ void BSD::Socket(Kernel::HLERequestContext& ctx) { rb.PushEnum(bsd_errno); } -void BSD::Select(Kernel::HLERequestContext& ctx) { +void BSD::Select(HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 4}; @@ -176,7 +176,7 @@ void BSD::Select(Kernel::HLERequestContext& ctx) { rb.Push<u32>(0); // bsd errno } -void BSD::Poll(Kernel::HLERequestContext& ctx) { +void BSD::Poll(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 nfds = rp.Pop<s32>(); const s32 timeout = rp.Pop<s32>(); @@ -191,7 +191,7 @@ void BSD::Poll(Kernel::HLERequestContext& ctx) { }); } -void BSD::Accept(Kernel::HLERequestContext& ctx) { +void BSD::Accept(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -203,7 +203,7 @@ void BSD::Accept(Kernel::HLERequestContext& ctx) { }); } -void BSD::Bind(Kernel::HLERequestContext& ctx) { +void BSD::Bind(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -211,7 +211,7 @@ void BSD::Bind(Kernel::HLERequestContext& ctx) { BuildErrnoResponse(ctx, BindImpl(fd, ctx.ReadBuffer())); } -void BSD::Connect(Kernel::HLERequestContext& ctx) { +void BSD::Connect(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -223,7 +223,7 @@ void BSD::Connect(Kernel::HLERequestContext& ctx) { }); } -void BSD::GetPeerName(Kernel::HLERequestContext& ctx) { +void BSD::GetPeerName(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -241,7 +241,7 @@ void BSD::GetPeerName(Kernel::HLERequestContext& ctx) { rb.Push<u32>(static_cast<u32>(write_buffer.size())); } -void BSD::GetSockName(Kernel::HLERequestContext& ctx) { +void BSD::GetSockName(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -259,7 +259,7 @@ void BSD::GetSockName(Kernel::HLERequestContext& ctx) { rb.Push<u32>(static_cast<u32>(write_buffer.size())); } -void BSD::GetSockOpt(Kernel::HLERequestContext& ctx) { +void BSD::GetSockOpt(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); const u32 level = rp.Pop<u32>(); @@ -278,7 +278,7 @@ void BSD::GetSockOpt(Kernel::HLERequestContext& ctx) { rb.Push<u32>(static_cast<u32>(optval.size())); } -void BSD::Listen(Kernel::HLERequestContext& ctx) { +void BSD::Listen(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); const s32 backlog = rp.Pop<s32>(); @@ -288,7 +288,7 @@ void BSD::Listen(Kernel::HLERequestContext& ctx) { BuildErrnoResponse(ctx, ListenImpl(fd, backlog)); } -void BSD::Fcntl(Kernel::HLERequestContext& ctx) { +void BSD::Fcntl(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); const s32 cmd = rp.Pop<s32>(); @@ -304,7 +304,7 @@ void BSD::Fcntl(Kernel::HLERequestContext& ctx) { rb.PushEnum(bsd_errno); } -void BSD::SetSockOpt(Kernel::HLERequestContext& ctx) { +void BSD::SetSockOpt(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -328,7 +328,7 @@ void BSD::SetSockOpt(Kernel::HLERequestContext& ctx) { BuildErrnoResponse(ctx, SetSockOptImpl(fd, level, optname, optlen, optval)); } -void BSD::Shutdown(Kernel::HLERequestContext& ctx) { +void BSD::Shutdown(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -339,7 +339,7 @@ void BSD::Shutdown(Kernel::HLERequestContext& ctx) { BuildErrnoResponse(ctx, ShutdownImpl(fd, how)); } -void BSD::Recv(Kernel::HLERequestContext& ctx) { +void BSD::Recv(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -354,7 +354,7 @@ void BSD::Recv(Kernel::HLERequestContext& ctx) { }); } -void BSD::RecvFrom(Kernel::HLERequestContext& ctx) { +void BSD::RecvFrom(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -371,7 +371,7 @@ void BSD::RecvFrom(Kernel::HLERequestContext& ctx) { }); } -void BSD::Send(Kernel::HLERequestContext& ctx) { +void BSD::Send(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -386,7 +386,7 @@ void BSD::Send(Kernel::HLERequestContext& ctx) { }); } -void BSD::SendTo(Kernel::HLERequestContext& ctx) { +void BSD::SendTo(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); const u32 flags = rp.Pop<u32>(); @@ -402,7 +402,7 @@ void BSD::SendTo(Kernel::HLERequestContext& ctx) { }); } -void BSD::Write(Kernel::HLERequestContext& ctx) { +void BSD::Write(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -415,7 +415,7 @@ void BSD::Write(Kernel::HLERequestContext& ctx) { }); } -void BSD::Read(Kernel::HLERequestContext& ctx) { +void BSD::Read(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -427,7 +427,7 @@ void BSD::Read(Kernel::HLERequestContext& ctx) { rb.Push<u32>(0); // bsd errno } -void BSD::Close(Kernel::HLERequestContext& ctx) { +void BSD::Close(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const s32 fd = rp.Pop<s32>(); @@ -436,7 +436,7 @@ void BSD::Close(Kernel::HLERequestContext& ctx) { BuildErrnoResponse(ctx, CloseImpl(fd)); } -void BSD::EventFd(Kernel::HLERequestContext& ctx) { +void BSD::EventFd(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const u64 initval = rp.Pop<u64>(); const u32 flags = rp.Pop<u32>(); @@ -447,7 +447,7 @@ void BSD::EventFd(Kernel::HLERequestContext& ctx) { } template <typename Work> -void BSD::ExecuteWork(Kernel::HLERequestContext& ctx, Work work) { +void BSD::ExecuteWork(HLERequestContext& ctx, Work work) { work.Execute(this); work.Response(ctx); } @@ -862,7 +862,7 @@ bool BSD::IsFileDescriptorValid(s32 fd) const noexcept { return true; } -void BSD::BuildErrnoResponse(Kernel::HLERequestContext& ctx, Errno bsd_errno) const noexcept { +void BSD::BuildErrnoResponse(HLERequestContext& ctx, Errno bsd_errno) const noexcept { IPC::ResponseBuilder rb{ctx, 4}; rb.Push(ResultSuccess); diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h index 56bb3f8b1..30ae9c140 100644 --- a/src/core/hle/service/sockets/bsd.h +++ b/src/core/hle/service/sockets/bsd.h @@ -41,7 +41,7 @@ private: struct PollWork { void Execute(BSD* bsd); - void Response(Kernel::HLERequestContext& ctx); + void Response(HLERequestContext& ctx); s32 nfds; s32 timeout; @@ -53,7 +53,7 @@ private: struct AcceptWork { void Execute(BSD* bsd); - void Response(Kernel::HLERequestContext& ctx); + void Response(HLERequestContext& ctx); s32 fd; std::vector<u8> write_buffer; @@ -63,7 +63,7 @@ private: struct ConnectWork { void Execute(BSD* bsd); - void Response(Kernel::HLERequestContext& ctx); + void Response(HLERequestContext& ctx); s32 fd; std::span<const u8> addr; @@ -72,7 +72,7 @@ private: struct RecvWork { void Execute(BSD* bsd); - void Response(Kernel::HLERequestContext& ctx); + void Response(HLERequestContext& ctx); s32 fd; u32 flags; @@ -83,7 +83,7 @@ private: struct RecvFromWork { void Execute(BSD* bsd); - void Response(Kernel::HLERequestContext& ctx); + void Response(HLERequestContext& ctx); s32 fd; u32 flags; @@ -95,7 +95,7 @@ private: struct SendWork { void Execute(BSD* bsd); - void Response(Kernel::HLERequestContext& ctx); + void Response(HLERequestContext& ctx); s32 fd; u32 flags; @@ -106,7 +106,7 @@ private: struct SendToWork { void Execute(BSD* bsd); - void Response(Kernel::HLERequestContext& ctx); + void Response(HLERequestContext& ctx); s32 fd; u32 flags; @@ -116,32 +116,32 @@ private: Errno bsd_errno{}; }; - void RegisterClient(Kernel::HLERequestContext& ctx); - void StartMonitoring(Kernel::HLERequestContext& ctx); - void Socket(Kernel::HLERequestContext& ctx); - void Select(Kernel::HLERequestContext& ctx); - void Poll(Kernel::HLERequestContext& ctx); - void Accept(Kernel::HLERequestContext& ctx); - void Bind(Kernel::HLERequestContext& ctx); - void Connect(Kernel::HLERequestContext& ctx); - void GetPeerName(Kernel::HLERequestContext& ctx); - void GetSockName(Kernel::HLERequestContext& ctx); - void GetSockOpt(Kernel::HLERequestContext& ctx); - void Listen(Kernel::HLERequestContext& ctx); - void Fcntl(Kernel::HLERequestContext& ctx); - void SetSockOpt(Kernel::HLERequestContext& ctx); - void Shutdown(Kernel::HLERequestContext& ctx); - void Recv(Kernel::HLERequestContext& ctx); - void RecvFrom(Kernel::HLERequestContext& ctx); - void Send(Kernel::HLERequestContext& ctx); - void SendTo(Kernel::HLERequestContext& ctx); - void Write(Kernel::HLERequestContext& ctx); - void Read(Kernel::HLERequestContext& ctx); - void Close(Kernel::HLERequestContext& ctx); - void EventFd(Kernel::HLERequestContext& ctx); + void RegisterClient(HLERequestContext& ctx); + void StartMonitoring(HLERequestContext& ctx); + void Socket(HLERequestContext& ctx); + void Select(HLERequestContext& ctx); + void Poll(HLERequestContext& ctx); + void Accept(HLERequestContext& ctx); + void Bind(HLERequestContext& ctx); + void Connect(HLERequestContext& ctx); + void GetPeerName(HLERequestContext& ctx); + void GetSockName(HLERequestContext& ctx); + void GetSockOpt(HLERequestContext& ctx); + void Listen(HLERequestContext& ctx); + void Fcntl(HLERequestContext& ctx); + void SetSockOpt(HLERequestContext& ctx); + void Shutdown(HLERequestContext& ctx); + void Recv(HLERequestContext& ctx); + void RecvFrom(HLERequestContext& ctx); + void Send(HLERequestContext& ctx); + void SendTo(HLERequestContext& ctx); + void Write(HLERequestContext& ctx); + void Read(HLERequestContext& ctx); + void Close(HLERequestContext& ctx); + void EventFd(HLERequestContext& ctx); template <typename Work> - void ExecuteWork(Kernel::HLERequestContext& ctx, Work work); + void ExecuteWork(HLERequestContext& ctx, Work work); std::pair<s32, Errno> SocketImpl(Domain domain, Type type, Protocol protocol); std::pair<s32, Errno> PollImpl(std::vector<u8>& write_buffer, std::span<const u8> read_buffer, @@ -166,7 +166,7 @@ private: s32 FindFreeFileDescriptorHandle() noexcept; bool IsFileDescriptorValid(s32 fd) const noexcept; - void BuildErrnoResponse(Kernel::HLERequestContext& ctx, Errno bsd_errno) const noexcept; + void BuildErrnoResponse(HLERequestContext& ctx, Errno bsd_errno) const noexcept; std::array<std::optional<FileDescriptor>, MAX_FD> file_descriptors; diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp index e96eda7f3..132dd5797 100644 --- a/src/core/hle/service/sockets/sfdnsres.cpp +++ b/src/core/hle/service/sockets/sfdnsres.cpp @@ -8,7 +8,7 @@ #include "common/string_util.h" #include "common/swap.h" #include "core/core.h" -#include "core/hle/ipc_helpers.h" +#include "core/hle/service/ipc_helpers.h" #include "core/hle/service/sockets/sfdnsres.h" #include "core/memory.h" @@ -185,7 +185,7 @@ static std::vector<u8> SerializeAddrInfo(const addrinfo* addrinfo, s32 result_co return data; } -static std::pair<u32, s32> GetAddrInfoRequestImpl(Kernel::HLERequestContext& ctx) { +static std::pair<u32, s32> GetAddrInfoRequestImpl(HLERequestContext& ctx) { struct Parameters { u8 use_nsd_resolve; u32 unknown; @@ -221,7 +221,7 @@ static std::pair<u32, s32> GetAddrInfoRequestImpl(Kernel::HLERequestContext& ctx return std::make_pair(data_size, result_code); } -void SFDNSRES::GetAddrInfoRequest(Kernel::HLERequestContext& ctx) { +void SFDNSRES::GetAddrInfoRequest(HLERequestContext& ctx) { auto [data_size, result_code] = GetAddrInfoRequestImpl(ctx); IPC::ResponseBuilder rb{ctx, 4}; @@ -231,7 +231,7 @@ void SFDNSRES::GetAddrInfoRequest(Kernel::HLERequestContext& ctx) { rb.Push(data_size); // serialized size } -void SFDNSRES::GetAddrInfoRequestWithOptions(Kernel::HLERequestContext& ctx) { +void SFDNSRES::GetAddrInfoRequestWithOptions(HLERequestContext& ctx) { // Additional options are ignored auto [data_size, result_code] = GetAddrInfoRequestImpl(ctx); diff --git a/src/core/hle/service/sockets/sfdnsres.h b/src/core/hle/service/sockets/sfdnsres.h index 96018ea77..18e3cd60c 100644 --- a/src/core/hle/service/sockets/sfdnsres.h +++ b/src/core/hle/service/sockets/sfdnsres.h @@ -17,8 +17,8 @@ public: ~SFDNSRES() override; private: - void GetAddrInfoRequest(Kernel::HLERequestContext& ctx); - void GetAddrInfoRequestWithOptions(Kernel::HLERequestContext& ctx); + void GetAddrInfoRequest(HLERequestContext& ctx); + void GetAddrInfoRequestWithOptions(HLERequestContext& ctx); }; } // namespace Service::Sockets |