Hi, > I would explain u what I am doing. > I have a gateway. The gateway has say 3 interfaces. > One internal and 2 external. the gateway forms 2 > tunnels to 2 other computer on the internet. it > collects packets from internal interface and delivers > it to the tunnel. the packets from internal interface > are received into a queue because the number of > packets generated in the internal lan may be quiet > high.
These issues are covered by winpcap, whose main goal is avoiding that your application loses packets under sustained network load. The packets are buffered both in the capture driver and in wpcap.dll, so any further queing is unuseful and degrades the performance with additional copies. If you really want to decrease packet loss probability, the best way is to increase the kernel buffer size with pcap_setbuff(). Loris > the tunnel process picks packet from this queue > and delivers to the other end of the tunnel one by > one. > > May be u have something to suggest. > > Thanks > Nitesh > > --- Loris Degioanni <[EMAIL PROTECTED]> > 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 > > > http://finance.yahoo.com > > > > > > > > > > > > ================================================================== > > > This is the WinPcap users list. It is archived at > > > > > > http://www.mail-archive.com/[email protected]/ > > > > > > To unsubscribe use > > > mailto: > > > [EMAIL PROTECTED]?body=unsubscribe > > > > > > ================================================================== > > > > > > > > > ================================================================== > > This is the WinPcap users list. It is archived at > > > > > http://www.mail-archive.com/[email protected]/ > > > > To unsubscribe use > > mailto: > > > [EMAIL PROTECTED]?body=unsubscribe > > > ================================================================== > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Finance - Get real-time stock quotes > http://finance.yahoo.com > > > ================================================================== > This is the WinPcap users list. It is archived at > http://www.mail-archive.com/[email protected]/ > > To unsubscribe use > mailto: [EMAIL PROTECTED]?body=unsubscribe > ================================================================== > ================================================================== This is the WinPcap users list. It is archived at http://www.mail-archive.com/[email protected]/ To unsubscribe use mailto: [EMAIL PROTECTED]?body=unsubscribe ==================================================================
