diff options
author | Lioncash <mathew1800@gmail.com> | 2018-07-26 07:16:08 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-07-26 07:48:06 +0200 |
commit | 8781beaf0d2cdb2889697c6919277c24e5e6e7b1 (patch) | |
tree | caf20b7b78428a802b9a89dfc16e9c38ff019096 /src/core/hle/service/ldn | |
parent | Merge pull request #828 from lioncash/ldr (diff) | |
download | yuzu-8781beaf0d2cdb2889697c6919277c24e5e6e7b1.tar yuzu-8781beaf0d2cdb2889697c6919277c24e5e6e7b1.tar.gz yuzu-8781beaf0d2cdb2889697c6919277c24e5e6e7b1.tar.bz2 yuzu-8781beaf0d2cdb2889697c6919277c24e5e6e7b1.tar.lz yuzu-8781beaf0d2cdb2889697c6919277c24e5e6e7b1.tar.xz yuzu-8781beaf0d2cdb2889697c6919277c24e5e6e7b1.tar.zst yuzu-8781beaf0d2cdb2889697c6919277c24e5e6e7b1.zip |
Diffstat (limited to 'src/core/hle/service/ldn')
-rw-r--r-- | src/core/hle/service/ldn/ldn.cpp | 142 | ||||
-rw-r--r-- | src/core/hle/service/ldn/ldn.h | 16 |
2 files changed, 158 insertions, 0 deletions
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp new file mode 100644 index 000000000..167f2c66a --- /dev/null +++ b/src/core/hle/service/ldn/ldn.cpp @@ -0,0 +1,142 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <memory> + +#include "core/hle/ipc_helpers.h" +#include "core/hle/result.h" +#include "core/hle/service/ldn/ldn.h" +#include "core/hle/service/sm/sm.h" + +namespace Service::LDN { + +class IMonitorService final : public ServiceFramework<IMonitorService> { +public: + explicit IMonitorService() : ServiceFramework{"IMonitorService"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetStateForMonitor"}, + {1, nullptr, "GetNetworkInfoForMonitor"}, + {2, nullptr, "GetIpv4AddressForMonitor"}, + {3, nullptr, "GetDisconnectReasonForMonitor"}, + {4, nullptr, "GetSecurityParameterForMonitor"}, + {5, nullptr, "GetNetworkConfigForMonitor"}, + {100, nullptr, "InitializeMonitor"}, + {101, nullptr, "FinalizeMonitor"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class LDNM final : public ServiceFramework<LDNM> { +public: + explicit LDNM() : ServiceFramework{"ldn:m"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &LDNM::CreateMonitorService, "CreateMonitorService"} + }; + // clang-format on + + RegisterHandlers(functions); + } + + void CreateMonitorService(Kernel::HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<IMonitorService>(); + + LOG_DEBUG(Service_LDN, "called"); + } +}; + +class ILocalCommunicationService final : public ServiceFramework<ILocalCommunicationService> { +public: + explicit ILocalCommunicationService(const char* name) : ServiceFramework{name} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetState"}, + {1, nullptr, "GetNetworkInfo"}, + {2, nullptr, "GetIpv4Address"}, + {3, nullptr, "GetDisconnectReason"}, + {4, nullptr, "GetSecurityParameter"}, + {5, nullptr, "GetNetworkConfig"}, + {100, nullptr, "AttachStateChangeEvent"}, + {101, nullptr, "GetNetworkInfoLatestUpdate"}, + {102, nullptr, "Scan"}, + {103, nullptr, "ScanPrivate"}, + {200, nullptr, "OpenAccessPoint"}, + {201, nullptr, "CloseAccessPoint"}, + {202, nullptr, "CreateNetwork"}, + {203, nullptr, "CreateNetworkPrivate"}, + {204, nullptr, "DestroyNetwork"}, + {205, nullptr, "Reject"}, + {206, nullptr, "SetAdvertiseData"}, + {207, nullptr, "SetStationAcceptPolicy"}, + {208, nullptr, "AddAcceptFilterEntry"}, + {209, nullptr, "ClearAcceptFilter"}, + {300, nullptr, "OpenStation"}, + {301, nullptr, "CloseStation"}, + {302, nullptr, "Connect"}, + {303, nullptr, "ConnectPrivate"}, + {304, nullptr, "Disconnect"}, + {400, nullptr, "InitializeSystem"}, + {401, nullptr, "FinalizeSystem"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class LDNS final : public ServiceFramework<LDNS> { +public: + explicit LDNS() : ServiceFramework{"ldn:s"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &LDNS::CreateSystemLocalCommunicationService, "CreateSystemLocalCommunicationService"}, + }; + // clang-format on + + RegisterHandlers(functions); + } + + void CreateSystemLocalCommunicationService(Kernel::HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<ILocalCommunicationService>("ISystemLocalCommunicationService"); + + LOG_DEBUG(Service_LDN, "called"); + } +}; + +class LDNU final : public ServiceFramework<LDNU> { +public: + explicit LDNU() : ServiceFramework{"ldn:u"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &LDNU::CreateUserLocalCommunicationService, "CreateUserLocalCommunicationService"}, + }; + // clang-format on + + RegisterHandlers(functions); + } + + void CreateUserLocalCommunicationService(Kernel::HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<ILocalCommunicationService>("IUserLocalCommunicationService"); + + LOG_DEBUG(Service_LDN, "called"); + } +}; + +void InstallInterfaces(SM::ServiceManager& sm) { + std::make_shared<LDNM>()->InstallAsService(sm); + std::make_shared<LDNS>()->InstallAsService(sm); + std::make_shared<LDNU>()->InstallAsService(sm); +} + +} // namespace Service::LDN diff --git a/src/core/hle/service/ldn/ldn.h b/src/core/hle/service/ldn/ldn.h new file mode 100644 index 000000000..6b2a3c2b2 --- /dev/null +++ b/src/core/hle/service/ldn/ldn.h @@ -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 + +namespace Service::SM { +class ServiceManager; +} + +namespace Service::LDN { + +/// Registers all LDN services with the specified service manager. +void InstallInterfaces(SM::ServiceManager& sm); + +} // namespace Service::LDN |