tcpdump mailing list archives

Re: Headroom


From: "Gianluca Varenni" <gianluca.varenni () cacetech com>
Date: Fri, 6 Oct 2006 11:31:04 -0700

----- Original Message ----- From: "Harley Stenzel" <hstenzel () gmail com>
To: <tcpdump-workers () lists tcpdump org>
Sent: Friday, October 06, 2006 10:46 AM
Subject: [tcpdump-workers] Headroom


Greetings--

Has the idea of headroom for libpcap-based stack applications been
discussed before?  The idea is to have a known amount of empty/usable
space in front of the buffer given to the application by the
pcap_dispatch callback, pcap_next(), or pcap_next_ex().

It looks like it'd be a ((pcap_t *)p)->headroom, which would be added
to p->offset and p->bufsize for malloc.

p->offset would still have to guarantee alignment for for the data,
not for the beginning of the buffer.

Headroom would have to be specified at pcap_open_live() or
pcap_open_offline() time, so it could alter the pcap_t initialization
logic. I suppose the best approach would be to make an additional
variant of those functions, so the prototype changes don't ripple to
other apps.  Possibly have it be an additional options structure,
which may be null to get the current behavior.

Any thoughts?

Uhm, what's the purpose of some amount of memory put in front of the pcap_t structure?
Maybe I don't understand your proposal completely...

GV


Thanks.

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

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


Current thread: