Commit Graph

59 Commits

Author SHA1 Message Date
John Thacker 0fc2359812 tshark: Deprecate -G with no argument
We've been planning on removing -G with no argument for
18 years (2f7fd680e2); start
warning users that it is deprecated.

Single letter options with optional arguments are tricky and
deprecated, see Guideline 12 of the POSIX Utility Syntax Guidelines.
( https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html )
We have special handling for -G as a result which forces it to the
first argument. -G with no argument can't be mixed with other options,
unlike the other reports. Removing this would allow relaxation of that
restriction.

Related to #17924
2023-12-22 10:45:52 +00:00
John Thacker 8e3de579a0 tshark doc: Mention that -G must be the first option given
Also make it a bit more apparent that the -C option to select the
configuration profile affects (some of) the reports.

[skip ci]

Part of #17924
2023-12-22 00:26:48 -05:00
Martin Mathieson 3644aa86a4 Draft: Make LTE Uu stats and graph work for NR too 2023-12-06 12:50:28 +00:00
Gerald Combs 6ce97e418b Docs: Move attributes.adoc to the doc directory 2023-11-14 06:07:53 +00:00
John Thacker 4ebb6e9893 tshark: Escape delimiter separated value in compliant ways
If the quote character appears in a field value, then escape
it by printing the character twice. When escaping whitespace
with the backslash character, also escape the backslash
character itself.

Add a ws_escape_csv function to wsutil and use it for tshark.
Adopt the existing static escape_string_len function so that
ws_escape_csv can use it while maintaining the same output
for the other ws_escape_ functions.

Fix #10284
2023-11-09 09:17:03 +00:00
Gerald Combs 4d51ce86d7 Docs: Simplify our man page markup
Single sentences and paragraphs don't need a continuation + open block.
2023-10-15 10:24:44 -07:00
John Thacker 8a422b5d02 docs: Make version option handling consistent
Document the help and version option handling, including long option
form, the same for all the command line tools, both in the their
help output and in any manpages. Add version option to randpkt.

Fix #15483
2023-10-13 11:55:48 +00:00
John Thacker 1a25bcb0c0 doc: Man page minor grammar fix
"have been calculate" -> "have been calculated"

[skip ci]
2023-10-12 12:50:00 +00:00
Martin Mathieson 6d96f6dd51 Fix some spelling errors 2023-10-03 15:43:59 +00:00
David Perry c9c641d45d tshark: support `-b printname:FILE`
Way back in e4379f0ea1 we added an option to dumpcap to output the name
of the most recently closed ringbuffer file. Expose this option to
tshark, and make tshark correctly pass it to dumpcap.
2023-09-26 19:19:54 +00:00
John Thacker 8085b6d7f1 Docs: Fix a few spelling issues
Also a misspelled work in the SSL Keylog dialog
2023-09-26 12:51:45 +00:00
John Thacker 1839374fc8 tshark: Add UTF-8 output mode to the follow tap
Add "utf-8" as an output mode to the follow tap for tshark.
This produces the same output that the Qt version does (passing
through all valid UTF-8, including control codes and internal
NULs, substituting illegal UTF-8 sequences with REPLACEMENT CHARACTER,
and not handling UTF-8 sequences split between unreassembled frames),
except for some differences which are common to how the tshark
and Wireshark Follow output differs for ASCII and EBCDIC as well:

Tshark includes additional header information and a line length
before each section of output, and leaves end-of-line terminators
untouched; Wireshark, due to the use of Qt code, automatically
translates end-of-line terminators to a LF (including from, e.g.
HTTP), except in "raw" mode. Neither tshark nor Wireshark write
in text mode, i.e. translate end of line terminators to a platform
specific CRLF on Windows.

Related to #19280
2023-09-23 11:11:49 +00:00
John Thacker 499a67b1ff stats_tree plugin: Add a TTL/Hop Limit stats tree
Add a new stats tree window under IPv4 Statistics and
IPv6 Statistics that shows TTLs grouped by source address
(and destination address grouped under TTL/Hop Limit.)

Fix #19321
2023-09-06 15:02:02 +00:00
João Valverde cf25c91532 tshark: Omit some diagnostic messages
The messages "Capture started" and the temporary capture file
are always printed by default. That seems excessive. TShark
should omit or at least be very reserved with diagnostic/status
messages unless requested.
2023-08-31 01:21:10 +01:00
João Valverde 8ac05fcdc3 Add some benchmarking timers to tshark
Add timing measurements for tshark when dissecting
and filtering a capture file.

