tcpdump mailing list archives
Re: Buffer size question
From: Guy Harris <guy () alum mit edu>
Date: Wed, 13 Oct 2004 16:45:31 -0700
Ed Maste wrote:
1) Add a new pcap API function pcap_set_bufsize that can be usedto set the size used for following pcap_open_live calls (by setting a libpcap global variable).
The global variable is a bit ugly. If you're going to have API changes...
2) Add a new function like pcap_open_live that adds a buffer size argument. http://www.tcpdump.org/lists/workers/2000/msg01358.html
...you might as well do that, as there are other reasons for a new API.
3) Use an environment variable (PCAP_BUFFER_MAX?) to set the initial trial buffer size. Existing applications could even use a larger size without recompiling.4) Do a BIOCGBLEN ioctl before trying the initial size. If the size returned is greater than the initial size, just avoid BIOCSBLEN. On FreeBSD I've got a sysctl debug.bpf_bufsize that sets the default buffer size, but it has no effect for libpcap. The disadvantage is that the same size gets used for all pcap users, which might be undesirable.
One of those might also be useful.In fact, libpcap 0.8[.x] already does 4). Adding 3) might be useful to override the default for existing programs.
- This is the tcpdump-workers list. Visit https://lists.sandelman.ca/ to unsubscribe.
Current thread:
- Buffer size question Ed Maste (Oct 13)
- Re: Buffer size question Guy Harris (Oct 13)
- Re: Buffer size question Gianluca Varenni (Oct 14)
- Re: Buffer size question Guy Harris (Oct 14)
- Re: Buffer size question Gianluca Varenni (Oct 14)
- <Possible follow-ups>
- Re: Buffer size question Ed Maste (Oct 14)
- Re: Buffer size question Ed Maste (Oct 14)
- Re: Buffer size question Hannes Gredler (Oct 15)
- Re: Buffer size question Pekka Savola (Oct 15)
- Re: Buffer size question Guy Harris (Oct 15)
- Re: Buffer size question Hannes Gredler (Oct 15)
- Re: Buffer size question Ed Maste (Oct 15)
- Buffer size question Alexander Dupuy (Oct 18)
- Re: Buffer size question Guy Harris (Oct 18)
(Thread continues...)
- Re: Buffer size question Guy Harris (Oct 13)