summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-26 11:52:42 -0700
committerGravatar GitHub2018-07-26 11:52:42 -0700
commite4191b624c01154466566421f8ddad58bcf5fb37 (patch)
tree3124853777ff79c91fcee2f2860938e4c057def8 /src
parentMerge pull request #830 from lioncash/socket (diff)
parentservice: Add ldn services (diff)
downloadyuzu-e4191b624c01154466566421f8ddad58bcf5fb37.tar.gz
yuzu-e4191b624c01154466566421f8ddad58bcf5fb37.tar.xz
yuzu-e4191b624c01154466566421f8ddad58bcf5fb37.zip
Merge pull request #831 from lioncash/ldn
service: Add ldn services
Diffstat (limited to '')
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/ldn/ldn.cpp142
-rw-r--r--src/core/hle/service/ldn/ldn.h16
-rw-r--r--src/core/hle/service/service.cpp2
6 files changed, 164 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 59b999935..ad9edbcdf 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -173,6 +173,7 @@ void FileBackend::Write(const Entry& entry) {
173 SUB(Service, Friend) \ 173 SUB(Service, Friend) \
174 SUB(Service, FS) \ 174 SUB(Service, FS) \
175 SUB(Service, HID) \ 175 SUB(Service, HID) \
176 SUB(Service, LDN) \
176 SUB(Service, LM) \ 177 SUB(Service, LM) \
177 SUB(Service, MM) \ 178 SUB(Service, MM) \
178 SUB(Service, NFP) \ 179 SUB(Service, NFP) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index e7115933f..ad3cbf5d1 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -60,6 +60,7 @@ enum class Class : ClassType {
60 Service_Friend, ///< The friend service 60 Service_Friend, ///< The friend service
61 Service_FS, ///< The FS (Filesystem) service 61 Service_FS, ///< The FS (Filesystem) service
62 Service_HID, ///< The HID (Human interface device) service 62 Service_HID, ///< The HID (Human interface device) service
63 Service_LDN, ///< The LDN (Local domain network) service
63 Service_LM, ///< The LM (Logger) service 64 Service_LM, ///< The LM (Logger) service
64 Service_MM, ///< The MM (Multimedia) service 65 Service_MM, ///< The MM (Multimedia) service
65 Service_NFP, ///< The NFP service 66 Service_NFP, ///< The NFP service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 7a67439fd..2632c3b80 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -158,6 +158,8 @@ add_library(core STATIC
158 hle/service/friend/interface.h 158 hle/service/friend/interface.h
159 hle/service/hid/hid.cpp 159 hle/service/hid/hid.cpp
160 hle/service/hid/hid.h 160 hle/service/hid/hid.h
161 hle/service/ldn/ldn.cpp
162 hle/service/ldn/ldn.h
161 hle/service/ldr/ldr.cpp 163 hle/service/ldr/ldr.cpp
162 hle/service/ldr/ldr.h 164 hle/service/ldr/ldr.h
163 hle/service/lm/lm.cpp 165 hle/service/lm/lm.cpp
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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/ipc_helpers.h"
8#include "core/hle/result.h"
9#include "core/hle/service/ldn/ldn.h"
10#include "core/hle/service/sm/sm.h"
11
12namespace Service::LDN {
13
14class IMonitorService final : public ServiceFramework<IMonitorService> {
15public:
16 explicit IMonitorService() : ServiceFramework{"IMonitorService"} {
17 // clang-format off
18 static const FunctionInfo functions[] = {
19 {0, nullptr, "GetStateForMonitor"},
20 {1, nullptr, "GetNetworkInfoForMonitor"},
21 {2, nullptr, "GetIpv4AddressForMonitor"},
22 {3, nullptr, "GetDisconnectReasonForMonitor"},
23 {4, nullptr, "GetSecurityParameterForMonitor"},
24 {5, nullptr, "GetNetworkConfigForMonitor"},
25 {100, nullptr, "InitializeMonitor"},
26 {101, nullptr, "FinalizeMonitor"},
27 };
28 // clang-format on
29
30 RegisterHandlers(functions);
31 }
32};
33
34class LDNM final : public ServiceFramework<LDNM> {
35public:
36 explicit LDNM() : ServiceFramework{"ldn:m"} {
37 // clang-format off
38 static const FunctionInfo functions[] = {
39 {0, &LDNM::CreateMonitorService, "CreateMonitorService"}
40 };
41 // clang-format on
42
43 RegisterHandlers(functions);
44 }
45
46 void CreateMonitorService(Kernel::HLERequestContext& ctx) {
47 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
48 rb.Push(RESULT_SUCCESS);
49 rb.PushIpcInterface<IMonitorService>();
50
51 LOG_DEBUG(Service_LDN, "called");
52 }
53};
54
55class ILocalCommunicationService final : public ServiceFramework<ILocalCommunicationService> {
56public:
57 explicit ILocalCommunicationService(const char* name) : ServiceFramework{name} {
58 // clang-format off
59 static const FunctionInfo functions[] = {
60 {0, nullptr, "GetState"},
61 {1, nullptr, "GetNetworkInfo"},
62 {2, nullptr, "GetIpv4Address"},
63 {3, nullptr, "GetDisconnectReason"},
64 {4, nullptr, "GetSecurityParameter"},
65 {5, nullptr, "GetNetworkConfig"},
66 {100, nullptr, "AttachStateChangeEvent"},
67 {101, nullptr, "GetNetworkInfoLatestUpdate"},
68 {102, nullptr, "Scan"},
69 {103, nullptr, "ScanPrivate"},
70 {200, nullptr, "OpenAccessPoint"},
71 {201, nullptr, "CloseAccessPoint"},
72 {202, nullptr, "CreateNetwork"},
73 {203, nullptr, "CreateNetworkPrivate"},
74 {204, nullptr, "DestroyNetwork"},
75 {205, nullptr, "Reject"},
76 {206, nullptr, "SetAdvertiseData"},
77 {207, nullptr, "SetStationAcceptPolicy"},
78 {208, nullptr, "AddAcceptFilterEntry"},
79 {209, nullptr, "ClearAcceptFilter"},
80 {300, nullptr, "OpenStation"},
81 {301, nullptr, "CloseStation"},
82 {302, nullptr, "Connect"},
83 {303, nullptr, "ConnectPrivate"},
84 {304, nullptr, "Disconnect"},
85 {400, nullptr, "InitializeSystem"},
86 {401, nullptr, "FinalizeSystem"},
87 };
88 // clang-format on
89
90 RegisterHandlers(functions);
91 }
92};
93
94class LDNS final : public ServiceFramework<LDNS> {
95public:
96 explicit LDNS() : ServiceFramework{"ldn:s"} {
97 // clang-format off
98 static const FunctionInfo functions[] = {
99 {0, &LDNS::CreateSystemLocalCommunicationService, "CreateSystemLocalCommunicationService"},
100 };
101 // clang-format on
102
103 RegisterHandlers(functions);
104 }
105
106 void CreateSystemLocalCommunicationService(Kernel::HLERequestContext& ctx) {
107 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
108 rb.Push(RESULT_SUCCESS);
109 rb.PushIpcInterface<ILocalCommunicationService>("ISystemLocalCommunicationService");
110
111 LOG_DEBUG(Service_LDN, "called");
112 }
113};
114
115class LDNU final : public ServiceFramework<LDNU> {
116public:
117 explicit LDNU() : ServiceFramework{"ldn:u"} {
118 // clang-format off
119 static const FunctionInfo functions[] = {
120 {0, &LDNU::CreateUserLocalCommunicationService, "CreateUserLocalCommunicationService"},
121 };
122 // clang-format on
123
124 RegisterHandlers(functions);
125 }
126
127 void CreateUserLocalCommunicationService(Kernel::HLERequestContext& ctx) {
128 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
129 rb.Push(RESULT_SUCCESS);
130 rb.PushIpcInterface<ILocalCommunicationService>("IUserLocalCommunicationService");
131
132 LOG_DEBUG(Service_LDN, "called");
133 }
134};
135
136void InstallInterfaces(SM::ServiceManager& sm) {
137 std::make_shared<LDNM>()->InstallAsService(sm);
138 std::make_shared<LDNS>()->InstallAsService(sm);
139 std::make_shared<LDNU>()->InstallAsService(sm);
140}
141
142} // 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 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::LDN {
12
13/// Registers all LDN services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& sm);
15
16} // namespace Service::LDN
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 482989ea7..1e24d33e2 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -28,6 +28,7 @@
28#include "core/hle/service/filesystem/filesystem.h" 28#include "core/hle/service/filesystem/filesystem.h"
29#include "core/hle/service/friend/friend.h" 29#include "core/hle/service/friend/friend.h"
30#include "core/hle/service/hid/hid.h" 30#include "core/hle/service/hid/hid.h"
31#include "core/hle/service/ldn/ldn.h"
31#include "core/hle/service/ldr/ldr.h" 32#include "core/hle/service/ldr/ldr.h"
32#include "core/hle/service/lm/lm.h" 33#include "core/hle/service/lm/lm.h"
33#include "core/hle/service/mm/mm_u.h" 34#include "core/hle/service/mm/mm_u.h"
@@ -199,6 +200,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
199 FileSystem::InstallInterfaces(*sm); 200 FileSystem::InstallInterfaces(*sm);
200 Friend::InstallInterfaces(*sm); 201 Friend::InstallInterfaces(*sm);
201 HID::InstallInterfaces(*sm); 202 HID::InstallInterfaces(*sm);
203 LDN::InstallInterfaces(*sm);
202 LDR::InstallInterfaces(*sm); 204 LDR::InstallInterfaces(*sm);
203 LM::InstallInterfaces(*sm); 205 LM::InstallInterfaces(*sm);
204 MM::InstallInterfaces(*sm); 206 MM::InstallInterfaces(*sm);