tcpdump mailing list archives

Re: [PATCH] enable memory mapped access toethernet device for linux


From: "Paolo Abeni" <paolo.abeni () telecomitalia it>
Date: Wed, 05 Dec 2007 18:24:27 +0100

hello,

On Wed, 2007-12-05 at 08:23 -0800, Gianluca Varenni wrote:
From what you said, you basically changed the behavior of the snaplen 
parameter of pcap_open_live(). At the risk of being annoing, I find it a 
really bad idea. If it's called snaplen, it's the snaplen, period.
Isn't it possible to add a pcap function to set such parameter (or 
eventually create a new pcap_open_live_mmap() function)?

The idea behind the snaplen [miss-]use is to permit legacy application
to take advantage of the memory mapped access and permit new ones to
control the ring behaviur. Such goal could be obtained even with other
solution, but I was a bit 'scared' to add a 'Linux only' API to pcap.h.

Please note that any value into the [0-65535] range provided to
pcap_open_live into the snaplen parameter is used exactly in the same
way as before.

Undoubtedly my implementation is not the most clean one; I can rework
the patch adding a function to control the ring size [something like
'pcap_set_ring_size(handle, ring_size)'] and using some default values
for the memory mapped ring during pcap_open_live, if there is some
consensus in this direction.

Thanks for your feedback,

Paolo
--------------------------------------------------------------------

CONFIDENTIALITY NOTICE

This message and its attachments are addressed solely to the persons above and may contain confidential information. If 
you have received the message in error, be informed that any use of the content hereof is prohibited. Please return it 
immediately to the sender and delete the message. Should you have any questions, please contact us by replying to 
webmaster () telecomitalia it.

        Thank you

                                        www.telecomitalia.it

--------------------------------------------------------------------
                        
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: