Commit Graph

82158 Commits

Author SHA1 Message Date
Darius Davis fe9123b541 Qt: Restructure related-packet indicator drawing.
The related-packet drawing code currently intermingles the selection and the
drawing of the conversation "trace" lines and the indicators.  Separating them
out -- so we make the decisions upfront and then do the drawing -- will help
with any future work in this area.
2021-09-13 20:59:52 +10:00
James Ko 3ebc8fd8fe dumpcap:Send SP_FILE after SHB passthru in child mode
When dumpcap is running as a capture child in passthrough mode, the
SP_FILE message should not be sent until after the source SHB is passed
through to the capture file. Fixes a race condition where the capture
parent attempts to read an SHB from the capture file, following the
SP_FILE message, but the file is empty.  Closes #17013.
2021-09-13 05:09:01 +00:00
Uli Heilmeier 2d08611d54 BGP: Add RFC 9104 Extended Administrative Groups
Added support for RFC 9104 "Distribution of Traffic Engineering
Extended Administrative Groups Using the Border Gateway Protocol
- Link State (BGP-LS)"
2021-09-13 04:30:36 +00:00
John Thacker 902b614fe2 eth: Allow assuming no FCS as well as assuming FCS or using heuristic
Replace the "assume_fcs" preference with a "fcs" tri-state preference
that has three options: use the FCS preference (still the default),
assume no FCS, and assume FCS is present. Fix #10457, #11597, #15303.

