diff options
| author | Zephyron <zephyron@citron-emu.org> | 2025-04-15 17:19:53 +1000 |
|---|---|---|
| committer | Mike Lothian <mike@fireburn.co.uk> | 2025-05-12 12:46:19 +0100 |
| commit | ac997692134055d4a9540cd092dbb23e2198ec65 (patch) | |
| tree | 2533ea46e51d4cf2d4979337dfae6e339f2365ae /src/core/hle/service/sockets/bsd_nu.cpp | |
| parent | 8f48f0865b4283420e75b6cb13adf21b6c9ee9f9 (diff) | |
service/sockets: Implement network services for new firmware versions
This commit implements various network services required for newer firmware
versions. Key changes include:
- Add bsd:nu service for firmware 15.0.0+ with proper event handling
- Add bsdcfg implementation with complete interface declarations
- Add dns:priv and ethc (c/i) services
- Register all new services in the service manager
- Extend BSD implementation with additional socket operations
- Remove room_network instance variable in favor of system.GetRoomNetwork()
- Fix kernel event creation by using ServiceContext in all appropriate places
- Update build system to include new source files
Signed-off-by: Zephyron <zephyron@citron-emu.org>
Diffstat (limited to 'src/core/hle/service/sockets/bsd_nu.cpp')
| -rw-r--r-- | src/core/hle/service/sockets/bsd_nu.cpp | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/core/hle/service/sockets/bsd_nu.cpp b/src/core/hle/service/sockets/bsd_nu.cpp new file mode 100644 index 000000000..78919bf0c --- /dev/null +++ b/src/core/hle/service/sockets/bsd_nu.cpp @@ -0,0 +1,91 @@ +// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/ipc_helpers.h" +#include "core/hle/service/kernel_helpers.h" +#include "core/hle/service/sockets/bsd_nu.h" + +namespace Service::Sockets { + +ISfUserService::ISfUserService(Core::System& system_) + : ServiceFramework{system_, "ISfUserService"}, + service_context{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"); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface<ISfAssignedNetworkInterfaceService>(system); +} + +void ISfUserService::GetUserInfo(HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void ISfUserService::GetStateChangedEvent(HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + + auto* event = service_context.CreateEvent("ISfUserService:StateChanged"); + + IPC::ResponseBuilder rb{ctx, 2, 1}; + rb.Push(ResultSuccess); + rb.PushCopyObjects(event->GetReadableEvent()); +} + +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"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +BSD_NU::BSD_NU(Core::System& system_) : ServiceFramework{system_, "bsd:nu"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &BSD_NU::CreateUserService, "CreateUserService"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +BSD_NU::~BSD_NU() = default; + +void BSD_NU::CreateUserService(HLERequestContext& ctx) { + LOG_DEBUG(Service, "called"); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(ResultSuccess); + rb.PushIpcInterface<ISfUserService>(system); +} + +} // namespace Service::Sockets
\ No newline at end of file |
