[Winpcap-users] Fw: Please take a look

Gianluca Varenni gianluca.varenni at cacetech.com
Mon Aug 10 16:02:09 PDT 2009

----- Original Message ----- 
From: Gianluca Varenni 
To: Dennis Drew 
Cc: winpcap-users at winpcap.org 
Sent: Monday, August 10, 2009 3:55 PM
Subject: Re: Please take a look

----- Original Message ----- 
  From: Dennis Drew 
  To: Gianluca Varenni 
  Cc: Dennis Drew 
  Sent: Monday, August 10, 2009 3:29 PM
  Subject: Please take a look

  I took the code from this page in the second section in this page

  Send queues 

  While pcap_sendpacket() offers a simple and immediate way to send a single packet, send queues provides an advanced, powerful and optimized mechanism to send a collection of packets. A send queue is a container for a variable number of packets that will be sent to the network. It has a size, that represents the maximum amount of bytes it can store.

  and made the attached file "SendPackets.cpp" out of the code from the html page. I couldn't find the source in the download WinPacap projects anywhere.

The sample "WpdPack\Examples-remote\sendcap" shows how to use the send queues.

  See the breakpoint in this code in my running program in the attached jpeg. The dot pcap file I have has 234844 packets in it. I sent the 's' character to honor the timings and it took up 98 percent of my cpu and ran for 15 mins before I killed the debugger to get my system back.

When the sync option is used, the driver uses a busy wait loop to send the packet trying to respect the timestamps. Since we do not have any facility to send packets at a specified time from the hardware, we emulate it in software with a busy wait loop. This option was mainly introduced for some specific testing scenarios in which you want to create a precise timed packet generator.

Let me know if this answers your question.
Have a nice day

PS: Please, do not send your emails directly to me, please send them to the winpcap-users mailing list (that I've put in CC).

  Looks like good code as if there were any memory leaks it would have crashed a long time ago.

  Having fun with winpcap!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20090810/59e803fd/attachment.htm 

More information about the Winpcap-users mailing list