This adds support for the NAT-PMP and PCP protocols used for port mapping and the obtaining external IP address for online multiplayer.
While not implemented on every consumer router, it should help make connections easier (on both Wii via GoCentral and 360 via liveless) for those that do support either of the protocol(s), as well as having the potential to support CGNAT if the ISP cares enough to do that.
This is a draft PR as there are still a few lingering issues and uncertainties:
On Wii, the gateway IP is just guessed from local IP & 255.255.255.0 + .1, which won't match every router. Should be getting this from the OS.
Wii support doesn't work as the socket tries to be initialised after splash screen, where SO isn't initialised. Should be moved to when the game initialises the Quazal game socket.
PCP support hasn't been properly tested, only NAT-PMP.
Packets are not retried according to RFC6886 section 3.1.
It would be nice in the future to have the game socket use the port given by the router here (for potential CGNAT support, or even something like multiple consoles on the same public IP), but not necessary.
This has been updated to add support for UPnP port mapping using Xam's exported functions. Tested on 1 router.
This adds support for the NAT-PMP and PCP protocols used for port mapping and the obtaining external IP address for online multiplayer.
While not implemented on every consumer router, it should help make connections easier (on both Wii via GoCentral and 360 via liveless) for those that do support either of the protocol(s), as well as having the potential to support CGNAT if the ISP cares enough to do that.
This is a draft PR as there are still a few lingering issues and uncertainties:
local IP & 255.255.255.0 + .1
, which won't match every router. Should be getting this from the OS.It would be nice in the future to have the game socket use the port given by the router here (for potential CGNAT support, or even something like multiple consoles on the same public IP), but not necessary.
This has been updated to add support for UPnP port mapping using Xam's exported functions. Tested on 1 router.