[Winpcap-users] Capturing packets for a certain time

Gianluca Varenni gianluca.varenni at cacetech.com
Fri Nov 13 07:39:28 PST 2009


My suggestion is to use pcap_next_ex, and a timeout (in pcap_open_live) of 1 second or less. You are sure that pcap_next_ex will return at most after the timeout you used in pcap_open_live (on Windows), and after that you just need to see if the certain amount of time is elapsed or not.

Have a nice day
GV
  ----- Original Message ----- 
  From: Emre 
  To: winpcap-users at winpcap.org 
  Sent: Thursday, November 12, 2009 5:30 AM
  Subject: [Winpcap-users] Capturing packets for a certain time


  Hi, i want to capture packets from an interface for a certain time. There is example with pcap_loop function which captures packets with cnt parameter. This function captures cnt number of packets from interface . But i want to do is capture packets from an interface for ten seconds. There is a pcap_breakloop function for breaking the pcap_loop but i don't know how to use it for my need. Please help. 


------------------------------------------------------------------------------


  _______________________________________________
  Winpcap-users mailing list
  Winpcap-users at winpcap.org
  https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20091113/2a053756/attachment.htm 


More information about the Winpcap-users mailing list