LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   types of error's when capturing packets using pcap library (http://www.linuxquestions.org/questions/programming-9/types-of-errors-when-capturing-packets-using-pcap-library-405607/)

cynthia_thomas 01-19-2006 09:28 PM

types of error's when capturing packets using pcap library
 
hi,

I read that the pcap_next() function in pcap library will capture packets till an error occurs. I am intrested in knowing the types of errors that may cause this function to stop capturing the packets.
If any body know the answer , please reply

thanks and regards
cynthia

bulliver 01-21-2006 07:55 AM

From this link:
http://www.die.net/doc/linux/man/man3/pcap.3.html

Quote:

NULL is returned if an error occured, or if no packets were read from a live capture (if, for example, they were discarded because they didn't pass the packet filter, or if, on platforms that support a read timeout that starts before any packets arrive, the timeout expires before any packets arrive, or if the file descriptor for the capture device is in non-blocking mode and no packets were available to be read), or if no more packets are available in a ``savefile.'' Unfortunately, there is no way to determine whether an error occured or not.


All times are GMT -5. The time now is 01:58 PM.