views:

341

answers:

1

Hi,

I used pcap_sendPacket() to send raw UDP packet which i crafted manually.

i want to increase the performance of my code by reducing the

context switches.

But i got the sample code about pcap_sendqueue_queue() function

it sends variable number of packets in a time.but it reads read from

the already dumped .pcap file and .cap file.

i want to use this queue() function to send the same UDP packets which i crafted

it manually.

this is the link for sending the packets using pcap_sendpacket()?

http://pastebin.com/m402783ae

how to modify this code to send this packets in a queue()?

thanks in advance

A: 

To use winpcap's packet queue you'll have to invoke:

  • pcap_sendqueue_alloc - to alloc a queue for raw packets;
  • pcap_sendqueue_queue - to add raw packets to the queue (in pcap format);
  • pcap_sendqueue_transmit - to send the queue.

Yet, I don't see the point in your question that is not covered in winpcap docs (or google).

Andrey