tcpdump mailing list archives

Re: Exposing linux libpcap ring buffer usage information


From: Guy Harris <guy () alum mit edu>
Date: Wed, 15 Jul 2009 13:34:12 -0700


On Jul 15, 2009, at 12:45 PM, Dustin Spicuzza wrote:

I've attached a git patch to add a function, pcap_buffer_stats() to the pcap API. I noticed some other platforms use the handle- >opt.buffer_size variable, but I don't have access to build any of those so I didn't try
an implementation of this API for them.

...and those particular statistics might not apply to them; I haven't looked at your patch in detail, but, for example, the FreeBSD memory- mapped capture mechanism appears (from what I've seen in passing) to preserve the BPF store buffer/hold buffer model, where packets are appended to the store buffer and a "read" involves re-designating the store buffer as the hold buffer, marking the hold buffer as empty, and re-designating it as the store buffer, a read() copies the hold buffer to userland, and in memory-mapped mode the user-mode code extracts packets from the hold buffer.

I'll have to look at the patch a little more and think about it; it might be that we'd just make the stats API platform-dependent.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: