lkml.org 
[lkml]   [1999]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fw: Linux 2.0/2.1/2.2 -- Anyway to avoid different binaries??
On Wed, Feb 24, 1999 at 07:48:41PM +0100, Meelis Roos wrote:
> AK> You don't need to copy all of the packet, only as much of the header
> AK> that you want to examine (although the current linux libbpf wrapper always
> AK> copies the whole packet, but this is just a library bug @).
>
> Which is the best method of getting only headers to user level?

Only pass a small buffer to the recvmsg on the packet socket. Of course
you usually don't know in advance how long the headers are (e.g. TCP and
IP headers are variable length), but a worst case size of 128bytes should be
good. That is what you set in tcpdump with the -s (snaplen) option - with
it set libbpf only examines that many bytes, unfortunately the linux backend
of the current libbpf is dumb enough to always receive the complete MTU
sized packet.


-Andi


--
This is like TV. I don't like TV.

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

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