bos / pcap

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

loop and loopBS have incorrect documentation. #4

Open joecrayne opened 9 years ago

joecrayne commented 9 years ago

The haddock documentation for loop and loopBS indicate that I should expect the number of packets processed to be returned. I was therefore surpised when loopBS lied to me that I had processed zero packets. Checking the original pcap_loop man page, I see an explanation:

pcap_loop() returns 0 if cnt is exhausted or if, when reading from a ``savefile'', no more packets are available. It returns -1 if an error occurs or -2 if the loop terminated due to a call to pcap_breakloop() before any packets were processed.