Hi Loris,

I had agreed to your point that queing is an unusual approach and hence did not pursue my point further.  But, goin on further to my requirement, I realized that a queue is still required if I want to do the following

I want to send an IP packet to a particular IP address.  What the function handling the IP packet should do is:

1. Check whether there is an ARP h/w address mapping available for that address.  If yes it sends that packet to that h/w address (I am managing my own ARP table and ARP protocol)

2. If not, it should queue the packet to a particular interface and send an ARP request for that IP

3.  When the ARP response arrives, it will deque the packe and then send that packet.

What are your comments.

Thanks,

Nitesh

You Wrote:

The buffer received by the callback must be considered valid only in the
callback itself: WinPcap recycles it to store successive packets.
Why do you need to queue the packet instead of processing it in the
callback? It's a quite unusual approach...

Loris

> Hi,
>
> When using pcap_loop, the callback function receives a
> pointer to the packet data.  What is the scope of this
> memory segment containg packet data.  I want to know
> this because I want to queue this packet so as to
> process it when it's turn comes.  So, do I need to
> copy this packet data to new location before inserting
> it into the queue or can I just queue the pointer to
> that data.
>
> Thanks,
> Nitesh
>



Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes

Reply via email to