From 0a9ef601d201f87ff3effb8aca62c61184fd6146 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 14 Jul 2021 22:16:30 -0700 Subject: 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; --- ui/capture.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ui/capture.h') diff --git a/ui/capture.h b/ui/capture.h index 6589dfc8e7..f02e18ed92 100644 --- a/ui/capture.h +++ b/ui/capture.h @@ -60,13 +60,17 @@ capture_input_init(capture_session *cap_session, capture_file *cf); * Start a capture session. * * @param capture_opts the numerous capture options + * @param capture_comments if not NULL, a GPtrArray * to a set of comments + * to put in the capture file's Section Header Block if it's a pcapng file * @param cap_session the handle for the capture session * @param cap_data a struct with capture info data * @param update_cb update screen * @return TRUE if the capture starts successfully, FALSE otherwise. */ extern gboolean -capture_start(capture_options *capture_opts, capture_session *cap_session, info_data_t* cap_data, void(*update_cb)(void)); +capture_start(capture_options *capture_opts, GPtrArray *capture_comments, + capture_session *cap_session, info_data_t* cap_data, + void(*update_cb)(void)); /** Stop a capture session (usually from a menu item). */ extern void -- cgit v1.2.3