2021-11-30 13:01:36 +00:00
|
|
|
/** @file
|
|
|
|
*
|
2016-06-18 20:49:23 +00:00
|
|
|
* Common command line handling between GUIs
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-04-30 07:47:58 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2016-06-18 20:49:23 +00:00
|
|
|
|
|
|
|
#ifndef __COMMANDLINE_H__
|
|
|
|
#define __COMMANDLINE_H__
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
extern void commandline_print_usage(gboolean for_help_option);
|
|
|
|
|
2018-12-13 02:16:15 +00:00
|
|
|
extern void commandline_early_options(int argc, char *argv[]);
|
2016-06-18 20:49:23 +00:00
|
|
|
|
|
|
|
/* Command-line options that don't have direct API calls to handle the data */
|
|
|
|
typedef struct commandline_param_info
|
|
|
|
{
|
|
|
|
#ifdef HAVE_LIBPCAP
|
|
|
|
gboolean list_link_layer_types;
|
2017-08-07 14:38:52 +00:00
|
|
|
gboolean list_timestamp_types;
|
2016-06-18 20:49:23 +00:00
|
|
|
gboolean start_capture;
|
2016-06-28 01:40:09 +00:00
|
|
|
gboolean quit_after_cap;
|
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;
2021-07-15 05:16:30 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* We currently don't support this as a way to add file comments
|
|
|
|
* to an existing capture file in Wireshark; we only support it
|
|
|
|
* for adding comments to live captures.
|
|
|
|
*/
|
|
|
|
GPtrArray *capture_comments;
|
2016-06-18 20:49:23 +00:00
|
|
|
#endif
|
|
|
|
e_prefs *prefs_p;
|
|
|
|
search_direction jump_backwards;
|
2016-09-11 20:48:35 +00:00
|
|
|
guint32 go_to_packet;
|
2016-06-18 20:49:23 +00:00
|
|
|
gchar* jfilter;
|
|
|
|
gchar* cf_name;
|
|
|
|
gchar* rfilter;
|
|
|
|
gchar* dfilter;
|
2016-10-19 18:53:40 +00:00
|
|
|
gboolean full_screen;
|
2021-08-30 20:02:17 +00:00
|
|
|
GSList *user_opts;
|
2016-06-18 20:49:23 +00:00
|
|
|
|
|
|
|
} commandline_param_info_t;
|
|
|
|
|
2016-06-28 02:54:42 +00:00
|
|
|
extern void commandline_other_options(int argc, char *argv[], gboolean opt_reset);
|
2016-06-18 20:49:23 +00:00
|
|
|
|
2021-08-30 20:02:17 +00:00
|
|
|
extern void commandline_options_drop(const char *module_name, const char *pref_name);
|
|
|
|
|
|
|
|
extern void commandline_options_reapply(void);
|
|
|
|
|
|
|
|
extern void commandline_options_free(void);
|
|
|
|
|
2016-06-28 02:58:21 +00:00
|
|
|
extern commandline_param_info_t global_commandline_info;
|
2016-06-28 00:21:24 +00:00
|
|
|
|
2016-06-18 20:49:23 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* __COMMANDLINE_H__ */
|