aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2004-03-13 22:49:30 +0000
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2004-03-13 22:49:30 +0000
commit91b4aaa1e8f5b46dcfc2ca828a5e1d579ee29b3f (patch)
tree82c65bc81d0037a4529468ff8561a0a8b61647e3 /capture.c
parent1b64be05a71e963a30635c94f3854495d978ab1b (diff)
experimental: make usage of pcap_setbuff to increase the kernel buffer size
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10377 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/capture.c b/capture.c
index 7644af8eed..be3a16c17a 100644
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.245 2004/03/04 21:27:55 ulfl Exp $
+ * $Id: capture.c,v 1.246 2004/03/13 22:49:30 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1516,6 +1516,20 @@ capture(gboolean *stats_known, struct pcap_stat *stats)
open_err_str);
if (pch != NULL) {
+#ifdef _WIN32
+ /* try to set the capture buffer size */
+ if (pcap_setbuff(pch, capture_opts.buffer_size * 1024 * 1024) != 0) {
+ simple_dialog(ESD_TYPE_INFO, ESD_BTN_OK,
+ "%sCouldn't set the capture buffer size!%s\n"
+ "\n"
+ "The capture buffer size of %luMB seems to be too high for your machine,\n"
+ "the default of 1MB will be used.\n"
+ "\n"
+ "Nonetheless, the capture is started.\n",
+ simple_dialog_primary_start(), simple_dialog_primary_end(), capture_opts.buffer_size);
+ }
+#endif
+
/* setting the data link type only works on real interfaces */
if (capture_opts.linktype != -1) {
set_linktype_err_str = set_pcap_linktype(pch, cfile.iface,