lkml.org 
[lkml]   [2002]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: is CONFIG_PACKET_MMAP always a win?
From
Date
On Fri, 2002-02-22 at 06:45, Ben Greear wrote:
>
>
> David S. Miller wrote:
>
> > From: Dan Kegel <dank@kegel.com>
> > Date: Thu, 21 Feb 2002 17:51:20 -0800
> >
> > What's the best way to retrieve raw packets from the kernel?
> >
> > a) use libpcap
> > ...
> > b) use af_packet
> > ...
> > c) enable CONFIG_PACKET_MMAP, use PACKET_RX_RING
> >
> > If I understand it right, b costs one memcpy and one recv, and c costs
> > two memcpys. Which one wins?
> >
> > "a" should be doing "c" when it is available in the kernel.
> > If not, get a newer copy of the libpcap sources, preferably
> > from Alexey's site:
> >
> > ftp.inr.ac.ru:/ip-routing/
>
>
> And if you can figure out how to do c, and feel like
> sharing, please do let me know! Documentation is a
> bit sparse..at least wherever I've been looking.

Yeah I found it a bit lacking too, I got there in the end though. Check
out: http://www.scaramanga.co.uk/code-fu/lincap.c

--
// Gianni Tedesco <gianni@ecsc.co.uk>
80% of all email is a figment of procmails imagination.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.132 / U:23.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site