summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nifm/nifm.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-08-21 17:09:08 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2021-08-27 08:10:59 +0200
commitc1e2063c0d4b3f25ff47a9f0ccc940615c2a2bd8 (patch)
tree18b05ee38c1ecb27edbc3d113288ec138ac8821a /src/core/hle/service/nifm/nifm.cpp
parentservice: nifm: Cleanup GetCurrentIpConfigInfo (diff)
downloadyuzu-c1e2063c0d4b3f25ff47a9f0ccc940615c2a2bd8.tar
yuzu-c1e2063c0d4b3f25ff47a9f0ccc940615c2a2bd8.tar.gz
yuzu-c1e2063c0d4b3f25ff47a9f0ccc940615c2a2bd8.tar.bz2
yuzu-c1e2063c0d4b3f25ff47a9f0ccc940615c2a2bd8.tar.lz
yuzu-c1e2063c0d4b3f25ff47a9f0ccc940615c2a2bd8.tar.xz
yuzu-c1e2063c0d4b3f25ff47a9f0ccc940615c2a2bd8.tar.zst
yuzu-c1e2063c0d4b3f25ff47a9f0ccc940615c2a2bd8.zip
Diffstat (limited to 'src/core/hle/service/nifm/nifm.cpp')
-rw-r--r--src/core/hle/service/nifm/nifm.cpp66
1 files changed, 37 insertions, 29 deletions
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp
index 183bd48ce..9decb9290 100644
--- a/src/core/hle/service/nifm/nifm.cpp
+++ b/src/core/hle/service/nifm/nifm.cpp
@@ -277,37 +277,45 @@ private:
void GetCurrentNetworkProfile(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_NIFM, "(STUBBED) called");
- const SfNetworkProfileData network_profile_data{
- .ip_setting_data{
- .ip_address_setting{
- .is_automatic{true},
- .current_address{192, 168, 1, 100},
- .subnet_mask{255, 255, 255, 0},
- .gateway{192, 168, 1, 1},
- },
- .dns_setting{
- .is_automatic{true},
- .primary_dns{1, 1, 1, 1},
- .secondary_dns{1, 0, 0, 1},
+ const auto net_iface = Network::GetSelectedNetworkInterface();
+
+ const SfNetworkProfileData network_profile_data = [&net_iface] {
+ if (!net_iface) {
+ return SfNetworkProfileData{};
+ }
+
+ return SfNetworkProfileData{
+ .ip_setting_data{
+ .ip_address_setting{
+ .is_automatic{true},
+ .current_address{Network::TranslateIPv4(net_iface->ip_address)},
+ .subnet_mask{Network::TranslateIPv4(net_iface->subnet_mask)},
+ .gateway{Network::TranslateIPv4(net_iface->gateway)},
+ },
+ .dns_setting{
+ .is_automatic{true},
+ .primary_dns{1, 1, 1, 1},
+ .secondary_dns{1, 0, 0, 1},
+ },
+ .proxy_setting{
+ .enabled{false},
+ .port{},
+ .proxy_server{},
+ .automatic_auth_enabled{},
+ .user{},
+ .password{},
+ },
+ .mtu{1500},
},
- .proxy_setting{
- .enabled{false},
- .port{},
- .proxy_server{},
- .automatic_auth_enabled{},
- .user{},
- .password{},
+ .uuid{0xdeadbeef, 0xdeadbeef},
+ .network_name{"yuzu Network"},
+ .wireless_setting_data{
+ .ssid_length{12},
+ .ssid{"yuzu Network"},
+ .passphrase{"yuzupassword"},
},
- .mtu{1500},
- },
- .uuid{0xdeadbeef, 0xdeadbeef},
- .network_name{"yuzu Network"},
- .wireless_setting_data{
- .ssid_length{12},
- .ssid{"yuzu Network"},
- .passphrase{"yuzupassword"},
- },
- };
+ };
+ }();
ctx.WriteBuffer(network_profile_data);