From 9afa8b881ecdbe261e6c4d7549a1176d23c84bab Mon Sep 17 00:00:00 2001 From: Dima Date: Mon, 31 Oct 2022 18:38:46 +0300 Subject: [PATCH] Stub nsd:u/nsd:a and sfdnsres services --- app/CMakeLists.txt | 2 ++ app/src/main/cpp/skyline/services/serviceman.cpp | 5 +++++ .../cpp/skyline/services/socket/nsd/IManager.cpp | 8 ++++++++ .../cpp/skyline/services/socket/nsd/IManager.h | 16 ++++++++++++++++ .../services/socket/sfdnsres/IResolver.cpp | 8 ++++++++ .../skyline/services/socket/sfdnsres/IResolver.h | 16 ++++++++++++++++ 6 files changed, 55 insertions(+) create mode 100644 app/src/main/cpp/skyline/services/socket/nsd/IManager.cpp create mode 100644 app/src/main/cpp/skyline/services/socket/nsd/IManager.h create mode 100644 app/src/main/cpp/skyline/services/socket/sfdnsres/IResolver.cpp create mode 100644 app/src/main/cpp/skyline/services/socket/sfdnsres/IResolver.h diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 9c151c13..07c73308 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -363,6 +363,8 @@ add_library(skyline SHARED ${source_DIR}/skyline/services/nim/IShopServiceAccessServerInterface.cpp ${source_DIR}/skyline/services/nim/IShopServiceAsync.cpp ${source_DIR}/skyline/services/socket/bsd/IClient.cpp + ${source_DIR}/skyline/services/socket/nsd/IManager.cpp + ${source_DIR}/skyline/services/socket/sfdnsres/IResolver.cpp ${source_DIR}/skyline/services/spl/IRandomInterface.cpp ${source_DIR}/skyline/services/ssl/ISslService.cpp ${source_DIR}/skyline/services/ssl/ISslContext.cpp diff --git a/app/src/main/cpp/skyline/services/serviceman.cpp b/app/src/main/cpp/skyline/services/serviceman.cpp index 467433f0..96258ba2 100644 --- a/app/src/main/cpp/skyline/services/serviceman.cpp +++ b/app/src/main/cpp/skyline/services/serviceman.cpp @@ -41,6 +41,8 @@ #include "nifm/IStaticService.h" #include "nim/IShopServiceAccessServerInterface.h" #include "socket/bsd/IClient.h" +#include "socket/nsd/IManager.h" +#include "socket/sfdnsres/IResolver.h" #include "spl/IRandomInterface.h" #include "ssl/ISslService.h" #include "prepo/IPrepoService.h" @@ -114,6 +116,9 @@ namespace skyline::service { SERVICE_CASE(nfp::IUserManager, "nfp:user") SERVICE_CASE(nifm::IStaticService, "nifm:u") SERVICE_CASE(socket::IClient, "bsd:u") + SERVICE_CASE(socket::IManager, "nsd:u") + SERVICE_CASE(socket::IManager, "nsd:a") + SERVICE_CASE(socket::IResolver, "sfdnsres") SERVICE_CASE(spl::IRandomInterface, "csrng") SERVICE_CASE(ssl::ISslService, "ssl") SERVICE_CASE(prepo::IPrepoService, "prepo:u") diff --git a/app/src/main/cpp/skyline/services/socket/nsd/IManager.cpp b/app/src/main/cpp/skyline/services/socket/nsd/IManager.cpp new file mode 100644 index 00000000..bee2c293 --- /dev/null +++ b/app/src/main/cpp/skyline/services/socket/nsd/IManager.cpp @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#include "IManager.h" + +namespace skyline::service::socket { + IManager::IManager(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {} +} diff --git a/app/src/main/cpp/skyline/services/socket/nsd/IManager.h b/app/src/main/cpp/skyline/services/socket/nsd/IManager.h new file mode 100644 index 00000000..cf29b075 --- /dev/null +++ b/app/src/main/cpp/skyline/services/socket/nsd/IManager.h @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#pragma once + +#include + +namespace skyline::service::socket { + /** + * @url https://switchbrew.org/wiki/Sockets_services#nsd:u.2C_nsd:a + */ + class IManager : public BaseService { + public: + IManager(const DeviceState &state, ServiceManager &manager); + }; +} diff --git a/app/src/main/cpp/skyline/services/socket/sfdnsres/IResolver.cpp b/app/src/main/cpp/skyline/services/socket/sfdnsres/IResolver.cpp new file mode 100644 index 00000000..34adbbd6 --- /dev/null +++ b/app/src/main/cpp/skyline/services/socket/sfdnsres/IResolver.cpp @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#include "IResolver.h" + +namespace skyline::service::socket { + IResolver::IResolver(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {} +} diff --git a/app/src/main/cpp/skyline/services/socket/sfdnsres/IResolver.h b/app/src/main/cpp/skyline/services/socket/sfdnsres/IResolver.h new file mode 100644 index 00000000..37734d56 --- /dev/null +++ b/app/src/main/cpp/skyline/services/socket/sfdnsres/IResolver.h @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#pragma once + +#include + +namespace skyline::service::socket { + /** + * @url https://switchbrew.org/wiki/Sockets_services#sfdnsres + */ + class IResolver : public BaseService { + public: + IResolver(const DeviceState &state, ServiceManager &manager); + }; +}