On 27 March 2015 at 17:17, Anil Madhavapeddy <[email protected]> wrote:
>> 1. Split all wire format de/serialization code out of each protocol
>> into a distinct library. Link against this library in both
>> `pcap-format` and `ocaml-<protocol>`. Unit test the protocol
>> implementation separately (perhaps via property-based testing which
>> might not require a separate implementation, perhaps relying on
>> completely distinct implementations like `libpcap`).
>
> This one sounds best to me.

Good -- it's probably my preferred one too. Guess it would mean
creating `x` and `x-format` (and perhaps `x-unix` to capture the
values that convert files to streams of captured packets) for x =
pcap, tcpip, dns, etc etc; and then a separate `trace-analysis`
library or something...

> Although, it sounds like there's a
> certain amount of feature creep going into pcap-format.
>
> Why not just parse the raw pcap format in pcap-format, and have a new
> pcap-format-analysis library that depends on both pcap-format and ocaml-dns?

Not sure what you mean. What was the intended feature set of `pcap-format`?

The first version of `pcap-format` parsed the PCAP container format,
Ethernet, IP, TCP from Unix files iirc.

I hacked about to add some more, but then stopped doing that and
started trying to use existing implementations, starting with
`ocaml-dns` as that seemed easier than trying to use `tcipip` to cover
TCP and IP (and Ethernet?), and I wanted a `libpcap` lookalike for
Mirage.

Are you suggesting

4. Strip `pcap-format` back to just the PCAP container parsing code,
and create `pcap-format-analysis` as a separate library?

In which case the same problem will arise as I believe the current
unit test code in `ocaml-dns` will end up relying on
`pcap-format-analysis` as currently posed. (Presumably the point being
to use an independent implementation of the wire format parsers to
unit test the `ocaml-dns` implementations.)

-- 
Richard Mortier
[email protected]

_______________________________________________
MirageOS-devel mailing list
[email protected]
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

Reply via email to