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*/
13 * Dissection options (parameters that affect dissection)
17 #ifndef __DISSECT_OPTS_H__
18 #define __DISSECT_OPTS_H__
22 #endif /* __cplusplus */
26 * We do not currently have long options corresponding to all short
27 * options; we should probably pick appropriate option names for them.
29 * For long options with no corresponding short options, we define values
30 * outside the range of ASCII graphic characters, make that the last
31 * component of the entry for the long option, and have a case for that
32 * option in the switch statement.
34 * We also pick values >= 4096, so as not to collide with capture options,
35 * and <= 65535, so as to leave values > 65535 for options specific to a
40 * Non-capture long-only options should start here, to avoid collision
41 * with capture options.
43 #define LONGOPT_DISABLE_PROTOCOL 4096
44 #define LONGOPT_ENABLE_HEURISTIC 4097
45 #define LONGOPT_DISABLE_HEURISTIC 4098
46 #define LONGOPT_ENABLE_PROTOCOL 4099
49 * Options for dissecting common to all dissecting programs.
51 #define LONGOPT_DISSECT_COMMON \
52 {"disable-protocol", required_argument, NULL, LONGOPT_DISABLE_PROTOCOL }, \
53 {"enable-heuristic", required_argument, NULL, LONGOPT_ENABLE_HEURISTIC }, \
54 {"disable-heuristic", required_argument, NULL, LONGOPT_DISABLE_HEURISTIC }, \
55 {"enable-protocol", required_argument, NULL, LONGOPT_ENABLE_PROTOCOL }, \
57 #define OPTSTRING_DISSECT_COMMON \
60 /** Capture options coming from user interface */
61 typedef struct dissect_options_tag {
63 GSList *enable_protocol_slist; //enable protocols that are disabled by default
64 GSList *disable_protocol_slist;
65 GSList *enable_heur_slist;
66 GSList *disable_heur_slist;
69 extern dissect_options global_dissect_options;
71 /* initialize the dissect_options with some reasonable values */
73 dissect_opts_init(void);
76 * Handle a command line option.
77 * Returns TRUE if the option is valid, FALSE if not; an error message
78 * is reported with cmdarg_err() if it's not valid.
81 dissect_opts_handle_opt(int opt, char *optarg_str_p);
84 * Set up disabled protocols and enabled/disabled heuristic protocols
85 * as per specified command-line options.
87 * Returns TRUE if all specified heuristic protocols exist, FALSE
91 setup_enabled_and_disabled_protocols(void);
95 #endif /* __cplusplus */
97 #endif /* dissect_opts.h */
100 * Editor modelines - http://www.wireshark.org/tools/modelines.html
105 * indent-tabs-mode: nil
108 * vi: set shiftwidth=4 tabstop=8 expandtab:
109 * :indentSize=4:tabSize=8:noTabs=true: