bos / pcap

Haskell bindings for the pcap library, which provides a low level interface to packet capture systems.
http://bitbucket.org/bos/pcap
Other
26 stars 11 forks source link

GNU/Linux "any" device support broken #2

Open zabbal opened 11 years ago

zabbal commented 11 years ago

While trying to open .pcap captured with "any" device in GNU/Linux I receive following error:

"user error (an interface has a type 113 different from the type of the first interface)"

This might to be related to old Debian bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546596

Package installed via "cabal install pcap" on ubuntu 12.10 x86_64 with libpcap0.8-dev

Test program below:

import Network.Pcap import System.IO import Control.Monad
import Foreign.Marshal.Array

printCap ph bytep = peekArray (fromIntegral (hdrCaptureLength ph)) bytep >>= print

main = do capture <- openOffline "test.pcap" dispatch capture (-1) printCap

ntc2 commented 7 years ago

How did you create the capture file "test.pcap"? I just made the dump* functions usable in #10, and using those dump* functions I can capture from the "any" interface and then read the dump back in with no trouble. I have not tried reading dumps created using other programs.