diff options
author | Guy Harris <guy@alum.mit.edu> | 2010-05-17 23:56:00 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2010-05-17 23:56:00 +0000 |
commit | 14c40a21aa2f852623b45af06ee1b4c8f6f3e047 (patch) | |
tree | f99dc55a9cbb5b539c475acb2c1c4bed84433a1c /dumpcap.c | |
parent | 859c6e4d3ee7d483f74f338c563f9ab9ee9a10e1 (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.)
svn path=/trunk/; revision=32850
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 40 |
1 files changed, 26 insertions, 14 deletions
@@ -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); |