aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2010-05-17 23:56:00 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2010-05-17 23:56:00 +0000
commitb145e3d31f1c302a6ae274b2ba77a72470391697 (patch)
treef99dc55a9cbb5b539c475acb2c1c4bed84433a1c
parent894a783863d51be1269701d8c8b56b0411dd157b (diff)
Make -Z always generate machine-readable output, and don't bother
supplying -M along with -Z. (We keep -M around for debugging use; it's documented, unlike -Z.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32850 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--capture_sync.c3
-rw-r--r--dumpcap.c40
2 files changed, 26 insertions, 17 deletions
diff --git a/capture_sync.c b/capture_sync.c
index 4665473630..df9d85deea 100644
--- a/capture_sync.c
+++ b/capture_sync.c
@@ -1007,7 +1007,6 @@ sync_interface_list_open(gchar **data, gchar **primary_msg,
/* Ask for the interface list */
argv = sync_pipe_add_arg(argv, &argc, "-D");
- argv = sync_pipe_add_arg(argv, &argc, "-M");
#ifndef DEBUG_CHILD
/* Run dumpcap in capture child mode */
@@ -1054,7 +1053,6 @@ sync_if_capabilities_open(const gchar *ifname, gboolean monitor_mode,
argv = sync_pipe_add_arg(argv, &argc, "-L");
if (monitor_mode)
argv = sync_pipe_add_arg(argv, &argc, "-I");
- argv = sync_pipe_add_arg(argv, &argc, "-M");
#ifndef DEBUG_CHILD
/* Run dumpcap in capture child mode */
@@ -1095,7 +1093,6 @@ sync_interface_stats_open(int *data_read_fd, int *fork_child, gchar **msg)
/* Ask for the interface statistics */
argv = sync_pipe_add_arg(argv, &argc, "-S");
- argv = sync_pipe_add_arg(argv, &argc, "-M");
#ifndef DEBUG_CHILD
argv = sync_pipe_add_arg(argv, &argc, "-Z");
diff --git a/dumpcap.c b/dumpcap.c
index c33b16921e..2b4a305b92 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -3099,24 +3099,36 @@ main(int argc, char *argv[])
}
#endif
- /* Determine if dumpcap is being requested to run in a special */
- /* capture_child mode by going thru the command line args to see if */
- /* a -Z is present. (-Z is a hidden option). */
- /* The primary result of running in capture_child mode is that */
- /* all messages sent out on stderr are in a special type/len/string */
- /* format to allow message processing by type. */
- /* These messages include various 'status' messages which are sent */
- /* when an actual capture is in progress. Capture_child mode */
- /* would normally be requested by a parent process which invokes */
- /* dumpcap and obtains dumpcap stderr output via a pipe to which */
- /* dumpcap stderr has been redirected. */
- /* Capture_child mode needs to be determined immediately upon */
- /* startup so that any messages generated by dumpcap in this mode */
- /* (eg: during initialization) will be formatted properly. */
+ /*
+ * Determine if dumpcap is being requested to run in a special
+ * capture_child mode by going thru the command line args to see if
+ * a -Z is present. (-Z is a hidden option).
+ *
+ * The primary result of running in capture_child mode is that
+ * all messages sent out on stderr are in a special type/len/string
+ * format to allow message processing by type. These messages include
+ * error messages if dumpcap fails to start the operation it was
+ * requested to do, as well as various "status" messages which are sent
+ * when an actual capture is in progress, and a "success" message sent
+ * if dumpcap was requested to perform an operation other than a
+ * capture.
+ *
+ * Capture_child mode would normally be requested by a parent process
+ * which invokes dumpcap and obtains dumpcap stderr output via a pipe
+ * to which dumpcap stderr has been redirected. It might also have
+ * another pipe to obtain dumpcap stdout output; for operations other
+ * than a capture, that information is formatted specially for easier
+ * parsing by the parent process.
+ *
+ * Capture_child mode needs to be determined immediately upon
+ * startup so that any messages generated by dumpcap in this mode
+ * (eg: during initialization) will be formatted properly.
+ */
for (i=1; i<argc; i++) {
if (strcmp("-Z", argv[i]) == 0) {
capture_child = TRUE;
+ machine_readable = TRUE; /* request machine-readable output */
#ifdef _WIN32
/* set output pipe to binary mode, to avoid ugly text conversions */
_setmode(2, O_BINARY);