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.) svn path=/trunk/; revision=32850
This commit is contained in:
parent
859c6e4d3e
commit
14c40a21aa
|
@ -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");
|
||||
|
|
40
dumpcap.c
40
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);
|
||||
|
|
Loading…
Reference in New Issue