mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-03-30 16:08:26 -04:00
core/sockets: Add missing socket services and functions from switchbrew
- Add Unknown39 and Unknown40 functions to BSD service for [20.0.0+] - Implement bsd:nu service with ISfUserService and ISfAssignedNetworkInterfaceService - Add dns:priv and ethc:c/ethc:i service stubs - Update CMakeLists.txt to include new socket service files - All new functions include basic stub implementations following existing patterns This completes the socket services implementation based on switchbrew.org documentation. Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
87
src/core/hle/service/sockets/bsdnu.cpp
Normal file
87
src/core/hle/service/sockets/bsdnu.cpp
Normal file
@@ -0,0 +1,87 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/sockets/bsdnu.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/sockets/sockets.h"
|
||||
|
||||
namespace Service::Sockets {
|
||||
|
||||
ISfAssignedNetworkInterfaceService::ISfAssignedNetworkInterfaceService(Core::System& system_)
|
||||
: ServiceFramework{system_, "ISfAssignedNetworkInterfaceService"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ISfAssignedNetworkInterfaceService::AddSession, "AddSession"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
ISfAssignedNetworkInterfaceService::~ISfAssignedNetworkInterfaceService() = default;
|
||||
|
||||
void ISfAssignedNetworkInterfaceService::AddSession(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called AddSession");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
ISfUserService::ISfUserService(Core::System& system_) : ServiceFramework{system_, "ISfUserService"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ISfUserService::Assign, "Assign"},
|
||||
{128, &ISfUserService::GetUserInfo, "GetUserInfo"},
|
||||
{129, &ISfUserService::GetStateChangedEvent, "GetStateChangedEvent"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
ISfUserService::~ISfUserService() = default;
|
||||
|
||||
void ISfUserService::Assign(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called Assign");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<ISfAssignedNetworkInterfaceService>(system);
|
||||
}
|
||||
|
||||
void ISfUserService::GetUserInfo(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called GetUserInfo");
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<s32>(-1);
|
||||
rb.PushEnum(Errno::SUCCESS);
|
||||
}
|
||||
|
||||
void ISfUserService::GetStateChangedEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called GetStateChangedEvent");
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<s32>(-1);
|
||||
rb.PushEnum(Errno::SUCCESS);
|
||||
}
|
||||
|
||||
BSDNU::BSDNU(Core::System& system_) : ServiceFramework{system_, "bsd:nu"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &BSDNU::CreateUserService, "CreateUserService"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
BSDNU::~BSDNU() = default;
|
||||
|
||||
void BSDNU::CreateUserService(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called CreateUserService");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<ISfUserService>(system);
|
||||
}
|
||||
|
||||
} // namespace Service::Sockets
|
||||
Reference in New Issue
Block a user