Commit graph

2399 commits

Author SHA1 Message Date
John Thacker
7cffcbfdec doc: Keep dissection options alphabetized
Keep the list of dissection options alphabetized, which
commit af0691342b upset.
2023-08-09 05:42:38 -04:00
Juanma Sanchez
af0691342b Add --only-protocols and --disable-all-protocols to tshark and rawshark.
--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-08-08 21:54:37 +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
João Valverde
0e82c6b4b8 dfilter: Remove limitation using subtraction
Remove the requirement for a space character to precede a
minus token.

Fixes #19189.
2023-07-07 23:04:31 +01:00
Martin Mathieson
dd9dfff118 Fix some spelling errors 2023-07-05 14:46:14 +01:00
João Valverde
bd25b9f4cd dfilter: Make string slices a return an FT_STRING
Allow string slices (indexing) to work with internationalized
strings. The old behavior of indexing on byte boundaries can
be obtained using raw slices.
2023-06-26 00:46:18 +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
8e5f503267 Use register_dissector() in doc/README.dissector
Document `register_dissector()` and
`register_dissector_with_description()` as being preferable alternatives
to `create_dissector_handle()` in doc/README.dissector.

Update the examples in that file which were taken from `packet-hartip.c`
and `packet-dnp.c` to reflect changes in those files made since writing.

One small step toward addressing #5612
2023-06-14 19:47:16 +00:00
David Perry
80ae370811 Allow disabling unused dissectors from PHS dialog 2023-06-13 17:12:26 +00:00
Gerald Combs
591f89d785 Add a script to convert GLib types to their C equivalents
Convert wsutil/802_11-utils.[ch] as a test.

Update some of our documentation.

Ping #19116
2023-06-12 17:32:56 +00:00
David Perry
1bd8e05f54 tshark: show field abbrevs matching a prefix 2023-06-11 20:16:03 +00:00
John Thacker
1744ce4a0f epan: Add ENC_BOM modifier for UTF-16, UCS-2, UCS-4
Add ENC_BOM to the list of bitflag modifiers, and use it with
UTF-16, UCS-2, and UCS-4 (UTF-32). If set, this means that the
first 2 (or 4) octets, if present, are checked to see if they are
a Big-Endian BYTE ORDER MARK ("ZERO WIDTH NON-BREAKING SPACE"). If so,
those octets are skipped and the encoding is set to Little-Endian
or Big-Endian depending on endianness of the BOM.

If the BOM is absent, the passed in Endianness flag is used normally.

Related to #17991
2023-06-08 11:25:54 +00:00
John Thacker
1cdebcd80c randpkt: Support different capture formats, default to pcapng
Related to #18009 - Have randpkt default to pcapng, allow selecting
a different capture file format via the common -F option that other
command line tools use, and document it.

For the randpktdump extcap, just use pcapng.

This fixes --all-random, because --all-random requires different
encapsulation per packet. It also fixes the related -r option to
randpkt (though note that picking a file format that doesn't support
ENCAP_PER_PACKET with -r causes problems.)

Document -r in the randpkt man page.

Fix #18944
2023-06-03 13:45:20 -04: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
Guy Harris
9ef9fbeddf dumpcap(1): update some old "pcap as default format" text.
Speak of dumpcap writing a "capture file" rather than a "pcap file".

Use .pcapng rather than .pcap as the extension in sample capture file
names.

In the description of the -i option, explicitly mention the -P option as
being overridden if more than one -i option is specified.
2023-05-18 11:45:02 +00:00
John Thacker
9ea2b3db5e epan: Implement EBCDIC CP 500, for DRDA
EBCDIC Code Page 500 has exactly the same repertoire as CP 037,
covering all of ISO-8859-1, but has 7 bytes permuted. It is
the default code page for DRDA; use it there.
2023-04-26 12:30:46 +00:00
Jaap Keuter
872285a643 Doc: complete list of field types 2023-04-25 18:36:53 +00:00
Martin Mathieson
a14f437aed README.dissector - some trivial edits 2023-04-12 09:47:09 +00:00
Gerald Combs
1ffff913de wsutil: Switch away from G_MODULE_SUFFIX and g_module_build_path
GLib 2.76 deprecated G_MODULE_SUFFIX, so just use ".dll" on Windows and
".so" elsewhere. It also deprecated g_module_build_path, so just use
g_strconcat.

ws_module_open was only used to open wpcap.dll, so rename it to
load_wpcap_module.
2023-04-11 22:54:27 +00:00
Martin Mathieson
50d9fe7c6e Some updates to README.developer 2023-04-08 16:59:09 +00:00
John Thacker
79812ca110 MaxMindDB: Move pref to Name Resolution prefs
Move MaxMind lookups to a global Name Resolution preference.
That's a bit of a misnomer (it's not name resolution, but it
is using external sources of data to update information about
a network object), but the MaxMind DB path location is already there.

This means that MaxMind lookups can be disabled with the '-n'
option, and enabled with a 'g' for the '-N' option. This is
significant for tshark, because MaxMind lookups are now synchronous.

