Ty so much for answer. <br>Which method do you suggest me to use pcap_loop or pcap_next_ex?<br>Why use pcap_open for statistics?<br><br><div class="gmail_quote">On Tue, Jul 19, 2011 at 4:22 PM, Helmut Vaupotitsch <span dir="ltr"><<a href="mailto:hv@itec-audio.com">hv@itec-audio.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><u></u>


  

<div bgcolor="#ffffff" text="#000000">
<tt>Hi,<br>
<br>
This is possible if you use separate threads.<br>
Be sure that you leave your capture callback routine as soon as
possible, otherwise you will loose packets. (consider to use queues)<br>
Use Pcap_stats_ex (with a capture driver handle) to detect packet drops.<br>
<br>
On a given *single* adapter, i use pcap_open_live twice(for capturing)
and pcap_open twice(with to_ms=1000 and pcap_setmode for statistics
mode). The NPF filters can be set and altered at any time without
influencing the others.<br>
<br>
Regards<br>
Helmut<br>
</tt><br>
Emre Erişgen schrieb:
<blockquote type="cite"><div class="im">
  <p class="MsoNormal">I want to explain my question a little bit more.</p>
  <p class="MsoNormal"> </p>
  <p class="MsoNormal">Is it doable to listen a device with 2 different
filters and
capture packets? For example i start listening a device with a filter
and
dumping the packets to a pcap file, after 15min can i start another
listen on
the same device with different filter and dump the packets to another
pcap file
without stopping the old one? </p>
  <p class="MsoNormal"> </p>
  <p class="MsoNormal">Does pcap_open or pcap_next_ex block the
incoming packets?
What i mean if a packet arrives while listening from two different
threads one
of them will get the packet and control it for filter can the other
thread
access the packet? </p>
  <p class="MsoNormal"> </p>
  </div><pre><hr size="4" width="90%">
_______________________________________________
Winpcap-users mailing list
<a href="mailto:Winpcap-users@winpcap.org" target="_blank">Winpcap-users@winpcap.org</a>
<a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a>
  </pre>
</blockquote>
</div>

<br>_______________________________________________<br>
Winpcap-users mailing list<br>
<a href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><br>
<a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
<br></blockquote></div><br>