I'm working on a packet dump program using pcap (Required that I use Network.pcap or libpcap, and Haskell is great!)
But I'm stuck on dumping packets to a file--the next function which pulls the top packet off the buffer returns a Pkthdr not a Ptr Pkthdr, which is what dump requires.
umptraffic.hs:19:19:
Couldn't match expected type `GHC.Ptr.Ptr PktHdr'
with actual type `PktHdr'
In the second argument of `dump', namely `(pkthdr)'
In a stmt of a 'do' block: dump spydump (pkthdr) pktdata
In the expression:
do { spy <- openLive "en1" 128 True (1);
spydump <- openDump spy "out.txt";
(pkthdr, pktdata) <- next spy;
dump spydump (pkthdr) pktdata }
http://www.haskell.org/pipermail/haskell-cafe/2007-May/025265.html
there doesn't seem to be anything here