Re: byte manipulation in O'Caml (was: multi-threaded udp resolver)

From: Francois Pottier (Francois.Pottier@inria.fr)
Date: Mon Mar 20 2000 - 19:17:39 MET

  • Next message: Christophe Raffalli: "Re: Syntax for label, NEW SOLUTION"

    Hello,

    > Vixie's named/bind daemon doesn't even attempt to describe the
    > structure in any sort of data form, but rather uses the code flow
    > itself to describe the structure (e.g pulling 16 bits, assigning it to
    > a variable, advancing the interpretation pointer by 16 bits, testing
    > the variable, pulling 32 bits etc). This method is incredibly
    > error-prone, and it's hard to see a good way of fitting it in with
    > ocaml's type system. Any ideas on the best way to approach this problem?

    I have written an O'Caml module, called Zone, which helps writing this
    kind of code by providing a set of rather high-level manipulation
    primitives for loosely-structured memory blocks. I attach the code
    below.

    Hope this helps,

    -- 
    François Pottier
    Francois.Pottier@inria.fr
    http://pauillac.inria.fr/~fpottier/
    





    This archive was generated by hypermail 2b29 : Tue Mar 21 2000 - 15:38:35 MET