diff options
| author | 2022-07-30 05:58:23 +0200 | |
|---|---|---|
| committer | 2022-08-15 20:25:42 +0200 | |
| commit | f80c7c4cd5c090b9a31f89a0eb3d86cbe928c50b (patch) | |
| tree | ad359908ba2d3cd003082b39cc7217b61e5b18f6 /src/core/hle/service/nifm | |
| parent | web_service: Correct jwt issuer string (diff) | |
| download | yuzu-f80c7c4cd5c090b9a31f89a0eb3d86cbe928c50b.tar.gz yuzu-f80c7c4cd5c090b9a31f89a0eb3d86cbe928c50b.tar.xz yuzu-f80c7c4cd5c090b9a31f89a0eb3d86cbe928c50b.zip | |
core, network: Add ability to proxy socket packets
Diffstat (limited to 'src/core/hle/service/nifm')
| -rw-r--r-- | src/core/hle/service/nifm/nifm.cpp | 341 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm.h | 27 |
2 files changed, 205 insertions, 163 deletions
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 2889973e4..42ed17187 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | #include "core/hle/kernel/k_event.h" | 6 | #include "core/hle/kernel/k_event.h" |
| 7 | #include "core/hle/service/kernel_helpers.h" | 7 | #include "core/hle/service/kernel_helpers.h" |
| 8 | #include "core/hle/service/nifm/nifm.h" | 8 | #include "core/hle/service/nifm/nifm.h" |
| 9 | #include "core/hle/service/service.h" | ||
| 10 | 9 | ||
| 11 | namespace { | 10 | namespace { |
| 12 | 11 | ||
| @@ -271,213 +270,227 @@ public: | |||
| 271 | } | 270 | } |
| 272 | }; | 271 | }; |
| 273 | 272 | ||
| 274 | class IGeneralService final : public ServiceFramework<IGeneralService> { | 273 | void IGeneralService::GetClientId(Kernel::HLERequestContext& ctx) { |
| 275 | public: | 274 | static constexpr u32 client_id = 1; |
| 276 | explicit IGeneralService(Core::System& system_); | 275 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 277 | 276 | ||
| 278 | private: | 277 | IPC::ResponseBuilder rb{ctx, 4}; |
| 279 | void GetClientId(Kernel::HLERequestContext& ctx) { | 278 | rb.Push(ResultSuccess); |
| 280 | static constexpr u32 client_id = 1; | 279 | rb.Push<u64>(client_id); // Client ID needs to be non zero otherwise it's considered invalid |
| 281 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 280 | } |
| 282 | 281 | ||
| 283 | IPC::ResponseBuilder rb{ctx, 4}; | 282 | void IGeneralService::CreateScanRequest(Kernel::HLERequestContext& ctx) { |
| 284 | rb.Push(ResultSuccess); | 283 | LOG_DEBUG(Service_NIFM, "called"); |
| 285 | rb.Push<u64>(client_id); // Client ID needs to be non zero otherwise it's considered invalid | ||
| 286 | } | ||
| 287 | 284 | ||
| 288 | void CreateScanRequest(Kernel::HLERequestContext& ctx) { | 285 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 289 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 290 | 286 | ||
| 291 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 287 | rb.Push(ResultSuccess); |
| 288 | rb.PushIpcInterface<IScanRequest>(system); | ||
| 289 | } | ||
| 292 | 290 | ||
| 293 | rb.Push(ResultSuccess); | 291 | void IGeneralService::CreateRequest(Kernel::HLERequestContext& ctx) { |
| 294 | rb.PushIpcInterface<IScanRequest>(system); | 292 | LOG_DEBUG(Service_NIFM, "called"); |
| 295 | } | ||
| 296 | 293 | ||
| 297 | void CreateRequest(Kernel::HLERequestContext& ctx) { | 294 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 298 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 299 | 295 | ||
| 300 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 296 | rb.Push(ResultSuccess); |
| 297 | rb.PushIpcInterface<IRequest>(system); | ||
| 298 | } | ||
| 301 | 299 | ||
| 302 | rb.Push(ResultSuccess); | 300 | void IGeneralService::GetCurrentNetworkProfile(Kernel::HLERequestContext& ctx) { |
| 303 | rb.PushIpcInterface<IRequest>(system); | 301 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 304 | } | ||
| 305 | 302 | ||
| 306 | void GetCurrentNetworkProfile(Kernel::HLERequestContext& ctx) { | 303 | const auto net_iface = Network::GetSelectedNetworkInterface(); |
| 307 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | ||
| 308 | 304 | ||
| 309 | const auto net_iface = Network::GetSelectedNetworkInterface(); | 305 | SfNetworkProfileData network_profile_data = [&net_iface] { |
| 310 | 306 | if (!net_iface) { | |
| 311 | const SfNetworkProfileData network_profile_data = [&net_iface] { | 307 | return SfNetworkProfileData{}; |
| 312 | if (!net_iface) { | 308 | } |
| 313 | return SfNetworkProfileData{}; | 309 | |
| 314 | } | 310 | return SfNetworkProfileData{ |
| 315 | 311 | .ip_setting_data{ | |
| 316 | return SfNetworkProfileData{ | 312 | .ip_address_setting{ |
| 317 | .ip_setting_data{ | 313 | .is_automatic{true}, |
| 318 | .ip_address_setting{ | 314 | .current_address{Network::TranslateIPv4(net_iface->ip_address)}, |
| 319 | .is_automatic{true}, | 315 | .subnet_mask{Network::TranslateIPv4(net_iface->subnet_mask)}, |
| 320 | .current_address{Network::TranslateIPv4(net_iface->ip_address)}, | 316 | .gateway{Network::TranslateIPv4(net_iface->gateway)}, |
| 321 | .subnet_mask{Network::TranslateIPv4(net_iface->subnet_mask)}, | ||
| 322 | .gateway{Network::TranslateIPv4(net_iface->gateway)}, | ||
| 323 | }, | ||
| 324 | .dns_setting{ | ||
| 325 | .is_automatic{true}, | ||
| 326 | .primary_dns{1, 1, 1, 1}, | ||
| 327 | .secondary_dns{1, 0, 0, 1}, | ||
| 328 | }, | ||
| 329 | .proxy_setting{ | ||
| 330 | .enabled{false}, | ||
| 331 | .port{}, | ||
| 332 | .proxy_server{}, | ||
| 333 | .automatic_auth_enabled{}, | ||
| 334 | .user{}, | ||
| 335 | .password{}, | ||
| 336 | }, | ||
| 337 | .mtu{1500}, | ||
| 338 | }, | 317 | }, |
| 339 | .uuid{0xdeadbeef, 0xdeadbeef}, | 318 | .dns_setting{ |
| 340 | .network_name{"yuzu Network"}, | 319 | .is_automatic{true}, |
| 341 | .wireless_setting_data{ | 320 | .primary_dns{1, 1, 1, 1}, |
| 342 | .ssid_length{12}, | 321 | .secondary_dns{1, 0, 0, 1}, |
| 343 | .ssid{"yuzu Network"}, | ||
| 344 | .passphrase{"yuzupassword"}, | ||
| 345 | }, | 322 | }, |
| 346 | }; | 323 | .proxy_setting{ |
| 347 | }(); | 324 | .enabled{false}, |
| 348 | 325 | .port{}, | |
| 349 | ctx.WriteBuffer(network_profile_data); | 326 | .proxy_server{}, |
| 327 | .automatic_auth_enabled{}, | ||
| 328 | .user{}, | ||
| 329 | .password{}, | ||
| 330 | }, | ||
| 331 | .mtu{1500}, | ||
| 332 | }, | ||
| 333 | .uuid{0xdeadbeef, 0xdeadbeef}, | ||
| 334 | .network_name{"yuzu Network"}, | ||
| 335 | .wireless_setting_data{ | ||
| 336 | .ssid_length{12}, | ||
| 337 | .ssid{"yuzu Network"}, | ||
| 338 | .passphrase{"yuzupassword"}, | ||
| 339 | }, | ||
| 340 | }; | ||
| 341 | }(); | ||
| 350 | 342 | ||
| 351 | IPC::ResponseBuilder rb{ctx, 2}; | 343 | // When we're connected to a room, spoof the hosts IP address |
| 352 | rb.Push(ResultSuccess); | 344 | if (auto room_member = network.GetRoomMember().lock()) { |
| 345 | if (room_member->IsConnected()) { | ||
| 346 | network_profile_data.ip_setting_data.ip_address_setting.current_address = | ||
| 347 | room_member->GetFakeIpAddress(); | ||
| 348 | } | ||
| 353 | } | 349 | } |
| 354 | 350 | ||
| 355 | void RemoveNetworkProfile(Kernel::HLERequestContext& ctx) { | 351 | ctx.WriteBuffer(network_profile_data); |
| 356 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | ||
| 357 | 352 | ||
| 358 | IPC::ResponseBuilder rb{ctx, 2}; | 353 | IPC::ResponseBuilder rb{ctx, 2}; |
| 359 | rb.Push(ResultSuccess); | 354 | rb.Push(ResultSuccess); |
| 360 | } | 355 | } |
| 361 | 356 | ||
| 362 | void GetCurrentIpAddress(Kernel::HLERequestContext& ctx) { | 357 | void IGeneralService::RemoveNetworkProfile(Kernel::HLERequestContext& ctx) { |
| 363 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 358 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 364 | 359 | ||
| 365 | auto ipv4 = Network::GetHostIPv4Address(); | 360 | IPC::ResponseBuilder rb{ctx, 2}; |
| 366 | if (!ipv4) { | 361 | rb.Push(ResultSuccess); |
| 367 | LOG_ERROR(Service_NIFM, "Couldn't get host IPv4 address, defaulting to 0.0.0.0"); | 362 | } |
| 368 | ipv4.emplace(Network::IPv4Address{0, 0, 0, 0}); | ||
| 369 | } | ||
| 370 | 363 | ||
| 371 | IPC::ResponseBuilder rb{ctx, 3}; | 364 | void IGeneralService::GetCurrentIpAddress(Kernel::HLERequestContext& ctx) { |
| 372 | rb.Push(ResultSuccess); | 365 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 373 | rb.PushRaw(*ipv4); | 366 | |
| 367 | auto ipv4 = Network::GetHostIPv4Address(); | ||
| 368 | if (!ipv4) { | ||
| 369 | LOG_ERROR(Service_NIFM, "Couldn't get host IPv4 address, defaulting to 0.0.0.0"); | ||
| 370 | ipv4.emplace(Network::IPv4Address{0, 0, 0, 0}); | ||
| 374 | } | 371 | } |
| 375 | 372 | ||
| 376 | void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) { | 373 | // When we're connected to a room, spoof the hosts IP address |
| 377 | LOG_DEBUG(Service_NIFM, "called"); | 374 | if (auto room_member = network.GetRoomMember().lock()) { |
| 375 | if (room_member->IsConnected()) { | ||
| 376 | ipv4 = room_member->GetFakeIpAddress(); | ||
| 377 | } | ||
| 378 | } | ||
| 378 | 379 | ||
| 379 | ASSERT_MSG(ctx.GetReadBufferSize() == 0x17c, | 380 | IPC::ResponseBuilder rb{ctx, 3}; |
| 380 | "SfNetworkProfileData is not the correct size"); | 381 | rb.Push(ResultSuccess); |
| 381 | u128 uuid{}; | 382 | rb.PushRaw(*ipv4); |
| 382 | auto buffer = ctx.ReadBuffer(); | 383 | } |
| 383 | std::memcpy(&uuid, buffer.data() + 8, sizeof(u128)); | 384 | void IGeneralService::CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) { |
| 385 | LOG_DEBUG(Service_NIFM, "called"); | ||
| 384 | 386 | ||
| 385 | IPC::ResponseBuilder rb{ctx, 6, 0, 1}; | 387 | ASSERT_MSG(ctx.GetReadBufferSize() == 0x17c, "SfNetworkProfileData is not the correct size"); |
| 388 | u128 uuid{}; | ||
| 389 | auto buffer = ctx.ReadBuffer(); | ||
| 390 | std::memcpy(&uuid, buffer.data() + 8, sizeof(u128)); | ||
| 386 | 391 | ||
| 387 | rb.Push(ResultSuccess); | 392 | IPC::ResponseBuilder rb{ctx, 6, 0, 1}; |
| 388 | rb.PushIpcInterface<INetworkProfile>(system); | ||
| 389 | rb.PushRaw<u128>(uuid); | ||
| 390 | } | ||
| 391 | 393 | ||
| 392 | void GetCurrentIpConfigInfo(Kernel::HLERequestContext& ctx) { | 394 | rb.Push(ResultSuccess); |
| 393 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 395 | rb.PushIpcInterface<INetworkProfile>(system); |
| 396 | rb.PushRaw<u128>(uuid); | ||
| 397 | } | ||
| 394 | 398 | ||
| 395 | struct IpConfigInfo { | 399 | void IGeneralService::GetCurrentIpConfigInfo(Kernel::HLERequestContext& ctx) { |
| 396 | IpAddressSetting ip_address_setting{}; | 400 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 397 | DnsSetting dns_setting{}; | ||
| 398 | }; | ||
| 399 | static_assert(sizeof(IpConfigInfo) == sizeof(IpAddressSetting) + sizeof(DnsSetting), | ||
| 400 | "IpConfigInfo has incorrect size."); | ||
| 401 | 401 | ||
| 402 | const auto net_iface = Network::GetSelectedNetworkInterface(); | 402 | struct IpConfigInfo { |
| 403 | IpAddressSetting ip_address_setting{}; | ||
| 404 | DnsSetting dns_setting{}; | ||
| 405 | }; | ||
| 406 | static_assert(sizeof(IpConfigInfo) == sizeof(IpAddressSetting) + sizeof(DnsSetting), | ||
| 407 | "IpConfigInfo has incorrect size."); | ||
| 403 | 408 | ||
| 404 | const IpConfigInfo ip_config_info = [&net_iface] { | 409 | const auto net_iface = Network::GetSelectedNetworkInterface(); |
| 405 | if (!net_iface) { | ||
| 406 | return IpConfigInfo{}; | ||
| 407 | } | ||
| 408 | 410 | ||
| 409 | return IpConfigInfo{ | 411 | IpConfigInfo ip_config_info = [&net_iface] { |
| 410 | .ip_address_setting{ | 412 | if (!net_iface) { |
| 411 | .is_automatic{true}, | 413 | return IpConfigInfo{}; |
| 412 | .current_address{Network::TranslateIPv4(net_iface->ip_address)}, | 414 | } |
| 413 | .subnet_mask{Network::TranslateIPv4(net_iface->subnet_mask)}, | ||
| 414 | .gateway{Network::TranslateIPv4(net_iface->gateway)}, | ||
| 415 | }, | ||
| 416 | .dns_setting{ | ||
| 417 | .is_automatic{true}, | ||
| 418 | .primary_dns{1, 1, 1, 1}, | ||
| 419 | .secondary_dns{1, 0, 0, 1}, | ||
| 420 | }, | ||
| 421 | }; | ||
| 422 | }(); | ||
| 423 | 415 | ||
| 424 | IPC::ResponseBuilder rb{ctx, 2 + (sizeof(IpConfigInfo) + 3) / sizeof(u32)}; | 416 | return IpConfigInfo{ |
| 425 | rb.Push(ResultSuccess); | 417 | .ip_address_setting{ |
| 426 | rb.PushRaw<IpConfigInfo>(ip_config_info); | 418 | .is_automatic{true}, |
| 419 | .current_address{Network::TranslateIPv4(net_iface->ip_address)}, | ||
| 420 | .subnet_mask{Network::TranslateIPv4(net_iface->subnet_mask)}, | ||
| 421 | .gateway{Network::TranslateIPv4(net_iface->gateway)}, | ||
| 422 | }, | ||
| 423 | .dns_setting{ | ||
| 424 | .is_automatic{true}, | ||
| 425 | .primary_dns{1, 1, 1, 1}, | ||
| 426 | .secondary_dns{1, 0, 0, 1}, | ||
| 427 | }, | ||
| 428 | }; | ||
| 429 | }(); | ||
| 430 | |||
| 431 | // When we're connected to a room, spoof the hosts IP address | ||
| 432 | if (auto room_member = network.GetRoomMember().lock()) { | ||
| 433 | if (room_member->IsConnected()) { | ||
| 434 | ip_config_info.ip_address_setting.current_address = room_member->GetFakeIpAddress(); | ||
| 435 | } | ||
| 427 | } | 436 | } |
| 428 | 437 | ||
| 429 | void IsWirelessCommunicationEnabled(Kernel::HLERequestContext& ctx) { | 438 | IPC::ResponseBuilder rb{ctx, 2 + (sizeof(IpConfigInfo) + 3) / sizeof(u32)}; |
| 430 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 439 | rb.Push(ResultSuccess); |
| 440 | rb.PushRaw<IpConfigInfo>(ip_config_info); | ||
| 441 | } | ||
| 431 | 442 | ||
| 432 | IPC::ResponseBuilder rb{ctx, 3}; | 443 | void IGeneralService::IsWirelessCommunicationEnabled(Kernel::HLERequestContext& ctx) { |
| 433 | rb.Push(ResultSuccess); | 444 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 434 | rb.Push<u8>(0); | ||
| 435 | } | ||
| 436 | 445 | ||
| 437 | void GetInternetConnectionStatus(Kernel::HLERequestContext& ctx) { | 446 | IPC::ResponseBuilder rb{ctx, 3}; |
| 438 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 447 | rb.Push(ResultSuccess); |
| 448 | rb.Push<u8>(1); | ||
| 449 | } | ||
| 439 | 450 | ||
| 440 | struct Output { | 451 | void IGeneralService::GetInternetConnectionStatus(Kernel::HLERequestContext& ctx) { |
| 441 | InternetConnectionType type{InternetConnectionType::WiFi}; | 452 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 442 | u8 wifi_strength{3}; | ||
| 443 | InternetConnectionStatus state{InternetConnectionStatus::Connected}; | ||
| 444 | }; | ||
| 445 | static_assert(sizeof(Output) == 0x3, "Output has incorrect size."); | ||
| 446 | 453 | ||
| 447 | constexpr Output out{}; | 454 | struct Output { |
| 455 | InternetConnectionType type{InternetConnectionType::WiFi}; | ||
| 456 | u8 wifi_strength{3}; | ||
| 457 | InternetConnectionStatus state{InternetConnectionStatus::Connected}; | ||
| 458 | }; | ||
| 459 | static_assert(sizeof(Output) == 0x3, "Output has incorrect size."); | ||
| 448 | 460 | ||
| 449 | IPC::ResponseBuilder rb{ctx, 3}; | 461 | constexpr Output out{}; |
| 450 | rb.Push(ResultSuccess); | ||
| 451 | rb.PushRaw(out); | ||
| 452 | } | ||
| 453 | 462 | ||
| 454 | void IsEthernetCommunicationEnabled(Kernel::HLERequestContext& ctx) { | 463 | IPC::ResponseBuilder rb{ctx, 3}; |
| 455 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 464 | rb.Push(ResultSuccess); |
| 465 | rb.PushRaw(out); | ||
| 466 | } | ||
| 456 | 467 | ||
| 457 | IPC::ResponseBuilder rb{ctx, 3}; | 468 | void IGeneralService::IsEthernetCommunicationEnabled(Kernel::HLERequestContext& ctx) { |
| 458 | rb.Push(ResultSuccess); | 469 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); |
| 459 | if (Network::GetHostIPv4Address().has_value()) { | 470 | |
| 460 | rb.Push<u8>(1); | 471 | IPC::ResponseBuilder rb{ctx, 3}; |
| 461 | } else { | 472 | rb.Push(ResultSuccess); |
| 462 | rb.Push<u8>(0); | 473 | if (Network::GetHostIPv4Address().has_value()) { |
| 463 | } | 474 | rb.Push<u8>(1); |
| 475 | } else { | ||
| 476 | rb.Push<u8>(0); | ||
| 464 | } | 477 | } |
| 478 | } | ||
| 465 | 479 | ||
| 466 | void IsAnyInternetRequestAccepted(Kernel::HLERequestContext& ctx) { | 480 | void IGeneralService::IsAnyInternetRequestAccepted(Kernel::HLERequestContext& ctx) { |
| 467 | LOG_WARNING(Service_NIFM, "(STUBBED) called"); | 481 | LOG_ERROR(Service_NIFM, "(STUBBED) called"); |
| 468 | 482 | ||
| 469 | IPC::ResponseBuilder rb{ctx, 3}; | 483 | IPC::ResponseBuilder rb{ctx, 3}; |
| 470 | rb.Push(ResultSuccess); | 484 | rb.Push(ResultSuccess); |
| 471 | if (Network::GetHostIPv4Address().has_value()) { | 485 | if (Network::GetHostIPv4Address().has_value()) { |
| 472 | rb.Push<u8>(1); | 486 | rb.Push<u8>(1); |
| 473 | } else { | 487 | } else { |
| 474 | rb.Push<u8>(0); | 488 | rb.Push<u8>(0); |
| 475 | } | ||
| 476 | } | 489 | } |
| 477 | }; | 490 | } |
| 478 | 491 | ||
| 479 | IGeneralService::IGeneralService(Core::System& system_) | 492 | IGeneralService::IGeneralService(Core::System& system_) |
| 480 | : ServiceFramework{system_, "IGeneralService"} { | 493 | : ServiceFramework{system_, "IGeneralService"}, network{system_.GetRoomNetwork()} { |
| 481 | // clang-format off | 494 | // clang-format off |
| 482 | static const FunctionInfo functions[] = { | 495 | static const FunctionInfo functions[] = { |
| 483 | {1, &IGeneralService::GetClientId, "GetClientId"}, | 496 | {1, &IGeneralService::GetClientId, "GetClientId"}, |
| @@ -528,6 +541,8 @@ IGeneralService::IGeneralService(Core::System& system_) | |||
| 528 | RegisterHandlers(functions); | 541 | RegisterHandlers(functions); |
| 529 | } | 542 | } |
| 530 | 543 | ||
| 544 | IGeneralService::~IGeneralService() = default; | ||
| 545 | |||
| 531 | class NetworkInterface final : public ServiceFramework<NetworkInterface> { | 546 | class NetworkInterface final : public ServiceFramework<NetworkInterface> { |
| 532 | public: | 547 | public: |
| 533 | explicit NetworkInterface(const char* name, Core::System& system_) | 548 | explicit NetworkInterface(const char* name, Core::System& system_) |
diff --git a/src/core/hle/service/nifm/nifm.h b/src/core/hle/service/nifm/nifm.h index 5f62d0014..48161be28 100644 --- a/src/core/hle/service/nifm/nifm.h +++ b/src/core/hle/service/nifm/nifm.h | |||
| @@ -3,6 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include "core/hle/service/service.h" | ||
| 7 | #include "network/network.h" | ||
| 8 | #include "network/room.h" | ||
| 9 | #include "network/room_member.h" | ||
| 10 | |||
| 6 | namespace Core { | 11 | namespace Core { |
| 7 | class System; | 12 | class System; |
| 8 | } | 13 | } |
| @@ -16,4 +21,26 @@ namespace Service::NIFM { | |||
| 16 | /// Registers all NIFM services with the specified service manager. | 21 | /// Registers all NIFM services with the specified service manager. |
| 17 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system); | 22 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system); |
| 18 | 23 | ||
| 24 | class IGeneralService final : public ServiceFramework<IGeneralService> { | ||
| 25 | public: | ||
| 26 | explicit IGeneralService(Core::System& system_); | ||
| 27 | ~IGeneralService() override; | ||
| 28 | |||
| 29 | private: | ||
| 30 | void GetClientId(Kernel::HLERequestContext& ctx); | ||
| 31 | void CreateScanRequest(Kernel::HLERequestContext& ctx); | ||
| 32 | void CreateRequest(Kernel::HLERequestContext& ctx); | ||
| 33 | void GetCurrentNetworkProfile(Kernel::HLERequestContext& ctx); | ||
| 34 | void RemoveNetworkProfile(Kernel::HLERequestContext& ctx); | ||
| 35 | void GetCurrentIpAddress(Kernel::HLERequestContext& ctx); | ||
| 36 | void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx); | ||
| 37 | void GetCurrentIpConfigInfo(Kernel::HLERequestContext& ctx); | ||
| 38 | void IsWirelessCommunicationEnabled(Kernel::HLERequestContext& ctx); | ||
| 39 | void GetInternetConnectionStatus(Kernel::HLERequestContext& ctx); | ||
| 40 | void IsEthernetCommunicationEnabled(Kernel::HLERequestContext& ctx); | ||
| 41 | void IsAnyInternetRequestAccepted(Kernel::HLERequestContext& ctx); | ||
| 42 | |||
| 43 | Network::RoomNetwork& network; | ||
| 44 | }; | ||
| 45 | |||
| 19 | } // namespace Service::NIFM | 46 | } // namespace Service::NIFM |