aboutsummaryrefslogtreecommitdiffstats
path: root/ui/dissect_opts.h
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2019-12-15 14:15:34 +0100
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2019-12-15 20:02:09 +0000
commitd90a22c1cc3a6eaf739e9f4b40ea276dbc916d62 (patch)
treed973eed229ea71f354669d448f20dc5158ba2c12 /ui/dissect_opts.h
parent1cd1e36a05bd0f14b38ce3978e3313d57b3b25d4 (diff)
Reorganize long option values
For long options, without corresponding short options, to be processed they need to be assigned a value, preferably outside of the range of all possible short options. The code in various places tries to stay clear of these low values, but further coordination is missing, easily leading to issues when option processing code gets extended and/or reorganized. This change introduces a single location from where each catagory of command line long option can derive a base value, which should minimize potential option value collisions. Change-Id: Ic8861a347d0050f74002de3aa1fcfb01202866e5 Reviewed-on: https://code.wireshark.org/review/35459 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui/dissect_opts.h')
-rw-r--r--ui/dissect_opts.h21
1 files changed, 4 insertions, 17 deletions
diff --git a/ui/dissect_opts.h b/ui/dissect_opts.h
index 0ad341beaf..4133799b61 100644
--- a/ui/dissect_opts.h
+++ b/ui/dissect_opts.h
@@ -26,25 +26,12 @@ extern "C" {
* Long options.
* We do not currently have long options corresponding to all short
* options; we should probably pick appropriate option names for them.
- *
- * For long options with no corresponding short options, we define values
- * outside the range of ASCII graphic characters, make that the last
- * component of the entry for the long option, and have a case for that
- * option in the switch statement.
- *
- * We also pick values >= 4096, so as not to collide with capture options,
- * and <= 65535, so as to leave values > 65535 for options specific to a
- * program.
*/
-/*
- * Non-capture long-only options should start here, to avoid collision
- * with capture options.
- */
-#define LONGOPT_DISABLE_PROTOCOL 4096
-#define LONGOPT_ENABLE_HEURISTIC 4097
-#define LONGOPT_DISABLE_HEURISTIC 4098
-#define LONGOPT_ENABLE_PROTOCOL 4099
+#define LONGOPT_DISABLE_PROTOCOL LONGOPT_BASE_DISSECTOR+1
+#define LONGOPT_ENABLE_HEURISTIC LONGOPT_BASE_DISSECTOR+2
+#define LONGOPT_DISABLE_HEURISTIC LONGOPT_BASE_DISSECTOR+3
+#define LONGOPT_ENABLE_PROTOCOL LONGOPT_BASE_DISSECTOR+4
/*
* Options for dissecting common to all dissecting programs.