2 * Dissection options (parameters that affect dissection)
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
14 * Dissection options (parameters that affect dissection)
18 #ifndef __DISSECT_OPTS_H__
19 #define __DISSECT_OPTS_H__
23 #endif /* __cplusplus */
27 * We do not currently have long options corresponding to all short
28 * options; we should probably pick appropriate option names for them.
30 * For long options with no corresponding short options, we define values
31 * outside the range of ASCII graphic characters, make that the last
32 * component of the entry for the long option, and have a case for that
33 * option in the switch statement.
35 * We also pick values >= 4096, so as not to collide with capture options,
36 * and <= 65535, so as to leave values > 65535 for options specific to a
41 * Non-capture long-only options should start here, to avoid collision
42 * with capture options.
44 #define LONGOPT_DISABLE_PROTOCOL 4096
45 #define LONGOPT_ENABLE_HEURISTIC 4097
46 #define LONGOPT_DISABLE_HEURISTIC 4098
47 #define LONGOPT_ENABLE_PROTOCOL 4099
50 * Options for dissecting common to all dissecting programs.
52 #define LONGOPT_DISSECT_COMMON \
53 {"disable-protocol", required_argument, NULL, LONGOPT_DISABLE_PROTOCOL }, \
54 {"enable-heuristic", required_argument, NULL, LONGOPT_ENABLE_HEURISTIC }, \
55 {"disable-heuristic", required_argument, NULL, LONGOPT_DISABLE_HEURISTIC }, \
56 {"enable-protocol", required_argument, NULL, LONGOPT_ENABLE_PROTOCOL }, \
58 #define OPTSTRING_DISSECT_COMMON \
61 /** Capture options coming from user interface */
62 typedef struct dissect_options_tag {
64 GSList *enable_protocol_slist; //enable protocols that are disabled by default
65 GSList *disable_protocol_slist;
66 GSList *enable_heur_slist;
67 GSList *disable_heur_slist;
70 extern dissect_options global_dissect_options;
72 /* initialize the dissect_options with some reasonable values */
74 dissect_opts_init(void);
77 * Handle a command line option.
78 * Returns TRUE if the option is valid, FALSE if not; an error message
79 * is reported with cmdarg_err() if it's not valid.
82 dissect_opts_handle_opt(int opt, char *optarg_str_p);
85 * Set up disabled protocols and enabled/disabled heuristic protocols
86 * as per specified command-line options.
88 * Returns TRUE if all specified heuristic protocols exist, FALSE
92 setup_enabled_and_disabled_protocols(void);
96 #endif /* __cplusplus */
98 #endif /* dissect_opts.h */
101 * Editor modelines - http://www.wireshark.org/tools/modelines.html
106 * indent-tabs-mode: nil
109 * vi: set shiftwidth=4 tabstop=8 expandtab:
110 * :indentSize=4:tabSize=8:noTabs=true: