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 <[email protected]>
Subject: Re: [Winpcap-users] correct usage of pcap_sendqueue_transmit?
To: [email protected]
Message-ID:
        <[email protected]>
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,  <[email protected]>
wrote:

> Date: Wed, 28 Oct 2009 16:06:33 -0700
> From: "Gianluca Varenni" <[email protected]>
> Subject: Re: [Winpcap-users] correct usage of pcap_sendqueue_transmit?
> To: <[email protected]>
> Message-ID: <51ccc9a0a65248c88f022bb28d90a...@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" <[email protected]>
> To: <[email protected]>
> 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
>> _______________________________________________

_______________________________________________
Winpcap-users mailing list
[email protected]
https://www.winpcap.org/mailman/listinfo/winpcap-users

Reply via email to