Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] parsing and emitting Unix.inet_addr values
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: james woodyatt <jhwoodyatt@m...>
Subject: Re: [Caml-list] parsing and emitting Unix.inet_addr values
On Thursday, November 15, 2001, at 01:48 , Xavier Leroy wrote:
>
> But: I'm *extremely* wary about interfaces that assume that an inet_addr
> is isomorphic to a 32-bit integer or to 4 octets, because these break
> horribly with IPv6 addresses.  We've been hearing for so long that
> IPv6 is the wave of the future that we might just as well be ready for 
> IPv6.

I received another response that raised this same issue.

It's nice to know that the abstract Unix.inet_addr type is intended to 
represent both IPv4 and IPv6 addresses.  The current conversions to and 
from strings just deal with dot quads and don't seem to understand 
textual representations of IPv6 addresses yet, but I guess I can see the 
roadmap now.

Consider this:

	val inet_addr_of_octets: string -> inet_addr
	val octets_of_inet_addr: inet_addr -> string

If inet_addr_of_octets is applied to a string that isn't four or eight 
octets in length, then it can raise Invalid_arg.


--
j h woodyatt <jhw@wetware.com>
"...the antidote to misinformation is more information, not less."
                                                      --vinton cerf

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr