[Winpcap-users] Winpcap-users Digest, Vol 55, Issue 22

Noam Cohen Noam.Cohen at harmonicinc.com
Sun Nov 1 00:24:27 PDT 2009


Adding a (special) packet to the first call of pcap_sendqueue_transmit() in order to 'link' the time with the second call is problematic
since not always the caller can know the required transmission time of the second call during the first call.

Why not adding a flag that will say "use same time base since first call": pcap_sendqueue_transmit(... , bool usePreviousTimeBase = false),
 or even better: add a new function pcap_set_sendqueue_time_base(timeval* origin). If this function is called, all transmissions will use this time base.

PS: how do people transmit long files? Use your own busy loop?

Noam

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

Message: 1
Date: Fri, 30 Oct 2009 07:22:59 +0530
From: Adagio Grazioso <adagiograzioso at gmail.com>
Subject: Re: [Winpcap-users] correct usage of pcap_sendqueue_transmit?
To: winpcap-users at winpcap.org
Message-ID:
	<239eee8d0910291852o1a49fa00ue4c2b5e994f76939 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

GV,
To work around this, can we have a 'feature' which allows adding pkts to a
send queue with a caplen/len of 0? If this is supported, we can add a pkt
with a len of 0 to the end of the first sendqueue with the appropriate
timestamp.
Adagio
On Fri, Oct 30, 2009 at 12:30 AM,  <winpcap-users-request at winpcap.org>
wrote:

> Date: Wed, 28 Oct 2009 16:06:33 -0700
> From: "Gianluca Varenni" <gianluca.varenni at cacetech.com>
> Subject: Re: [Winpcap-users] correct usage of pcap_sendqueue_transmit?
> To: <winpcap-users at winpcap.org>
> Message-ID: <51CCC9A0A65248C88F022BB28D90AFA3 at NELSON3>
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
>        reply-type=original
>
> The usage is correct, indeed. However, pcap_sendqueue_transmit respects
the
> timestamps within the queue, but not between two different calls to the
same
> function.
>
> Suppose that the last packet in the queue has a timestamp of 10s, and the
> first packet of the next queue has a timestamp of 11s. When
> pcap_sendqueue_transmit transmits the second queue, it will not respect
the
> timestamp of the first packet(11s), it will send it immediately.
>
> Have a nice day
> GV
>
> ----- Original Message -----
> From: "Noam Cohen" <Noam.Cohen at harmonicinc.com>
> To: <winpcap-users at winpcap.org>
> Sent: Tuesday, October 27, 2009 4:09 AM
> Subject: [Winpcap-users] correct usage of pcap_sendqueue_transmit?
>
>
>> GV,
>> I have a PCAP file of 400MB which has to be played in endless loop. I
read
>> a packet and send it using the Transmit() described in the pseudo code.
>> In the wireshark tutorial, "sendcap", the whole file is added into the
>> transmit queue and then transmitted. This does not work with large files
>> (or when a loop play is needed).
>> In the Transmit(), I fill the queue with packets and when near fullness,
>> call pcap_sendqueue_transmit(). I would expect it to *clear* the queue
but
>> it does not happen. The only way I see to reuse the queue is to destroy
>> and then allocate it again. Is this the way it is meant to be ?!
>>
>> Are the packets which are added to the queue actually copied? I assume so
>> since there is no other mechanism to keep the memory valid.
>>
>> Thanks
>> Noam
>> _______________________________________________



More information about the Winpcap-users mailing list