Disabling the new global preference also keeps the Endpoints window
from doing MaxMind lookups; currently, even if the IPv4 and IPv6 GeoIP
prefs are disabled the data is still looked up and inserted in the
Endpoints window.

Fix #14692
2023-04-07 00:31:37 +00:00
John Thacker
86a84b15ad rawshark: Use the common dissection options
Use the common dissection options processing for rawshark.
This means that the error message for resolving options includes
all the possible resolving options (e.g. instead of omitting VLAN).

This add support for the other options, which generally make sense,
like enabling and disabling protocols and heuristics.

The only option that isn't supported is the Decode As option, only
because '-d' is used by rawshark for its payload link layer type /
dissector selection.
2023-04-01 11:51:04 +00:00
Preben Guldberg
0b538b3205 Allow specifying subsecond granularity with tshark -t
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.
2023-03-31 08:15:28 +02: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
1c0a094e93 docs: Remove references to printing preferences
The printing preferences were removed in 586ad18159.
Remove references to them from the man page.
2023-03-24 17:19:11 -04:00
John Thacker
5426af1492 doc: Don't refer to tvb_get_faked_unicode
tvb_get_faked_unicode hasn't existed for nine years. Recommend
tvb_get_string_enc() instead.
2023-03-19 21:14:12 +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
15ed53005b minor README.dissector updates/fixes 2023-03-14 08:42:13 +00:00
Jaap Keuter
9641a960c1 Manpage: dumpcap does not handle predef for capture filters.
Closes #18808
2023-03-12 15:53:21 +00:00
John Thacker
33ed5200a2 docs: Grammar
Fix a couple cases of using "it's" instead of "its" for the possessive
2023-03-06 08:47:09 -05: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
John Thacker
736ed83000 docs: Document wmem in Developer's Guide
Add information from the Wiki Development/Tips page and from
README.wmem to the Developer's Guide.

Also fix a small typo in README.wmem

Fix #17126
2023-03-05 02:23:32 +00:00
João Valverde
a2bc5bd012 doc: Update header preamble for dissector skeleton 2023-02-22 07:09:36 +00:00
Jaap Keuter
455b9a470f sshdump: add capability to use doas on remote host 2023-02-19 13:41:24 +00:00
Jaap Keuter
864e8f1f5f Man: Update extcap argument type documentation 2023-02-08 20:12:27 +00:00
João Valverde
02238edf92 Do not require using wsgcrypt.h
The reason to use wsgcrypt.h was to wrap it around DIAG_OFF()
macros and that should no longer be necessary.
2023-02-06 15:52:10 +00:00
David Perry
9b797e97a2 generate-dissector.py: allow creating plugin
Tweak the script used for creating a new skeleton dissector, to allow it
to create the dissector in `plugins/epan/PROTOSHORTNAME` instead of in
`epan/dissectors`. Handles modifying the appropriate CMake file in the
appropriate way, and generates the plugin's `CMakeLists.txt` if needed.
2023-02-06 14:32:55 +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
João Valverde
c66fc43e5b GUI: Ship authors as a Qt resource file 2023-01-20 13:35:03 +00:00
João Valverde
74909f1499 Install PDML files to DOCDIR
Add README because this stuff is somewhat obscure and move XSLT
file to DOCDIR because it is not used by wireshark directly.
2023-01-19 17:08:36 +00:00
João Valverde
06519be205 Install documentation (HTML manuals) to DOCDIR
Install documentation to DOCDIR instead of DATADIR.
The code must be fixed to open the Help URLs from
this new path.

This only affects Unix-like FHS platforms. Windows
installation does its own thing.

Needs testing with macOS packaging.
2023-01-19 01:40:59 +00:00
João Valverde
9e6faf4169 Remove dftest man page
DFTest is a private test utility and isn't installed anywhere.

I don't think it makes sense to maintain a man page. Certainly
doesn't make sense to ship it.

The doc file is understandably minimal so just nuke it.
2023-01-19 00:17:56 +00: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
John Thacker
ffdf332f24 docs: Explain the FT_FRAMENUM use of the strings field
Add a section about FRAMENUM_TYPE to the 'strings' field
section of README.dissector
2023-01-17 09:27:29 +00:00
Michal Ruprich
2a285b75a1 capinfos: Removing RIPEMD160 hashes
When reading a packet capture with capinfos on a system with
FIPS 140-2 enabled, libgcrypt will abort for any non approved
algorithm. In this case the RIPEMD 160.
2023-01-12 18:07:41 +00:00
João Valverde
25d4a099f7 Remove WS_DISABLE_ASSERT
Assertions can be enabled/disabled using WS_DISABLE_DEBUG. The extra
granularity afforded by WS_DISABLE_ASSERT seems unnecessary.
2023-01-12 00:59:15 +00:00
Jonas Falkevik
3e2c04fe78 editcap: flag to set unused bytes in SLL headers
Unused bytes in SLL Link Layer address can be random bytes.
Which makes the duplicate check think the packets are different.
Even if the unused bytes was the only difference.

This flag enables editcap to set the unused bytes to zeros to enable
the duplicate check to detect duplicates.
2023-01-04 09:40:03 +00:00