Hagb / IPv6Map

Make IPv4-only programs use dual-stack UDP socket, and map IPv6 addresses to IPv4 for them

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IPv6Map

This DLL makes IPv4-only programs use dual-stack UDP socket, and maps IPv6 addresses to IPv4 for them.

It is inspired by Autopunch, and uses many codes from that.

Still in early development. Use at your risk.

How to use

TODO (a loader like Autopunch loader is needed)

Use in Touhou Hisoutensoku

Download the zip from release and unpack files into modules/a name you like/. Load IPv6MapSokuMod.dll in SWRSToys.ini.

  • Join other player: copy the address (IPv4 or IPv6) into clipboard, and let Soku read the address from clipboard
  • Host: host as usual, and other players can join you by both IPv4 and IPv6

It should be compatible with Autopunch Mod, SokuLobbiesMod, InGameHostlist and Giuroll. If there is any problem, please report to me.

For developers:

  • With this mod loaded, the old method to host or join in IPv4 works as before. If your mod(s) do these only in IPv4, nothing needs to be changed.
  • You can interact with this mod in an other Soku mod to let Soku join a specified IPv6 (or IPv4) address. Notice that the hook only enabled for Soku itself (for more details, search BUILD_FOR_SOKU in src/IPv6Map/my_socket.c), for hooks of WSA* haven't been implemented and I am afraid that they would be called.
  • When using IPv6, the protocol is extended to exchange IPv6 address between peers and punch. For details, refer to soku-protocol-extension.md.

Interact with your code

(C/C++) Include the header src/ipv6map.h (which can be used as a standalone header).

Refer to the comments in src/ipv6map.h.

TODO

  • implement hooks of WSA* functions
  • IPv6-mapped IPv4 address collection
  • static mapping
  • a loader like autopunch-loader

Thank

About

Make IPv4-only programs use dual-stack UDP socket, and map IPv6 addresses to IPv4 for them

License:MIT License


Languages

Language:C 77.8%Language:C++ 15.5%Language:CMake 4.4%Language:Python 2.3%