diff options
author | Guy Harris <gharris@sonic.net> | 2021-07-14 22:16:30 -0700 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-07-15 05:43:36 +0000 |
commit | 0a9ef601d201f87ff3effb8aca62c61184fd6146 (patch) | |
tree | ce64e2ddc50cdf76bbc4dc785e069a50a820c7b4 /capture_opts.c | |
parent | 94ac641efabc9830bc91db1c793bf0ba42f1e46c (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.c')
-rw-r--r-- | capture_opts.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/capture_opts.c b/capture_opts.c index e87bc9f653..504560caee 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -115,7 +115,6 @@ capture_opts_init(capture_options *capture_opts) capture_opts->autostop_filesize = 1000; /* 1 MB */ capture_opts->has_autostop_duration = FALSE; capture_opts->autostop_duration = 60.0; /* 1 min */ - capture_opts->capture_comment = NULL; capture_opts->output_to_pipe = FALSE; capture_opts->capture_child = FALSE; @@ -147,10 +146,6 @@ capture_opts_cleanup(capture_options *capture_opts) capture_opts->all_ifaces = NULL; } g_free(capture_opts->save_file); - if (capture_opts->capture_comment != NULL) { - g_ptr_array_free(capture_opts->capture_comment, TRUE); - capture_opts->capture_comment = NULL; - } } /* log content of capture_opts */ @@ -803,12 +798,6 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg_ int status, snaplen; switch(opt) { - case LONGOPT_CAPTURE_COMMENT: /* capture comment */ - if (!capture_opts->capture_comment) { - capture_opts->capture_comment = g_ptr_array_new_with_free_func(g_free); - } - g_ptr_array_add(capture_opts->capture_comment, g_strdup(optarg_str_p)); - break; case 'a': /* autostop criteria */ if (set_autostop_criterion(capture_opts, optarg_str_p) == FALSE) { cmdarg_err("Invalid or unknown -a flag \"%s\"", optarg_str_p); |