aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dumpcap.c25
-rw-r--r--log.h1
-rw-r--r--tethereal.c4
3 files changed, 21 insertions, 9 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 57441f33e8..c0dc3355aa 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -56,7 +56,7 @@
#ifdef _WIN32
#include "capture-wpcap.h"
-#include "capture_wpcap_packet.h"
+/*#include "capture_wpcap_packet.h"*/
#endif
#include "capture.h"
@@ -337,17 +337,17 @@ main(int argc, char *argv[])
/*** capture option specific ***/
case 'a': /* autostop criteria */
case 'b': /* Ringbuffer option */
- case 'c': /* Capture xxx packets */
+ case 'c': /* Capture x packets */
case 'f': /* capture filter */
- case 'i': /* Use interface xxx */
+ case 'i': /* Use interface x */
case 'p': /* Don't capture in promiscuous mode */
case 's': /* Set the snapshot (capture) length */
- case 'w': /* Write to capture file xxx */
+ case 'w': /* Write to capture file x */
case 'y': /* Set the pcap data link type */
#ifdef _WIN32
case 'B': /* Buffer size */
/* Hidden option supporting Sync mode */
- case 'Z': /* Write to pipe FD XXX */
+ case 'Z': /* Write to pipe FD x */
#endif /* _WIN32 */
capture_opts_add_opt(capture_opts, opt, optarg, &start_capture);
break;
@@ -371,7 +371,7 @@ main(int argc, char *argv[])
argv += optind;
if (argc >= 1) {
/* user specified file name as regular command-line argument */
- /* XXX - use it as the capture file name (or somthing else)? */
+ /* XXX - use it as the capture file name (or something else)? */
argc--;
argv++;
}
@@ -607,6 +607,9 @@ pipe_write_block(int pipe, char indicator, int len, const char *msg)
/*g_warning("write %d enter", pipe);*/
+ /* XXX - find a suitable way to switch between pipe and console output */
+ return;
+
g_assert(indicator < '0' || indicator > '9');
g_assert(len <= SP_MAX_MSG_LEN);
@@ -643,13 +646,17 @@ sync_pipe_packet_count_to_parent(int packet_count)
{
char tmp[SP_DECISIZE+1+1];
+
+ count += packet_count;
+ fprintf(stderr, "\r%u", count);
+ /* stderr could be line buffered */
+ fflush(stderr);
+
+
g_snprintf(tmp, sizeof(tmp), "%d", packet_count);
/*g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "sync_pipe_packet_count_to_parent: %s", tmp);*/
- count += packet_count;
- fprintf(stderr, "\rPackets: %u", count);
-
pipe_write_block(1, SP_PACKET_COUNT, strlen(tmp)+1, tmp);
}
diff --git a/log.h b/log.h
index 4d13bbecf2..768d3db8f2 100644
--- a/log.h
+++ b/log.h
@@ -35,6 +35,7 @@
#define LOG_DOMAIN_MAIN "Main"
/* enable very verbose capture log debug output */
+/* (might slightly degrade performance) */
/*#define LOG_CAPTURE_VERBOSE*/
diff --git a/tethereal.c b/tethereal.c
index 1dc2ae01f6..8f004c2502 100644
--- a/tethereal.c
+++ b/tethereal.c
@@ -102,6 +102,7 @@
#include "capture_loop.h"
#endif /* HAVE_LIBPCAP */
#include "epan/emem.h"
+#include "log.h"
/*
* This is the template for the decode as option; it is shared between the
@@ -649,6 +650,9 @@ main(int argc, char *argv[])
g_log_set_handler(NULL,
log_flags,
log_func_ignore, NULL /* user_data */);
+ g_log_set_handler(LOG_DOMAIN_CAPTURE_CHILD,
+ log_flags,
+ log_func_ignore, NULL /* user_data */);
/* initialize memory allocation subsystem */
ep_init_chunk();