Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS/Net: implement ioctlv that retrieves the network routing table that libogc now uses on network init #13066

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DacoTaco
Copy link
Contributor

@DacoTaco DacoTaco commented Sep 21, 2024

this can be tested with the following dol's
old libogc that only retrieves the IP : sockettest_org.zip
new libogc dol that retrieves the ip, subnet mask and gateway : sockettest.zip
related libogc issue : devkitPro/libogc#179

i was only able to test & implement this decently on windows and linux, and macos/android will need to have somebody that knows those platforms look at it if it is to be implemented decently (it currently creates a fake entry for 0.0.0.0 to be sent to the retrieved gateway/broadcast ip so libogc doesn't error :) )
for macos i found this, but thats it : https://stackoverflow.com/questions/5390164/getting-routing-table-on-macosx-programmatically

Copy link
Contributor

@sepalani sepalani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this PR on some online games (e.g. Monster Hunter Tri, Mario Strikers Charged Football) and didn't find regressions. Otherwise, the PR looks mostly good to me beside some of these coding style related remarks.

Regarding Android, I might be able to implement the routing table using the RouteInfo class that we're already using to get the network properties.

Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
@JMC47
Copy link
Contributor

JMC47 commented Oct 1, 2024

@dolphin-emu-bot rebuild

Copy link
Contributor

@sepalani sepalani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of using in_addr members as it makes unambiguous that the values are in network byte order. However, I believe the swaps were done in the wrong places.

Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Source/Core/Core/IOS/Network/IP/Top.cpp Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants