aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.h
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-07-14 22:16:30 -0700
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-07-15 05:43:36 +0000
commit0a9ef601d201f87ff3effb8aca62c61184fd6146 (patch)
treece64e2ddc50cdf76bbc4dc785e069a50a820c7b4 /capture_opts.h
parent94ac641efabc9830bc91db1c793bf0ba42f1e46c (diff)
Clean up handling of --capture-comment.
Don't store the comments in a capture_options structure, because that's available only if we're being built with capture support, and --capture-comment can be used in TShark when reading a capture file and writing another capture file, with no live capture taking place. This means we don't handle that option in capture_opts_add_opt(); handle it in the programs that support it. Support writing multiple comments in dumpcap when capturing. These changes also fix builds without pcap, and makes --capture-comment work in Wireshark when a capture is started from the command line with -k. Update the help messages to indicate that --capture-comment adds a capture comment, it doesn't change any comment (much less "the" comment, as there isn't necessarily a single comment). Update the man pages: - not to presume that only pcapng files support file comments (even if that's true now, it might not be true in the future); - to note that multiple instances of --capture-comment are supported, and that multiple comments will be written, whether capturing or reading one file and writing another; - clarify that Wireshark doesn't *discard* SHB comments other than the first one, even though it only displays the first one;
Diffstat (limited to 'capture_opts.h')
-rw-r--r--capture_opts.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/capture_opts.h b/capture_opts.h
index 1452f30484..660a9746bd 100644
--- a/capture_opts.h
+++ b/capture_opts.h
@@ -44,10 +44,9 @@ extern "C" {
* In short: we must not use 1 here, which is another reason to use
* values outside the range of ASCII graphic characters.
*/
-#define LONGOPT_CAPTURE_COMMENT LONGOPT_BASE_CAPTURE+1
-#define LONGOPT_LIST_TSTAMP_TYPES LONGOPT_BASE_CAPTURE+2
-#define LONGOPT_SET_TSTAMP_TYPE LONGOPT_BASE_CAPTURE+3
-#define LONGOPT_COMPRESS_TYPE LONGOPT_BASE_CAPTURE+4
+#define LONGOPT_LIST_TSTAMP_TYPES LONGOPT_BASE_CAPTURE+1
+#define LONGOPT_SET_TSTAMP_TYPE LONGOPT_BASE_CAPTURE+2
+#define LONGOPT_COMPRESS_TYPE LONGOPT_BASE_CAPTURE+3
/*
* Options for capturing common to all capturing programs.
@@ -76,7 +75,6 @@ extern "C" {
#endif
#define LONGOPT_CAPTURE_COMMON \
- {"capture-comment", required_argument, NULL, LONGOPT_CAPTURE_COMMENT}, \
{"autostop", required_argument, NULL, 'a'}, \
{"ring-buffer", required_argument, NULL, 'b'}, \
LONGOPT_BUFFER_SIZE \
@@ -313,8 +311,6 @@ typedef struct capture_options_tag {
is specified */
gdouble autostop_duration; /**< Maximum capture duration */
- GPtrArray *capture_comment; /** capture comment to write to the
- output file */
gboolean print_file_names; /**< TRUE if printing names of completed
files as we close them */
gchar *print_name_to; /**< output file name */