2021-11-30 08:01:36 -05:00
|
|
|
/** @file
|
|
|
|
*
|
2016-06-18 16:49:23 -04:00
|
|
|
* Common command line handling between GUIs
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-04-30 09:47:58 +02:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2016-06-18 16:49:23 -04:00
|
|
|
|
|
|
|
#ifndef __COMMANDLINE_H__
|
|
|
|
#define __COMMANDLINE_H__
|
|
|
|
|
2024-02-15 10:39:39 -05:00
|
|
|
#include "cfile.h" /* For search_direction */
|
|
|
|
|
2016-06-18 16:49:23 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2025-04-21 12:10:32 -04:00
|
|
|
extern int commandline_early_options(int argc, char *argv[]);
|
2016-06-18 16:49:23 -04:00
|
|
|
|
|
|
|
|
2025-04-28 13:30:46 +00:00
|
|
|
extern const struct ws_option* commandline_long_options(void);
|
|
|
|
|
|
|
|
extern const char* commandline_optstring(void);
|
|
|
|
|
2024-03-29 18:08:09 -07:00
|
|
|
extern void commandline_override_prefs(int argc, char *argv[], bool opt_reset);
|
Fix overriding capture option prefs at the command line
Some capture options can be overridden with command line arguments.
We want those options, like -p, -n/-P, -H, -S, and --update-interval,
to take precedence over preferences, at least until the user saves
preferences or switches profiles (at which point the new settings
will be applied.) That means we have to apply preferences to capture
options before we read most command line arguments.
However, preferences can be altered at the command line, including
the preferences that affect the capture options. So we have to
read the command line arguments that alter preferences after
reading preferences (which has to be after reading command line
arguments that control what preferences are read, like the
configuration profile), but before applying preferences to the
capture options.
Add a new "process some command line options" function that only
gets the command line options that override preferences. Final
interleaved command line / preference / capture options sequence:
1. Read command line arguments that affect what preferences to read
2. Initialize capture options to default value
3. Read preferences
4. Read command line arguments that affect value of already read
preferences
5. Apply preferences to capture options
6. Read other command line arguments, set capture options final values
7. Apply other preferences
Fix #14549
2023-11-15 21:12:47 -05:00
|
|
|
|
2024-03-29 18:08:09 -07:00
|
|
|
extern void commandline_other_options(int argc, char *argv[], bool opt_reset);
|
2016-06-18 16:49:23 -04:00
|
|
|
|
2021-08-30 16:02:17 -04:00
|
|
|
extern void commandline_options_drop(const char *module_name, const char *pref_name);
|
|
|
|
|
|
|
|
extern void commandline_options_reapply(void);
|
|
|
|
|
2024-09-09 23:12:03 -04:00
|
|
|
extern void commandline_options_apply_extcap(void);
|
|
|
|
|
2021-08-30 16:02:17 -04:00
|
|
|
extern void commandline_options_free(void);
|
|
|
|
|
2025-05-16 06:36:13 -04:00
|
|
|
extern bool commandline_is_full_screen(void);
|
|
|
|
|
|
|
|
extern char* commandline_get_cf_name(void);
|
|
|
|
|
|
|
|
extern char* commandline_get_rfilter(void);
|
|
|
|
|
|
|
|
extern char* commandline_get_dfilter(void);
|
|
|
|
|
|
|
|
extern char* commandline_get_jfilter(void);
|
|
|
|
|
|
|
|
extern search_direction commandline_get_jump_direction(void);
|
|
|
|
|
|
|
|
extern uint32_t commandline_get_go_to_packet(void);
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBPCAP
|
|
|
|
extern bool commandline_is_start_capture(void);
|
|
|
|
|
|
|
|
extern bool commandline_is_quit_after_capture(void);
|
|
|
|
|
|
|
|
extern char* commandline_get_first_capture_comment(void);
|
|
|
|
|
|
|
|
extern int commandline_get_caps_queries(void);
|
|
|
|
|
|
|
|
extern GPtrArray* commandline_get_capture_comments(void);
|
|
|
|
|
|
|
|
#endif
|
2016-06-27 17:21:24 -07:00
|
|
|
|
2016-06-18 16:49:23 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* __COMMANDLINE_H__ */
|