caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] IPv6 zone-id
@ 2014-07-09 17:35 Vincent B.
  2014-07-11  8:03 ` Raphaël Proust
  0 siblings, 1 reply; 7+ messages in thread
From: Vincent B. @ 2014-07-09 17:35 UTC (permalink / raw)
  To: caml-list

Hi,

The Unix module does not make possible to use IPv6 link-local
addresses.

This is due to the fact that the "sockaddr" type in Unix is not as
complete as its C counterpart, especially it lacks zone-id information
that is required to use such addresses.

Since I needed such features, I started writing a library
(http://github.com/vbmithr/ocaml-sockopt), unfortunately, given that
every networking piece of code written in OCaml use the primitives of
the Unix module, I would have to patch all networking code I want to
use which is not very convenient.

So I'm in the process of writing a patch for OCaml and I'm taking the
approach of extending the sockaddr type like this:

type sockaddr_raw (* a real struct sockaddr *)

type sockaddr =
  ADDR_UNIX of string
| ADDR_INET of inet_addr * int
| ADDR_RAW of sockaddr_raw

And then upgrading all the Unix code that uses type sockaddr.

This approach seems to me the most conservative towards existing
code. Should I continue in this direction or this design is not the
optimal one ?

Cheers,

Vincent

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-17 10:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-09 17:35 [Caml-list] IPv6 zone-id Vincent B.
2014-07-11  8:03 ` Raphaël Proust
2014-07-11 14:13   ` Vincent B.
2014-07-11 19:25     ` Vincent B.
2014-07-16 16:04       ` Francis Dupont
2014-07-17  9:48         ` Vincent B.
2014-07-17 10:51           ` David Allsopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).