The output is in JSON. The "elapsed" member is the total
elapsed time for all passes. After that there is
an array with an object for each pass. We only
have two passes at most currently. The single
pass dissection (the default) generates
an array with one element.

Currently there is a counter for total time
for the pass, and time elapsed in dissection,
applying the read filter and applying the
display filter. If any of these is not
active the respective entry contains zero.

All values are in milliseconds.

Add a tshark option to print the timing info.

Example:

    $ tshark -r ~/captures/http.pcapng --print-timers -2 -Y 'http && frame.len > 1' > /dev/null
    {
      "version": "v4.1.1rc0-30-gb7e187fe2993",
      "path": "/home/jpv/captures/http.pcapng",
      "filter": "http && frame.len > 1",
      "time_unit": "millisecond",
      "elapsed": 22981243,
      "dfilter_expand": 3,
      "dfilter_compile": 35,
      [
        {
          "elapsed": 11022013,
          "dissect": 10580266,
          "display_filter": 24567,
          "read_filter": 0
        },
        {
          "elapsed": 11959230,
          "dissect": 11454227,
          "display_filter": 21052,
          "read_filter": 0
        }
      ]
    }
2023-08-31 01:09:54 +01:00
Niels Widger 44e4ad3bc5 tshark: Add more fields to -G protocols and -G heuristic-decodes
This commit adds new fields to the output of both `-G protocols` and
`-G heuristic-decodes` in `tshark`.

For `-G protocols`, three new fields (4, 5 and 6) have been appened to
the existing ones:

- Field 1: protocol name
- Field 2: protocol short name
- Field 3: protocol filter name
- Field 4 (NEW): protocol enabled (e.g. "T" or "F")
- Field 5 (NEW): protocol enabled by default (e.g. "T" or "F")
- Field 6 (NEW): protocol can toggle (e.g. "T" or "F")

For `-G heuristic-decodes`, similarly three new fields (4, 5 and 6)
have been appended to the existing ones:

- Field 1: underlying dissector (e.g. "tcp")
- Field 2: name of heuristic decoder (e.g. "ucp")
- Field 3: heuristic enabled (e.g. "T" or "F")
- Field 4 (NEW): heuristic enabled by default (e.g. "T" or "F")
- Field 5 (NEW): heuristic short name (e.g. "ucp_tcp")
- Field 6 (NEW): heuristic display name (e.g. "UCP over TCP")

The new fields added to `-G heuristic-decodes` are useful as the short
name argument required for `--enable-heuristic` was not previously
shown in the `-G heuristic-decodes` output.
2023-08-19 07:38:49 +00:00
Markku Leiniö c9daa6b656 WSUG: Documentation updates
- Update the 'File Set - List Files' and import dialog images
- Add missing boldings in options in TShark man page
2023-08-05 23:56:19 +00:00
Gerald Combs 6897e5cd04 Docs: Document `tshark -G {manuf,services,enterprises}`
Add manuf, services, and enterprises to the `-G` section in the tshark
man page.
2023-07-28 17:43:16 +00:00
John Thacker 1b82eda9eb epan: Register dynamic column fields and make them filterable
Make the text of each registered column a FT_STRING field that can be
filtered, prefixed with _ws.col - these work in display filters, filters
in taps, coloring rules, Wireshark read filters, and in the -Y, -R, -e,
and -j options to tshark. Use them as the default "Apply as Filter" value
for the columns that aren't handled by anything else currently.

Because only the columns formats that actually correspond to columns
get filled in (invisible columns work), register and deregister the
fields when the columns change.

Use the lower case version of the rest of the COL_* define for each
column as the field name.

This adds a number of conditions to "when are the columns needed",
including when the main display filter or any filter on a tap is
using one of these fields.

Custom columns are currently not implemented. For custom columns, the
tree then has to be further primed with any fields used by the custom
columns as well. (Perhaps that should happen in epan_dissect_run() -
are there any cases where we construct the columns and don't want to
prime with any field that custom columns contains? Possibly in taps
that we know only use build in columns.)

Thus, for performance reasons, you're better off matching an ordinary
field if possible; it takes extra time to generate the columns and many
of them are numeric types. (Note that you can always convert a non-string
field to a string field if you want regex matching, consult the
*wireshark-filter(4)* man page.) It does save a bit on typing (especially
for a multifield custom column) and remembering the column title might
be easier in some cases.

The columns are set before the color filters, which means that you
can have a color filter that depends on a built-in column like Info or
Protocol.

