aboutsummaryrefslogtreecommitdiffstats
path: root/ui/dissect_opts.h
AgeCommit message (Collapse)AuthorFilesLines
2023-10-14tshark: Support --read-file and filter long optsJohn Thacker1-1/+3
The tshark man page and help claims to support the --read-file, --read-filter, and --display-filter long options. Make it so. Programs have to dissect in order to run filters, so add the filtering options to dissect_opts.h, which Wireshark, tshark, and rawshark already include, so that they stay consistent between applications. Reading a file is a common activity that we might want to have more (all?) command line tools support with the same syntax eventually, so add that to clopts_common.h rawshark doesn't distinguish between read filters and display filters; to make things easy and consistent, make them synonymous for rawshark. Fix #19365
2023-08-16Initialize global_dissect_options at compile time.Guy Harris1-4/+0
We require a C11 compiler, and designated initializers have been in C since C99. Use them to initialize the time format and precision values at compile time, rather than requiring that dissect_opts_init() be called before the command-line arguments are parsed. This is good because TShark and rawshark were *not* calling dissect_opts_init(); that doesn't appear to have caused problems with existing versions, but it might be causing problems with another pending change that's failing to pass the test suite.
2023-08-08Add --only-protocols and --disable-all-protocols to tshark and rawshark.Juanma Sanchez1-4/+8
--disable-all-protocols will mark all protocols as disabled by default, and then disable them. Certain protocols can then be enabled one by one by using --enable-protocol. --only-protocols is a helper option to make it easier to enable only certain protocols It's equivalent to passing --disable-all-protocols and then several --enable-protocol options. It accepts a comma separated list of protocols. First all protocols will be disabled, and then all protocols included in the list will be enabled one by one. Side-note, it wouldn't make much sense to enable only "tcp" for example without enabling the protocols in the lower layers (e.g: eth, sll, ip, ipv6). In this case, something like --only-protocols eth,sll,ip,ipv6,tcp will generally be needed in order to make sure that TCP is decoded. Signed-off-by: Juanma Sanchez <juasanch@redhat.com>
2023-03-31Allow specifying subsecond granularity with tshark -tPreben Guldberg1-0/+1
Implements suggestion in issue #18714. Proposed syntax for setting subsecond precision is "tshark -t adoy.3" for millisecond accuracy in output. Using a dot separator indicates the precision of what follows the dot in the output. The following tshark -t combinations are supported: 1. Specifying just the format with e.g. "-t a" and defaulting the precision. 2. Specifying both format and precision, with "-t ad.2" or "-t ad -t .2". 3. Specifying only the precision with "-t .6" and defaulting format. 4. Use "-t a." or even "-t ." to specify auto precision from trace. The latter use case is particularly useful with wireshark/logray. Using a dot like this avoids introducing a new command line option.
2021-11-30Add UI header files to DoxygenMoshe Kaplan1-1/+2
Add @file markers for UI header files so that Doxygen will generate documentation for them.
2021-09-30ws_getopt: Rename struct and macrosJoão Valverde1-4/+4
This is part of the API and should also be renamed to avoid conflicts.
2021-04-20Remove unneeded modelines in ui.Gerald Combs1-13/+0
Remove the editor modeline blocks from the source files in ui that use 4 space indentation by running perl -i -p0e 's{ \n+ /[ *\n]+ editor \s+ modelines .* shiftwidth= .* \*/ \s+ } {\n}gsix' $( ag -l shiftwidth=4 $( ag -g '\.(c|cpp|h|m|mm)') ) This gives us one source of indentation truth for these files, and it *shouldn't* affect anyone since - These files match the default in our top-level .editorconfig. - The one notable editor that's likely to be used on these files and *doesn't* support EditorConfig (Qt Creator) defaults to 4 space indentation.
2019-12-15Reorganize long option valuesJaap Keuter1-17/+4
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>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-01Fix comment end after SPDX identifierStig Bjørlykke1-1/+2
Move */ to a separate line below the SPDX identifier. Change-Id: Id1032215449cfccae0933147b45e04b65e0b727f Reviewed-on: https://code.wireshark.org/review/27211 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-02ui: use SPDX identifiers.Dario Lombardo1-14/+1
Change-Id: I6b05399395bcc35e59b73b4030ba4a05711a7b1a Reviewed-on: https://code.wireshark.org/review/25565 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-08Clean up handling of enabled/disabled protocols/heuristic dissectors.Guy Harris1-0/+10
Add a "report a warning message" routine to the "report_err" code in libwsutil, and rename files and routines appropriately, as they don't only handle errors any more. Have a routine read_enabled_and_disabled_protos() that reads all the files that enable or disable protocols or heuristic dissectors, enables and disables them based on the contents of those files, and reports errors itself (as warnings) using the new "report a warning message" routine. Fix that error reporting to report separately on the disabled protocols, enabled protocols, and heuristic dissectors files. Have a routine to set up the enabled and disabled protocols and heuristic dissectors from the command-line arguments, so it's done the same way in all programs. If we try to enable or disable an unknown heuristic dissector via a command-line argument, report an error. Update a bunch of comments. Update the name of disabled_protos_cleanup(), as it cleans up information for disabled *and* enabled protocols and for heuristic dissectors. Support the command-line flags to enable and disable protocols and heuristic dissectors in tfshark. Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df Reviewed-on: https://code.wireshark.org/review/20966 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-24Add enabled protocol list for dissectors who are disabled by defaultMichael Mann1-0/+3
We save a list of dissectors that are disabled through the Enabled Protocols dialog. This is because we assume dissectors are enabled by default. For dissectors that are disabled by default, we have no way to keep them enabled through the Enabled Protocols dialog. A dissector that defaults to being disabled has to be reset to enabled each time Wireshark is launched. Add a list similar to the disabled list for enabling dissectors that are disabled by default. This mostly applies to post-dissectors. Change-Id: I31a8d97a9fdbc472fe2a8666384e0f8786bb8e9f Reviewed-on: https://code.wireshark.org/review/19405 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-31Handle -K, -n, -N, and -u in the common dissection option code.Guy Harris1-1/+1
Also update tfshark to use that code. Change-Id: Ic03fb8ff48c8bfc460298d180b436e53f0076cbe Reviewed-on: https://code.wireshark.org/review/18588 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-31Have the routine that handles dissection options not exit.Guy Harris1-3/+7
Have it return TRUE if the option is OK and FALSE if it isn't, and let its caller exit as appropriate. Also, rename it - it's not adding something to a collection, it's just handling the option. Change-Id: I41863cbb67b7c257d900d3011609891b9b4a7467 Reviewed-on: https://code.wireshark.org/review/18587 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-30Have routines for parsing options that affect dissection.Guy Harris1-0/+106
Have them handle -d, -t, --disable-protocol, --disable-heuristic, and --enable-heuristic for TShark and both flavors of Wireshark. Change-Id: I612c276b1f9df8a2092202d23ab3d48be7857e85 Reviewed-on: https://code.wireshark.org/review/18583 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>