Hi,
Attached is a binding for libpcap, the packet capture library.
I'm looking for comments on how it might be improved, or any
particular infelicities that you notice. As I don't use hugs regularly
anymore, perhaps someone can point me to a good example
of a network library binding that works on both ghc and hugs.
It' s tested on FreeBSD (5.2.1-current) but should work with
any *nix that can build libpcap. It does not work with Winpcap, a
similar
library for windows, although it shouldn't be too hard to extend
it to do so.
The marshalling of packet data is purposely very lightweight
(data is returned as Ptr Word8). Having written a lot
of embedded software for network test equipment, I prefer the
flexibility of being able to marshal into IO-mutable arrays if
necessary. But I don't want to impose that on someone who
would be satisfied by [Word8].
Best Wishes,
Greg
Gregory Wright
Antiope Associate LLC
gwright(a)antiope.com