Remove the special handling for the -e option to tshark. Note that
the behavior is a little different now, because fixed field names
are used instead of the titles (using the titles allowed illegal
filter names, because it wasn't going through the filter engine.)
For default names, this means that they're no longer capitalized,
so "_ws.col.info" instead of "_ws.col.Info" - hopefully a small
price in exchange for the filters working everywhere.

The output format for -T fields remains the same; all that special
handling is removed (except for remembering if someone asked for
a column field to know that columns should be constructed.)

They're also set before the postdissectors, so postdissectors can
have access.

Anything that depends on whether a packet and previous packets are
displayed (COL_DELTA_TIME_DIS or COL_CUMULATIVE_BYTES) doesn't work
the way most people expect, so don't register fields for those.
(The same is already true of color filters that use those, along with
color filters that use the color filter fields.)

Fix #16576. Fix #17971. Fix #4684. Fix #13491. Fix #13941.
2023-07-25 00:49:52 +00:00
John Thacker 456d6f49bd doc: Remove stray sentence fragment
Remove a stray (and redundant) sentence fragment from the
tshark man page, presumably left from a draft rewrite.

[skip ci]
2023-06-23 11:05:56 +00:00
Guy Harris 8d7cc70a03 Add "-G dissectors" to TShark, to dump the registered dissectors.
Fix a comment while we're at it.
2023-06-22 00:10:04 -07:00
David Perry 1bd8e05f54 tshark: show field abbrevs matching a prefix 2023-06-11 20:16:03 +00:00
John Thacker 81f20645d0 tshark: Document -T fields escaping, allow it to be turned off
Allow the escaping of whitespace characters and backspace with
the -T fields options to be disabled. There may be some use
cases (particular for redirected output instead of viewing at
a terminal) for not escaping, particularly since escaping makes
it difficult to distinguish a literal "\n" from an escaped newline.

Document this option, which also documents the escaping behavior.

Also add vertical tab to the list of escaped characters, for the
same reason as the others.

Fix #15796
2023-06-03 13:00:13 +00:00
John Thacker 5f79416a54 doc: Document the common dissection options together
Add docs/dissection-options.adoc as a snippet similar to
diagnostic-options.adoc to try to keep the man pages consistent
between dissecting programs and provide some logical separation
to avoid overwhelming a user with the huge list of options.
Use it for tshark and wireshark.

Continue to have more Decode As examples on the tshark page,
but have (in the HTML version) the cross-reference from the
wireshark page to the tshark Decode As examples link to an
anchor to the examples.

Make the name resolution option description accurate.
2023-03-26 13:44:37 +00:00
John Thacker f0712606a3 capture: Set update interval in capture opts, default to 100ms
Reduce the default update interval for dumpcap to notify its parent
of new packets (or to check if we've met file duration, etc.) from
500 ms to 100 ms, and put in the capture options.

This makes the GUI appear to update more in real time rather than
in visible batches of packets.

This also reduces the amount of ring buffer space needed in cases
where we're doing dissection, and dissection is able to keep up,
but the files can be deleted before tshark gets to them because of
the notification lag. (See #1650.)
2023-03-14 08:43:32 +00:00
John Thacker a5bdae177e docs: Update Windows temporary directory location in manpages
Update the example typical location for the temporary directory
on Windows in the manpages to something newer than where Windows NT
or Windows 98 might put it.

Fix #18463
2023-03-05 17:52:08 +00:00
Guy Harris b4ef671fba Clean up some man pages.
Consistently speak of "UNIX-compatible systems" when comparing UN*Xes
and Windows, and, the first time we mention "UNIX-compatible systems" in
a section or a list item, enumerate the not-dead-or-moribund ones.
(HP-UX is deemed moribund given that Itanium processors are no longer
being manufactured and HPE are apparently not porting HP-UX to x86-64,
choosing instead to run HP-UX Itanium applications in a compatibility
environment under Linux on x86-64.)

For the -D option, don't bother mentioning ifconfig -a or ip link show,
as there's no reason not to use -D if you want to know what you can
caputre on - for one thing, -D may list devices *other* than the network
interfaces listed by ifconfig -a or ip link show.  In addition, don't
speak of code testing whether the interface can be opened, as recent
versions of libpcap don't check that, and neither do any of the programs
in the Wireshark release.  (This was done so that, if there's an
itnerface that shows up in the enumeration but that can't be opened,
it'll be offered to the user, and they'll get a message if they try to
capture on it, indicating either that they need to somehow get the
necessary permissions or should report a bug.)

For the -i option, don't mention ifconfig -a or ip link show, as the
user should, again, use -D.

Give more detail when describing files and directories under the global
or personal preferences directory, calling out macOS specially for the
global preferences directory, as it's in the app bundle, and taking into
account that Wireshark might be installed under /usr rather than
/usr/local (for example, if it's installed from a package that's part of
a Linux distribution).

Replace the "Overrides XXX' description of some environment variables
with a more verbose description similar to what's used for other
environment variables.
2023-01-26 22:55:49 -08:00
Gerald Combs 5a9812ab61 AppRun: Set various paths
Set our ld library path and our data, extcap, and plugin directories.
Document WIRESHARK_EXTCAP_DIR and WIRESHARK_PLUGIN_DIR. Note that we
might want to set our various directories relative to the program path.
2023-01-18 20:37:08 +00:00
Gerald Combs cf4d88d320 [Automatic update for 2023-01-01]
Update manuf, services enterprise numbers, translations, and other items.
2023-01-02 12:15:00 +00:00
Martin Mathieson b2572f3a35 Fix some spelling errors 2022-12-17 11:41:29 +00:00
Dario Lombardo c2b59567d3 tshark: update man to explain why some fields are skipped in elastic-mapping. 2022-11-08 06:24:50 +00:00
John Thacker d4327d42b0 GTPv2: Add Service Response Time statistics, similar to GTPv1
Add a Service Response Time table for GTPv2, similar to that
for GTPv1. Update the tshark docs to mention it.
2022-09-27 22:06:45 +00:00
Martin Mathieson b809e73f7c Fix some spelling errors 2022-08-19 17:46:34 +01:00
Chuck Craft f82ddef8d2 tshark/docs: add -X read_format: example to view file internals 2022-06-12 16:30:35 +00:00
Chuck Craft 609c0d3881 docs: adoc migration bolding typos; Windows pipe name syntax 2022-05-12 16:43:44 +00:00
Chuck Craft 55f7b27b35 tshark.adoc: update -z conv/endpoints descriptions 2022-04-13 12:58:14 +00:00
Chuck Craft b52437ba28 WSUG/tshark: protocol summary and output with "-e" 2022-04-08 19:40:43 +00:00
David Perry fc3f061829 Differentiate `-c` from `-a packets:` 2022-02-11 01:54:53 +00:00
David Perry 1e0d117eb7 Specify directory for temporary captures 2022-02-09 14:32:28 +00:00
John Thacker fb38fe8573 doc: Document tshark -z stats
Document the currently undocumented -z statistics for tshark. Note
that all the stats added here exist in 3.6 as well. Fix #8353
(at least for now).
2022-02-06 12:48:46 +00:00
Dr. Lars Völker 8ef0114995 SOME/IP: Add stats information to tshark man file 2022-02-02 00:45:04 +00:00
John Thacker 65b44f4621 docs: tshark: read filter -> display filter
The beginning of the tshark manual talks about read filters and
using the -R option. Switch all that to display filters and -Y,
since that's the typical use now, with -R limited to two-pass
analysis.
2022-02-01 13:25:03 +00:00
Guy Harris 08dc06027f TShark, Wireshark: add some more documentation of "-i TCP@<host>:<port>".
Add a mention of the meaning of the "TCP@<host>:<port>" syntax in the
text about the -i option.
2022-01-31 21:31:48 -08:00
Martin Mathieson 559df3c620 Fix some spelling errors 2022-01-15 23:11:47 +00:00
Jim Young b5f89dbe2d tshark: Add new long option --hexdump <hexoption> 2022-01-13 01:18:38 +00:00
Gerald Combs 17e4032e81 [Automatic update for 2022-01-02]
Update manuf, services enterprise numbers, translations, and other items.
2022-01-02 16:39:07 +00:00
Gerald Combs 87eca12c38 Docs: Document our diagnostic output options.
Add docs/diagnostic-options.adoc, which is a snippet that documents our
various --log-* options. Include it in the dumpcap, rawshark, and tshark
man pages.

Make the ws_log_print_usage output more consistent.
2021-12-27 08:04:25 +00:00
Moshe Kaplan 69d54d6f8e Corrects repeated words throughout the code.
Repeated words were found with:
egrep "(\b[a-zA-Z]+) +\1\b" . -Ir
and then manually reviewed.
Non-displayed strings (e.g., in comments)
were also corrected, to ease future review.
2021-12-22 11:01:11 +00:00
John Thacker 69641adfca doc: Add lbmr_* -z stats to tshark manual
Add some more undocumented -z statistics. Ping #8353.
2021-12-12 14:21:15 +00:00
John Thacker 61b402cbe9 doc: Update tshark documents of stat options
Lost one option when updating in the previous commit, restore
2021-12-10 08:12:57 -05:00