Also fix previous behavior where the assume_fcs preference always
overrode wiretap even if the pseudoheader indicated that there
definitely was no FCS on the packet.
2021-09-13 04:14:54 +00:00
John Thacker 21e7bb1073 VSS Monitoring: Tighten heuristic, reduce false positives by default
Add a preference to VSS Monitoring for dissecting packets that
lack a timestamp and only have port stamping, and set it to false
by default. There's no heuristic for port stamping, so it defaults
to accepting all trailers with 1, 2, 5, or 6 bytes (1 or 2 byte
port stamp plus optional 4 bytes for Ethernet FCS.) That's too
indiscriminate, especially if there are other possible trailers
(e.g., if the PRP-1 dissector is eventually changed to a eth.trailer
dissector, see #17066 which this helps with).

Also, VSS Monitoring has never actually supported two byte port stamps,
and recent product releases have dropped port stamping in favor of
VLAN tagging for port tagging, so only support 1 byte port stamps by
default and add a preference for 2 byte port stamps.

With these changes by default the VSS Monitoring heuristic dissector
only dissects trailers that pass the timestamp heuristic, greatly
reducing the number of false positives. This does much of #8997,
though the timestamp heuristic could be tightened as well.
2021-09-13 03:58:12 +00:00
Gerald Combs 4fe297767b [Automatic update for 2021-09-12]
Update manuf, services enterprise numbers, translations, and other items.
2021-09-12 09:28:32 +00:00
Guy Harris 9fcc11cc9b blf: report a bunch of errors. 2021-09-12 01:21:31 -07:00
Guy Harris fdf2d78d9a blf: most reads in a packet are errors even if they get an EOF.
If the *first* read for a packet gets an EOF, it means that there is an
EOF right at the point where you're reading, which means "no more
packets".

If you get an EOF on any *subsequent* reads for the packet, it means the
file was cut off in the middle of the packet's record, which is an error.
2021-09-12 00:47:07 -07:00
Guy Harris b6d1806053 blf: remove the function name from ws_debug() calls.
ws_debug() inserts the file name, line number, and function name into
the ws_debug() message (assuming the function name can be obtained from
a macro), so there's no need to include it in the text of the message
(we don't do so elsewhere).
2021-09-12 00:07:55 -07:00
Guy Harris 89368f9d28 blf: do more work in blf_init_rec().
Set the block, presence flags, capture length, and length there.
2021-09-11 18:48:55 -07:00
Guy Harris 5aad28d773 blf: use common code to read the log object header. 2021-09-11 17:04:23 -07:00
John Thacker 6fe68991df wiretap: Add zstd and lz4 as WTAP compression types
This has a few effects on the behavior of wtap_get_compression_type()
and wtap_get_all_compression_type_extensions():

Make capinfos correctly report the compression type (instead of
saying gzip compressed for zstd and lz4 compressed files).

Makes files with the .zstd and .lz4 extension show up in the file
chooser when "Files of type" is set to something other than "All Files",
such as "All Capture Files" or "Wireshark/... pcapng"

Makes the UI not default to gzip compression when saving a file
compressed as zstd or lz4 (write support for zstd and lz4 doesn't
exist yet, and the GUI doesn't have hooks for it anyway, though
this can help as a prerequisite for later support for writing.)

Also replace a couple of assert() with ws_assert().

Update the PURPOSE in CMakeLists for zstd and lz4 to note that they
can be used to read compressed capture files.
2021-09-11 22:37:25 +00:00
Guy Harris 07a31d2918 cmake: fix the uninstall script.
Remove a bogus line from the beginning.
2021-09-11 15:21:19 -07:00
Guy Harris 8307d5d9be blf: fix indentation.
Fix indentation of a while() clause, so that it's indented less than the
body of the while() loop.
2021-09-11 14:27:48 -07:00
Guy Harris 8b614c6a1c blf: make blf_read_block() static.
It's not used outside blf.c.
2021-09-11 13:23:18 -07:00
Graham Bloice 58207d2f8d Windows: Update displayed OS version info
MS has changed the registry key that holds the version for display
from 20H2 onwards.
2021-09-11 14:27:21 +00:00
Stig Bjørlykke 147aadea44 Qt: Add Decode as Hex Digits in Show Packet Bytes
Non-hex character in the data are skipped, enabling the decoding
to continue converting all hex digits found.
2021-09-11 14:41:15 +02:00
Guy Harris 21339ceed0 make-pci-ids.py: make it executable.
It's a #! script, so it should be runnable from the command line without
explicitly running Python on it.
2021-09-11 10:21:05 +00:00
Guy Harris 76b08ea083 Fix spelling errors.
The Ubuntu build commented on some spelling errors in executable code
files.  Fix the errors that don't come from external files containing
the spelling errors (USB product and vendor IDs, PCI IDs, ASN.1
specifications), and fix some errors that don't show up in the
executable code files (e.g., in comments and variable names).
2021-09-11 10:01:27 +00:00
Guy Harris d4ed129727 pre-commit: skip some checks on idl2wrs.c.
Some checks intended for dissectors don't work well on dissector
*generators*, as they see stuff such as "value_string %s[]" in a format
string used to generate dissector code and get upset because the
purported value_string doesn't end with {0, NULL} (the generator *does*
put a {0, NULL} at the end, but the checker isn't clever enough to
figure that out).
2021-09-11 02:42:51 -07:00
Martin Mathieson 7f1f5b40b3 ORAN FH CUS: add section ext10 2021-09-10 23:42:05 +01:00
David Perry 389a603fdb Allow adding comments to all selected packets
Allow the user to select multiple packets, and

* add the same comment to all selected packets
* remove all comments from selected packets

A new comment is added to each packet, now that we support multiple
comments per packet.

This is one potential way to address #8713.
2021-09-10 20:47:12 +00:00
Evan Huus 059c7906c0 h225: fix tvblist used uninitialized
6caf24e966 uncovered a bug
in the h225 dissector where h245_list was used in a path that wasn't
guaranteed to be initialized. It wasn't causing fuzz errors before
because the memory was at least being zeroed, although that state was
still technically invalid.

Initialize and call the tvb_lists in dissect_h225_h225_RasMessage, which
is the other h225 entrypoint, just like dissect_h225_H323UserInformation
(the other dissector entrypoint) was already doing.
2021-09-10 15:24:48 -04:00
David Perry c634315363 [#17519] capinfos: no section headers in table output
Remove "Section N:" headers from capinfos table (`-T`) output when
outputting "additional capture file information" with `-F` and/or
comments with `-k`. These headers broke the formatting of table output.

The downside to this fix is that pcapng files with multiple SHBs and/or
comments will have extra table columns that don't line up with the
header, as in:

    ...,hardware1,os1,application1,comment1,comment1,hardware2,os2,
         application2,comment2,comment2,...

There's no real good way around this though.
2021-09-10 05:32:53 +00:00
John Thacker d87fb12bc2 SV / IEC 61850: Accommodate Ethernet trailers
IEC 61850 is directly over Ethernet, so use set_actual_length
like other such protocols so that the Ethernet dissector has a
chance to detect and dissect trailers / FCS.
2021-09-10 05:12:37 +00:00
Tomasz Moń 8a311003df USB HID: Handle different usage pages in fields
Replace custom keyboard page array handling with generic array handler.
2021-09-10 04:55:49 +00:00
Tomasz Moń 739666a7f5 USB HID: Support extended usages in descriptors
Usage, Usage Minimum and Usage Maximum can be "Extended" Usages. When
parsing report descriptor, respect page encoded in extended usage value.

Remove arbitrary usage count limit, as the usage ranges are limited to
16-bit value and thus the usages array can grow by up by 256 KiB with
single usage range.
2021-09-10 04:55:49 +00:00
Berk Akinci 9d65d3f889 DOC: Remove redundancy in build instructions.
Consolidate build instructions and troubleshooting into WSDG chapter 2.
Remove (moved) troubleshooting note that libpcap is required.

Link from WSUG build instructions to the WSDG chapters.

Reorder WSUG to have install instructions before build instructions for both
Windows and Unix.

Link from WSDG build instructions in WSDG sources chapter back to
WSDG chapter 2.

Offer options to the 'git clone' lines in obtaining sources: '--depth' and
'--shallow-since'

Add brief descriptions of new options mentioned.
2021-09-10 04:38:56 +00:00
David Perry 5076aee044 [#17517] capinfos: machine-readable filetype/encap 2021-09-10 04:25:13 +00:00
Guy Harris dee79a0c81 wtap_opttypes: move more if_filter and packet_verdict stuff together.
As we did in earlier changes.
2021-09-09 15:12:05 -07:00
David Fort d46e31a48a rdp_drdynvc: fix channel name displaying in SOFT_SYNC_REQUEST 2021-09-09 15:37:54 +00:00
David Fort 0da1babbb3 rdp: fix endianess in misc places
Some fields were interpreted with the wrong endianess.
2021-09-09 15:37:54 +00:00
David Perry 84a0141683 [#12331] Persist cmd-line prefs on reloading Lua
Save a list of all user options that were specified on the Wireshark
command line using the `-o` option. Reapply those preferences after
reloading Lua plugins. Fixes the behaviour given in #12331 wherein such
prefs were reset to the defaults, not the command-line values, when
reloading Lua plugins.

When the user changes a preference in the Wireshark UI, remove that
preference from the stored command line options, so it doesn't get reset
when Lua plugins are reloaded again.
2021-09-09 12:58:38 +00:00
Developer Alexander 02285e53b8 Qt: JSON Export - Statusbar info corrected
During a JSON Export "Writing JSON" will displayed in the statusbar.
2021-09-09 09:37:28 +00:00
Dr. Lars Völker be7b4163de BLF: Adding LIN support
This patch adds support for LIN Messages in BLF.
2021-09-09 09:19:36 +00:00
Guy Harris a4a571e680 wtap_opttypes: move the specialized options after the custom options.
Move the if_filter and packet_verdict option stuff after the custom
option stuff in various places.

Fix some comments while we're at it.
2021-09-09 01:33:47 -07:00
Guy Harris 58d053923e pcapng: clean up block length checks.
Use the same style of message for too-short block errors ("pcapng: total
block length XXX of {a,an} XXX is too small...").

Add an additional check for the "skip" Netflix cutom block, to make sure
it has enough room for the 4-byte "skipped" value.
2021-09-09 00:19:36 -07:00
Jim Borden cb88f6d4e8 BLIP: Add next gen Web-Sec-Protocol
Starting with 3.0 there is a new non backwards compatible Web-Sec-Protocol for BLIP, so the plugin should handle both (the differences are irrelevant from Wireshark's standpoint)
2021-09-09 06:38:46 +00:00
Taisuke Sasaki 42372c0dfa BGP: Add BGP-LS SR Local Block TLV (rfc9085)
- Add BGP-LS Prefix Attribute Flags TLV (rfc9085)
- Add BGP-LS Node/Link MSD (rfc8814)
- Add BGP-LS Link Local/Remote Identifiers TLV (rfc5307)
- Modified from error to warning for unsupported BGP-LS Attribute TLVs
2021-09-09 06:22:09 +00:00
John Thacker 69176a0eff IEEE 1722 / MP2T: Call MP2T subdissector from AVTP
Have the IEEE 1722 AVTP dissector call the MP2T dissector when that
is the payload type. Comment out the "if (tree)" statement since
the MP2T dissector needs to be called on the first pass regardless
to handle fragmentation.

Since there is a 4 octet source packet header timestamp before each
MPEG2-TS packet when carried on AVTP, the MP2T dissector has to be
called multiple times per frame. Since the fragmentation data is
indexed by the offset in the tvb passed to the MP2T dissector, create
a table for each MP2T layer in the packet via pinfo->curr_layer_num.
Fix #10702.
2021-09-09 06:04:42 +00:00
Evan Huus bb1286dc3c epan: more work to avoid global memory pool
A few helpers weren't in exception-throwing paths and can just free
unscoped memory. The macro in proto.c is only used in contexts with a
tree, so just use the tree's scope there.
2021-09-08 21:25:40 +00:00
Nardi Ivan 197b67cf8c Fix two memory leaks on ZSTD and LZ4 decompression 2021-09-08 21:08:41 +00:00
Mikael Kanstrup c58c106b30 dot11decrypt: Fix AAD calculation for legacy ccmp implementation
Re-implement below change but for the legacy ccmp decryption used on
3.2 release track but also on later releases when Wireshark is built
with older versions of libgcrypt:

e5e37add9a 802.11 Decrypt: Fix AAD Calculation when HT-Control present in a QoS Data Frame

Ping #17577.
2021-09-08 20:24:31 +00:00
Uli Heilmeier 4e7d10eea1 Credentials Tap: Fix wmem scope for init call
When calling credentials_init() for a tshark live capture we're in the
epan wmem scope.

Fixes: wireshark/wireshark#17576
2021-09-08 20:07:01 +00:00
Roland Knall 48cf9d5497 Qt: IOGraph - correctly add new graphs
If a graph is added it should be a single operation, not multiple setData operations
leading to a myriad of dataChanged signals to be fired, which in turn can hinder redissection.
2021-09-08 19:32:39 +00:00
Developer Alexander 03480fd6e1 epan: export epan_set_always_visible()
Exports (DLL) epan_set_always_visible() to make it accessible for plugins.

This enables post dissection taps to access all fields.
2021-09-08 14:40:24 +00:00
Evan Huus 6caf24e966 tvblist: explicitly scope memory
Allocate the root node in the same pool as the list itself, and make
that pool explicit so we can pass the pinfo scope instead of using the
global packet pool.
2021-09-08 01:37:07 +00:00
Pascal Quantin 530ee0b365 Windows: upgrade Npcap to 1.55 2021-09-07 23:18:19 +02:00
Pascal Quantin 98faf05b6b file_wrappers.c: use LZ4 if the library is 1.7.3 or later 2021-09-07 21:40:44 +02:00
Evan Huus a97e34a1c1 oids: remove global scopes from debug code
It can all just use NULL scope anyway.
2021-09-07 17:39:22 +00:00