diff options
| author | 2021-05-26 08:42:57 -0500 | |
|---|---|---|
| committer | 2021-05-26 10:06:00 -0500 | |
| commit | 65e20f424a864ecef0c055d6678f6adbd700e07a (patch) | |
| tree | 702b685b3b0ce5763e15140903b925942a1345f3 /src | |
| parent | Merge pull request #6331 from lioncash/gesture (diff) | |
| download | yuzu-65e20f424a864ecef0c055d6678f6adbd700e07a.tar.gz yuzu-65e20f424a864ecef0c055d6678f6adbd700e07a.tar.xz yuzu-65e20f424a864ecef0c055d6678f6adbd700e07a.zip | |
ldn: Add and stub lp2p:sys lp2p:app INetworkServiceMonitor INetworkService
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/ldn/ldn.cpp | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp index d160ffe87..c709a8028 100644 --- a/src/core/hle/service/ldn/ldn.cpp +++ b/src/core/hle/service/ldn/ldn.cpp | |||
| @@ -215,10 +215,151 @@ public: | |||
| 215 | } | 215 | } |
| 216 | }; | 216 | }; |
| 217 | 217 | ||
| 218 | class INetworkService final : public ServiceFramework<INetworkService> { | ||
| 219 | public: | ||
| 220 | explicit INetworkService(Core::System& system_) : ServiceFramework{system_, "INetworkService"} { | ||
| 221 | // clang-format off | ||
| 222 | static const FunctionInfo functions[] = { | ||
| 223 | {0, nullptr, "Initialize"}, | ||
| 224 | {256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, | ||
| 225 | {264, nullptr, "GetNetworkInterfaceLastError"}, | ||
| 226 | {272, nullptr, "GetRole"}, | ||
| 227 | {280, nullptr, "GetAdvertiseData"}, | ||
| 228 | {288, nullptr, "GetGroupInfo"}, | ||
| 229 | {296, nullptr, "GetGroupInfo2"}, | ||
| 230 | {304, nullptr, "GetGroupOwner"}, | ||
| 231 | {312, nullptr, "GetIpConfig"}, | ||
| 232 | {320, nullptr, "GetLinkLevel"}, | ||
| 233 | {512, nullptr, "Scan"}, | ||
| 234 | {768, nullptr, "CreateGroup"}, | ||
| 235 | {776, nullptr, "DestroyGroup"}, | ||
| 236 | {784, nullptr, "SetAdvertiseData"}, | ||
| 237 | {1536, nullptr, "SendToOtherGroup"}, | ||
| 238 | {1544, nullptr, "RecvFromOtherGroup"}, | ||
| 239 | {1552, nullptr, "AddAcceptableGroupId"}, | ||
| 240 | {1560, nullptr, "ClearAcceptableGroupId"}, | ||
| 241 | }; | ||
| 242 | // clang-format on | ||
| 243 | |||
| 244 | RegisterHandlers(functions); | ||
| 245 | } | ||
| 246 | }; | ||
| 247 | |||
| 248 | class INetworkServiceMonitor final : public ServiceFramework<INetworkServiceMonitor> { | ||
| 249 | public: | ||
| 250 | explicit INetworkServiceMonitor(Core::System& system_) | ||
| 251 | : ServiceFramework{system_, "INetworkServiceMonitor"} { | ||
| 252 | // clang-format off | ||
| 253 | static const FunctionInfo functions[] = { | ||
| 254 | {0, &INetworkServiceMonitor::Initialize, "Initialize"}, | ||
| 255 | {256, nullptr, "AttachNetworkInterfaceStateChangeEvent"}, | ||
| 256 | {264, nullptr, "GetNetworkInterfaceLastError"}, | ||
| 257 | {272, nullptr, "GetRole"}, | ||
| 258 | {280, nullptr, "GetAdvertiseData"}, | ||
| 259 | {281, nullptr, "GetAdvertiseData2"}, | ||
| 260 | {288, nullptr, "GetGroupInfo"}, | ||
| 261 | {296, nullptr, "GetGroupInfo2"}, | ||
| 262 | {304, nullptr, "GetGroupOwner"}, | ||
| 263 | {312, nullptr, "GetIpConfig"}, | ||
| 264 | {320, nullptr, "GetLinkLevel"}, | ||
| 265 | {328, nullptr, "AttachJoinEvent"}, | ||
| 266 | {336, nullptr, "GetMembers"}, | ||
| 267 | }; | ||
| 268 | // clang-format on | ||
| 269 | |||
| 270 | RegisterHandlers(functions); | ||
| 271 | } | ||
| 272 | |||
| 273 | void Initialize(Kernel::HLERequestContext& ctx) { | ||
| 274 | LOG_WARNING(Service_LDN, "(STUBBED) called"); | ||
| 275 | |||
| 276 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 277 | rb.Push(ERROR_DISABLED); | ||
| 278 | } | ||
| 279 | }; | ||
| 280 | |||
| 281 | class LP2PAPP final : public ServiceFramework<LP2PAPP> { | ||
| 282 | public: | ||
| 283 | explicit LP2PAPP(Core::System& system_) : ServiceFramework{system_, "lp2p:app"} { | ||
| 284 | // clang-format off | ||
| 285 | static const FunctionInfo functions[] = { | ||
| 286 | {0, &LP2PAPP::CreateMonitorService, "CreateNetworkService"}, | ||
| 287 | {8, &LP2PAPP::CreateMonitorService, "CreateNetworkServiceMonitor"}, | ||
| 288 | }; | ||
| 289 | // clang-format on | ||
| 290 | |||
| 291 | RegisterHandlers(functions); | ||
| 292 | } | ||
| 293 | |||
| 294 | void CreateNetworkervice(Kernel::HLERequestContext& ctx) { | ||
| 295 | IPC::RequestParser rp{ctx}; | ||
| 296 | const u64 reserved_input = rp.Pop<u64>(); | ||
| 297 | const u32 input = rp.Pop<u32>(); | ||
| 298 | |||
| 299 | LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={} input={}", reserved_input, | ||
| 300 | input); | ||
| 301 | |||
| 302 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 303 | rb.Push(RESULT_SUCCESS); | ||
| 304 | rb.PushIpcInterface<INetworkService>(system); | ||
| 305 | } | ||
| 306 | |||
| 307 | void CreateMonitorService(Kernel::HLERequestContext& ctx) { | ||
| 308 | IPC::RequestParser rp{ctx}; | ||
| 309 | const u64 reserved_input = rp.Pop<u64>(); | ||
| 310 | |||
| 311 | LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={}", reserved_input); | ||
| 312 | |||
| 313 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 314 | rb.Push(RESULT_SUCCESS); | ||
| 315 | rb.PushIpcInterface<INetworkServiceMonitor>(system); | ||
| 316 | } | ||
| 317 | }; | ||
| 318 | |||
| 319 | class LP2PSYS final : public ServiceFramework<LP2PSYS> { | ||
| 320 | public: | ||
| 321 | explicit LP2PSYS(Core::System& system_) : ServiceFramework{system_, "lp2p:sys"} { | ||
| 322 | // clang-format off | ||
| 323 | static const FunctionInfo functions[] = { | ||
| 324 | {0, &LP2PSYS::CreateMonitorService, "CreateNetworkService"}, | ||
| 325 | {8, &LP2PSYS::CreateMonitorService, "CreateNetworkServiceMonitor"}, | ||
| 326 | }; | ||
| 327 | // clang-format on | ||
| 328 | |||
| 329 | RegisterHandlers(functions); | ||
| 330 | } | ||
| 331 | |||
| 332 | void CreateNetworkervice(Kernel::HLERequestContext& ctx) { | ||
| 333 | IPC::RequestParser rp{ctx}; | ||
| 334 | const u64 reserved_input = rp.Pop<u64>(); | ||
| 335 | const u32 input = rp.Pop<u32>(); | ||
| 336 | |||
| 337 | LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={} input={}", reserved_input, | ||
| 338 | input); | ||
| 339 | |||
| 340 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 341 | rb.Push(RESULT_SUCCESS); | ||
| 342 | rb.PushIpcInterface<INetworkService>(system); | ||
| 343 | } | ||
| 344 | |||
| 345 | void CreateMonitorService(Kernel::HLERequestContext& ctx) { | ||
| 346 | IPC::RequestParser rp{ctx}; | ||
| 347 | const u64 reserved_input = rp.Pop<u64>(); | ||
| 348 | |||
| 349 | LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={}", reserved_input); | ||
| 350 | |||
| 351 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 352 | rb.Push(RESULT_SUCCESS); | ||
| 353 | rb.PushIpcInterface<INetworkServiceMonitor>(system); | ||
| 354 | } | ||
| 355 | }; | ||
| 356 | |||
| 218 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { | 357 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { |
| 219 | std::make_shared<LDNM>(system)->InstallAsService(sm); | 358 | std::make_shared<LDNM>(system)->InstallAsService(sm); |
| 220 | std::make_shared<LDNS>(system)->InstallAsService(sm); | 359 | std::make_shared<LDNS>(system)->InstallAsService(sm); |
| 221 | std::make_shared<LDNU>(system)->InstallAsService(sm); | 360 | std::make_shared<LDNU>(system)->InstallAsService(sm); |
| 361 | std::make_shared<LP2PAPP>(system)->InstallAsService(sm); | ||
| 362 | std::make_shared<LP2PSYS>(system)->InstallAsService(sm); | ||
| 222 | } | 363 | } |
| 223 | 364 | ||
| 224 | } // namespace Service::LDN | 365 | } // namespace Service::LDN |