Ethereal is based on winpcap, so the fact that it's able to keep up means that either:
- there's something wrong in the way you interact with winpcap. For example, your timeout is very short: this not only causes pcap_next_ex() to timeout very often, but possibly increases CPU load.
- your application is too slow in processing the packets, the capture buffers become full and your capture instance drops packets.


Loris


Tom Brown wrote:
Hi,

I am using pcap_next_ex() in my application in a loop to capture all packets on an ethernet device. I have compared the amount of packets that my application captures to what ethereal captures and my calls to pcap_next_ex() are just not picking up everything. More importantly, the packets I need it to capture are not being captured all the time. My application is in constant communication with a device to monitor its status. I used ethereal to verify the device was always replying to my application. The code snippets below are written in Delphi. Here is my call to pcap_open():

  fp := pcap_open(PAnsiChar(ADeviceName), 65536, PCAP_OPENFLAG_PROMISCUOUS,
    1, nil, errorbuf);

Here is my call to pcap_next_ex() which is in a loop:

  ret := pcap_next_ex(fp, @pktheader, @pktdata);

I can provide more code if you want it. pcap_next_ex() times out a lot. Am I doing something wrong here? Are there other reasons that pcap_next_ex() would timeout instead of capturing packets? Any ideas would be appreciated.

Thanks,
Tom


================================================================== This is the WinPcap users list. It is archived at http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

To unsubscribe use mailto: [EMAIL PROTECTED]
==================================================================




==================================================================
This is the WinPcap users list. It is archived at
http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

To unsubscribe use mailto: [EMAIL PROTECTED]
==================================================================

Reply via email to