1
1
Fork 0
forked from suyu/suyu

[WIP] sfdnsres: stub (#146)

sfdnsres: Add several stubs
This commit is contained in:
mailwl 2018-01-30 09:29:47 +03:00 committed by bunnei
parent 449e32bb81
commit eaa9f968a6
5 changed files with 52 additions and 2 deletions

View file

@ -145,6 +145,7 @@ add_library(core STATIC
hle/service/sm/sm.h
hle/service/sockets/bsd_u.cpp
hle/service/sockets/bsd_u.h
hle/service/sockets/sfdnsres.cpp
hle/service/sockets/sfdnsres.h
hle/service/sockets/sockets.cpp
hle/service/sockets/sockets.h

View file

@ -55,11 +55,22 @@ void BSD_U::SendTo(Kernel::HLERequestContext& ctx) {
rb.Push<u32>(0); // bsd errno
}
void BSD_U::Close(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); // ret
rb.Push<u32>(0); // bsd errno
}
BSD_U::BSD_U() : ServiceFramework("bsd:u") {
static const FunctionInfo functions[] = {{0, &BSD_U::RegisterClient, "RegisterClient"},
{2, &BSD_U::Socket, "Socket"},
{11, &BSD_U::SendTo, "SendTo"},
{14, &BSD_U::Connect, "Connect"}};
{14, &BSD_U::Connect, "Connect"},
{26, &BSD_U::Close, "Close"}};
RegisterHandlers(functions);
}

View file

@ -20,6 +20,7 @@ private:
void Socket(Kernel::HLERequestContext& ctx);
void Connect(Kernel::HLERequestContext& ctx);
void SendTo(Kernel::HLERequestContext& ctx);
void Close(Kernel::HLERequestContext& ctx);
/// Id to use for the next open file descriptor.
u32 next_fd = 1;

View file

@ -0,0 +1,36 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/sockets/sfdnsres.h"
namespace Service {
namespace Sockets {
void SFDNSRES::GetAddrInfo(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
LOG_WARNING(Service, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
SFDNSRES::SFDNSRES() : ServiceFramework("sfdnsres") {
static const FunctionInfo functions[] = {{0, nullptr, "SetDnsAddressesPrivate"},
{1, nullptr, "GetDnsAddressPrivate"},
{2, nullptr, "GetHostByName"},
{3, nullptr, "GetHostByAddr"},
{4, nullptr, "GetHostStringError"},
{5, nullptr, "GetGaiStringError"},
{6, &SFDNSRES::GetAddrInfo, "GetAddrInfo"},
{7, nullptr, "GetNameInfo"},
{8, nullptr, "RequestCancelHandle"},
{9, nullptr, "CancelSocketCall"}};
RegisterHandlers(functions);
}
} // namespace Sockets
} // namespace Service

View file

@ -12,10 +12,11 @@ namespace Sockets {
class SFDNSRES final : public ServiceFramework<SFDNSRES> {
public:
SFDNSRES() : ServiceFramework("sfdnsres") {}
SFDNSRES();
~SFDNSRES() = default;
private:
void GetAddrInfo(Kernel::HLERequestContext& ctx);
};
} // namespace Sockets