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

IPv6 support #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

IPv6 support #21

wants to merge 3 commits into from

Conversation

Ericson2314
Copy link

I took some time to change the EnetAddress type to hold IPv6 and iPv4 addresses. I still need to test this, but I'd figure I'd submit a pull request anyways to see if you like my current methodology, and what I might change if you don't to eventually get IPv6 support upstream.

See enet.h for my revises documentation for EnetAddress, which basically shows my overall strategy for adding IPv6 support.

 - Documentation updated for EnetAddress
 - Some codepaths to deprecated functions in unix.c removed as they
   didn't support IPv6 usage
@lsalzman
Copy link
Owner

lsalzman commented Jul 7, 2013

The problem with this is that it essentially has to live in a different directory/library namespace because it is a breaking API change. It'd have to be called something like enetv6 just to avoid breaking everything that includes enet/* or links against libenet.

@Ericson2314
Copy link
Author

Yeah, I couldn't see a way to do it without either braking the API, or making so many versions of each function that one might as well be including two versions of the library at once. The sockets interface itself added IPv6 without breaking the API, of course. But I think we both agree the way they support multiple address families is very clunky.

Perhaps you might massively increment the version number, keep it in a separate branch, and keep both around in an interim period to help people transition? With that plan, I doubt doing something like renaming the headers, or some other form of namespace change, is needed as this is not a subtle API change and it will cause plenty of compiling errors if it

Also, I noticed you stored the port number with native endianness, while as far as I know both Windows and Unix store it in network byte order. What was your rational for doing so? If you fully conform to the sockaddr_in and sockaddr_in6 APIs, good amount of the enet_socket_* wrappers can be simplified, maybe just to a few macro that interprets the different error-code conversions. This would also certainly help people writing bindings for ENet, as I am currently in Haskell, and I know others have done in at least Lua and Python. If IPv6 will break the current API anyways, perhaps this a good time to also make other interface-breaking changes like this.

@lsalzman
Copy link
Owner

lsalzman commented Jul 7, 2013

The point was to actually make it easy to use. Having to do byte sex on the port all the time just to manipulate port numbers is annoying. Whereas addresses are kinda useless to manipulate directly unless in some other form and for that matter are usually just interpreted as byte strings anyway, unlike ports.

And a version number bump is not sufficient, sorry. It has to be a library rename or else there will be clashes that I don't want.

@Ericson2314
Copy link
Author

Alright. What 'enet's do you want changed to 'enetv6'?

@lsalzman
Copy link
Owner

lsalzman commented Jul 7, 2013

For reference, github comments are the entirely wrong place to have this discussion. I would appreciate it if you instead moved to the mailing list where other people can see it so it does not become one-sided.

@Ericson2314
Copy link
Author

OK. Edit: email sent

@comex
Copy link

comex commented Sep 27, 2013

Any update on this? :)

I'm a user of enet who thinks IPv6 support would be quite nice to have.

@lsalzman
Copy link
Owner

I'm swamped with life/work at the moment. I need a solid stretch of time in which to set up an enet2 branch and get things going, but not sure when that will be. Maybe over the winter holidays...

@liamzdenek
Copy link

I am also interested in IPv6 support. Keep us updated?

@Ericson2314
Copy link
Author

I am still around to work on this. As far as I know my email was the last in the thread in the mailing list.

@proller
Copy link

proller commented Jan 16, 2014

We working on switch game http://freeminer.org/ to enet, and very need in ipv6 too.

@kklouzal
Copy link

kklouzal commented Mar 4, 2014

Status update? IPv6 support would be very handy at the moment!

@lsalzman
Copy link
Owner

lsalzman commented Mar 5, 2014

Still way too busy to look into this right now. This summer will be the soonest I will have a big enough block of time for it.

@proller
Copy link

proller commented Apr 10, 2014

https://github.com/freeminer/enet/tree/ipv6 - anything converted to AF_INET6 (v6+v4)
without ipv4-only support.
unix version working, win32 need to solve resolving

@lsalzman
Copy link
Owner

lsalzman commented Mar 2, 2015

I was too busy with job commitments before to devote much time to ipv6 unfortunately, and it proved controversial enough that it wasn't a simple issue of someone else doing it and merging a pull request.

I can take a look into starting up an enet2 tree again over the next few weeks and figure out what I want to do with this. This would be a breaking change, though, since it seems impossible to satisfy everyone while maintaining backwards compatibility with the existing library's API and while supporting the same set of older platforms.

@comex
Copy link

comex commented Mar 2, 2015

Thanks for the reply. From an API perspective, my thought was to do something like

  • add ENetAddress2, which has a family field (and reserves 128 bytes of space or so like struct sockaddr_storage)
  • for every function that takes an ENetAddress, add a version that takes ENetAddress2, and stick 2 on the function name; turn the original into a wrapper
  • for structs containing ENetAddress fields, add duplicate ENetAddress2 fields, and mirror to the original if the address is IPv4
  • and/or maybe check for a magic define and, if set, #define ENetAddress ENetAddress2 and so on for all the functions and fields?

Not sure if this is worth it, but it would probably be nicer for distros than having to maintain two separate libraries.

What's the issue with older platforms?

@CPlusPlus17
Copy link

Any news about this? We plan to migrate from raknet to enet but we depend on ipv6 support.

@proller
Copy link

proller commented Jul 29, 2015

look to https://github.com/sctplab/usrsctp

@andrewhanks
Copy link

Any update on this?

It is very nice to have IPv6 support.

@changhoward
Copy link

Same here! Any news? It would be GREAT to have IPv6 support.

@lsalzman
Copy link
Owner

I've just been too busy to look into this lately. I have a lot of things
going on...

On Sat, Jul 16, 2016 at 2:22 AM, Howard Chang [email protected]
wrote:

Same here! Any news? It would be GREAT to have IPv6 support.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#21 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABY60fgVC-QDOvnQeRbIJj66CiNJtgwbks5qWHjDgaJpZM4AyjQI
.

@Boscop
Copy link

Boscop commented Oct 27, 2016

I'm very interested in this as well. IPv4 addresses are getting rare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants