[MLton] IPv6 in MLton
Wesley W.Terpstra
wesley@terpstra.ca
Thu, 29 Sep 2005 15:10:41 +0200
Ok, I intend to add IPv6 support to MLton.
Obviously, I will create INetSock6 for this.
Basically, my question boils down to:
Should I make NetHostDB handle both IPv4 and IPv6?
Or should I make a NetHostDB6 and INET_SOCK6 too.
The thing with NetHostDB is that it includes a 'in_addr'.
So, should this be an address of any family? or just ipv4?
The main annoyance is that getByName doesn't take an
addr_family as an argument...
So, I think I am essentially talking myself into adding a
NetHostDB6, the longer I write this email. :-)
Actually, since C has these methods inet_pton inet_ntop
and gethostbyname2, it is possible to implement an
address neutral version of NetHostDB. How that would
work with a SML 'scan' function, I don't know.
For that matter, getaddrinfo and getnameinfo are the
modern methods. Being able to access these would be
quite handy, because they support link scopes. Maybe
I could dump those in yet another MLton.MyFavSyscall.
What do other people think about these issues?
PS. What would happen if MLton used mlnlffigen instead of
the C runtime? Faster/slower? Breaks cross-compiling?
PPS. Sometime down the road, I will probably add multicast.