Start to implement/stub BSD:U and SFDNSRES services (#78)
* bsd: start stubbing bsd:u and sfdnsres * bsd: stubbed RegisterClient * bsd: attempt to get past socket() * bsd: fix some wrong assumptions about IPC * bsd: fix format specifiers * bsd: stubbed Connect() * bsd: stubbed SendTo() * made requested changes * sockets: respect alphabetical order at service installation * run clang-format * bsd: start stubbing bsd:u and sfdnsres * bsd: stubbed RegisterClient * bsd: attempt to get past socket() * bsd: fix some wrong assumptions about IPC * bsd: fix format specifiers * bsd: stubbed Connect() * bsd: stubbed SendTo() * made requested changes * sockets: respect alphabetical order at service installation * run clang-format * run clang-format (2)master
parent
2ff1cebfbe
commit
463356f0a7
@ -0,0 +1,67 @@
|
|||||||
|
// 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/bsd_u.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
namespace Sockets {
|
||||||
|
|
||||||
|
void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::RequestBuilder rb{ctx, 3};
|
||||||
|
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
rb.Push<u32>(0); // bsd errno
|
||||||
|
}
|
||||||
|
|
||||||
|
void BSD_U::Socket(Kernel::HLERequestContext& ctx) {
|
||||||
|
IPC::RequestParser rp{ctx};
|
||||||
|
|
||||||
|
u32 domain = rp.Pop<u32>();
|
||||||
|
u32 type = rp.Pop<u32>();
|
||||||
|
u32 protocol = rp.Pop<u32>();
|
||||||
|
|
||||||
|
LOG_WARNING(Service, "(STUBBED) called domain=%u type=%u protocol=%u", domain, type, protocol);
|
||||||
|
|
||||||
|
u32 fd = next_fd++;
|
||||||
|
|
||||||
|
IPC::RequestBuilder rb{ctx, 4};
|
||||||
|
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
rb.Push<u32>(fd);
|
||||||
|
rb.Push<u32>(0); // bsd errno
|
||||||
|
}
|
||||||
|
|
||||||
|
void BSD_U::Connect(Kernel::HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::RequestBuilder rb{ctx, 4};
|
||||||
|
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
rb.Push<u32>(0); // ret
|
||||||
|
rb.Push<u32>(0); // bsd errno
|
||||||
|
}
|
||||||
|
|
||||||
|
void BSD_U::SendTo(Kernel::HLERequestContext& ctx) {
|
||||||
|
LOG_WARNING(Service, "(STUBBED) called");
|
||||||
|
|
||||||
|
IPC::RequestBuilder 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"}};
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Sockets
|
||||||
|
} // namespace Service
|
@ -0,0 +1,29 @@
|
|||||||
|
// Copyright 2018 yuzu emulator team
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/kernel/hle_ipc.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
namespace Sockets {
|
||||||
|
|
||||||
|
class BSD_U final : public ServiceFramework<BSD_U> {
|
||||||
|
public:
|
||||||
|
BSD_U();
|
||||||
|
~BSD_U() = default;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void RegisterClient(Kernel::HLERequestContext& ctx);
|
||||||
|
void Socket(Kernel::HLERequestContext& ctx);
|
||||||
|
void Connect(Kernel::HLERequestContext& ctx);
|
||||||
|
void SendTo(Kernel::HLERequestContext& ctx);
|
||||||
|
|
||||||
|
/// Id to use for the next open file descriptor.
|
||||||
|
u32 next_fd = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Sockets
|
||||||
|
} // namespace Service
|
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright 2018 yuzu emulator team
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/kernel/hle_ipc.h"
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
namespace Sockets {
|
||||||
|
|
||||||
|
class SFDNSRES final : public ServiceFramework<SFDNSRES> {
|
||||||
|
public:
|
||||||
|
SFDNSRES() : ServiceFramework("sfdnsres") {}
|
||||||
|
~SFDNSRES() = default;
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Sockets
|
||||||
|
} // namespace Service
|
@ -0,0 +1,18 @@
|
|||||||
|
// Copyright 2018 yuzu emulator team
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include "core/hle/service/sockets/bsd_u.h"
|
||||||
|
#include "core/hle/service/sockets/sfdnsres.h"
|
||||||
|
#include "core/hle/service/sockets/sockets.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
namespace Sockets {
|
||||||
|
|
||||||
|
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||||
|
std::make_shared<BSD_U>()->InstallAsService(service_manager);
|
||||||
|
std::make_shared<SFDNSRES>()->InstallAsService(service_manager);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Sockets
|
||||||
|
} // namespace Service
|
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2018 yuzu emulator team
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
namespace Service {
|
||||||
|
namespace Sockets {
|
||||||
|
|
||||||
|
/// Registers all Sockets services with the specified service manager.
|
||||||
|
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||||
|
|
||||||
|
} // namespace Sockets
|
||||||
|
} // namespace Service
|
Loading…
Reference in New Issue