[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Charrua release


  • To: mirageos-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Hannes Mehnert <hannes@xxxxxxxxxxx>
  • Date: Thu, 15 Oct 2015 15:17:11 +0100
  • Delivery-date: Thu, 15 Oct 2015 14:17:57 +0000
  • List-id: Developer list for MirageOS <mirageos-devel.lists.xenproject.org>
  • Openpgp: id=11B5464249B5BD858FFF6328BC896588DF7C28EE

On 10/15/2015 14:56, Richard Mortier wrote:
> FWIW my motivation was: there are cases where one wishes to parse (or
> generate) structures without needing to implement server/client. The
> initial motivation was a reimplementation of a tcpdump-like facility,
> as used by (eg) ocaml-dns for its unit tests.

This sounds like a good idea!

> Hence, putting all code dealing with the wire-to-OCaml interface in
> Tftp_wire, and then (I'm currently fiddling with this, slowly) all the
> state machine logic in Tftp_S with the intent of having a Mirage
> unikernel implementation that uses Tftp_S to create a server instance
> (basically by bridging IO into Tftp_S).

I'm not sure what Tftp_S is (what the _S should do).  From my point of
view: put the (pure!) state machine logic somewhere [by pure I mean it
does not do IO or logging, but uses as signature `state -> bytes ->
(state * action list)`], where state is some abstract type, constructed
via some configuration step, and actions might contain:
 `Log "client ZZZ requested image YYY"
 `Tell_user "failed to find image YYY"
 `Send <packet>

Or maybe, if sending out a response is common enough, maybe use `state *
bytes option * actions`.

And then, on top of this state machine, which uses the wire_struct and
some state, use it to build either Lwt or Mirage layers (which translate
actions into side-effecting IO operations).

We/I tested this approach in
[TLS](http://mirleft.github.io/ocaml-tls/Engine.html) and [OTR (which
does not have any side effects in its
library)](http://hannesm.github.io/ocaml-otr/Otr.Engine.html)

(yes, my draft text disappeared, but might appear again next week)


hannes

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.