Commit Graph

82340 Commits

Author SHA1 Message Date
Gerald Combs 0e667117b4 [Automatic update for 2021-10-17]
Update manuf, services enterprise numbers, translations, and other items.
2021-10-17 09:30:23 +00:00
John Thacker 71ccbe9f37 bencode: remove pointless recursion
This statement is at the top of the function, calls itself recursively
without changing any state, reaches the max recursion level, and then
travels back up the stack adding expert infos and returning -1, and
then at the end always causes a variable to be set to a known value.

Remove all that, and just set the variable to the value it's going to
have anyway. This speeds things up a lot and prevents adding dozens
of expert infos to dictionaries without otherwise changing the
behavior, which does seem to work.
2021-10-16 07:23:03 +00:00
John Thacker 9f890e1dea dfilter: Update semcheck comment to reflect latest commits
The handling of unparsed values was rationalized by commits
c484ad0e5c and
144dc1e2ee. Update this comment
to reflect the new behavior.
2021-10-16 02:26:27 +00:00
João Valverde 06890ea379 dfilter: Forbid protocol filter names beginning with '-'
Reducing the namespace for protocol names makes the display filter grammar
simpler and less ambiguous and error prone. We can't easily impose
stricter restrictions without breaking backward compatibility but names
starting with '-' are a pathological case because of negative numbers
and byte slices and in the unlikely event that any such names exist
they should be fixed.
2021-10-15 17:29:34 +01:00
João Valverde 6d4a463620 proto: use hash table to lookup reserved filter names
Should be faster.
2021-10-15 17:04:32 +01:00
João Valverde 07023a7774 tests: Accept a partial string in checkDFilterFail() 2021-10-15 15:10:57 +01:00
João Valverde 00673e22ef tests: Fixup test names 2021-10-15 15:10:54 +01:00
Mikael Kanstrup fbeb33ee99 Websocket frame reassembly support
Add support for websocket fragmented payload reassembly.
2021-10-15 13:23:50 +00:00
João Valverde c484ad0e5c dfilter: Don't try to parse byte arrays as strings
It won't work with embedded null bytes so don't try. This is
not an additional restriction, it just removes a hidden failure
mode. To support matching embedded NUL bytes we would have
to use an internal string representation other than
null-terminated C strings (which doesn't seem very onerous with
GString).

Before:
  Filter: http.user_agent == 41:42:00:43

  Constants:
  00000 PUT_FVALUE	"AB" <FT_STRING> -> reg#1

  Instructions:
  00000 READ_TREE		http.user_agent -> reg#0
  00001 IF-FALSE-GOTO	3
  00002 ANY_EQ		reg#0 == reg#1
  00003 RETURN

After:
  Filter: http.user_agent == 41:42:00:43

  Constants:
  00000 PUT_FVALUE	"41:42:00:43" <FT_STRING> -> reg#1

  Instructions:
  00000 READ_TREE		http.user_agent -> reg#0
  00001 IF-FALSE-GOTO	3
  00002 ANY_EQ		reg#0 == reg#1
  00003 RETURN
2021-10-15 13:06:51 +01:00
João Valverde 144dc1e2ee dfilter: Use the same semantic rules for protocols and bytes
FT_PROTOCOL and FT_BYTES are the same semantic type, but one is
backed by a GByteArray and the other by a TVBuff. Use the same
semantic rules to parse both. In particular unparsed strings
are not converted to literal strings for protocols.

Before:
  Filter: frame contains 0x0000

  Constants:
  00000 PUT_FVALUE	30:78:30:30:30:30 <FT_PROTOCOL> -> reg#1

  Instructions:
  00000 READ_TREE		frame -> reg#0
  00001 IF-FALSE-GOTO	3
  00002 ANY_CONTAINS	reg#0 contains reg#1
  00003 RETURN

  Filter: frame[5:] contains 0x0000
  dftest: "0x0000" is not a valid byte string.

After:
  Filter: frame contains 0x0000
  dftest: "0x0000" is not a valid byte string.

  Filter: frame[5:] contains 0x0000
  dftest: "0x0000" is not a valid byte string.

Related to #17634.
2021-10-15 13:06:51 +01:00
João Valverde e46deda5cf Fix build with WS_DISABLE_DEBUG 2021-10-15 12:23:43 +01:00
Роман Донченко e116110f0c jpeg: add support for dissecting inline IFD values
In many cases, the "value offset" is actually the value itself.
Handle those cases correctly.
2021-10-15 04:53:03 +00:00
John Thacker cc91fd51ff cli: stats_tree: Make syntax consistent with other -z options
The statistics that use the stats_tree API parse the -z option
without expecting a comma separator between the statistics name
and the filter. This is contrary to both the man pages and how
all the other options work. Fix that so it's consistent.
Fix #17656
2021-10-15 04:22:23 +00:00
Guy Harris 3960474089 socketcan: support the CANFD_FDF flag for identifying CAN FD frames.
The Linux SocketCAN header now uses the formerly-reserved byte in the
SocketCAN header after the "payload length" field as an "FD flags"
field, with a flag bit reserved to indicate whether the frame is a
classic CAN frame or a CAN FD frame, with two other bits giving frame
information for FD frames.

For LINKTYPE_CAN_SOCKETCAN, use that flag bit to determine whether the
frame is classic CAN or CAN FD.  As some older LINKTYPE_CAN_SOCKETCAN
captures have SocketCAN headers in which the fields after the "payload
length" field were uninitialized, so trust that thge "FD flags" was
filled in, rather than possibly randomly uninitialized, only if the only
bits set in that field are the bits defined to be in that field and the
two reserved bytes after it are zero.

This will be needed when the current main-branch libpcap is released, as
it uses LINKTYPE_CAN_SOCKETCAN rather than LINKTYPE_LINUX_SLL for
ARPHRD_CAN devices; we add it now to future-proof the Wireshark releases
to which this is being committed.  It also handles what existing CAN FD
captures using LINKTYPE_CAN_SOCKETCAN exist.

For LINKTYPE_LINUX_SLL frames, we have the protocol field to distinguish
between classic CAN and CAN FD, so we use that to determine the frame
type, rather than looking at the CANFD_FDF flag.

dissect_socketcan_common() now handles both classic CAN and CAN FD
frames.
2021-10-14 19:15:07 -07:00
João Valverde 2d569e116e dfilter: Fix crash with duplicated syntax node
The uninitialized memory causes access violations printing
duplicated nodes.

Fixes 5dd90e3b30.
2021-10-14 23:49:39 +01:00
João Valverde 1ace61074e dfilter: Display token value for debugging 2021-10-14 23:24:57 +01:00
Gerald Combs 46f27973ca CMake: Partially revert recent docs changes.
Revert recent "docs" target changes. It made that target build faster,
but broke other dependencies. Keep the AsciidoctorJ changes.

Revert "doc: fix the macOS build."

This reverts commit 119667d886.

Revert "CMake: Try to make our man page builds faster."

This reverts commit 74747c4d2f.
2021-10-14 19:34:18 +00:00
João Valverde 0d3bfedfb0 dfilter: Fixup deprecated tokens initialization
Always use the internal API to access "deprecated" and initialize
the data structure on demand. This fixes a null pointer dereference
introduced previously.

Use reference counting to share the array cleanly and avoid memory
leaks.

Keep the pointer in dfwork_t.
2021-10-14 16:49:23 +01:00
João Valverde e91b5beafd dfilter: Resolve field names in the parser
The lexical rules for fields and unparsed strings are ambiguous,
e.g. "fc" can be the protocol fibre channel or the byte 0xfc.
In general a name is determined to be a protocol field or not by
checking the registry.

Resolving the name in the parser gives more flexibility, for example
to use different semantic rules according to the relation between
LHS and RHS, and allows function names and protocol names to co-exist
without ambiguity.

Before:
  Filter: tcp == 1

  Constants:
  00000 PUT_FVALUE	01 <FT_PROTOCOL> -> reg#1

  Instructions:
  00000 READ_TREE		tcp -> reg#0
  00001 IF-FALSE-GOTO	3
  00002 ANY_EQ		reg#0 == reg#1
  00003 RETURN

  Filter: tcp() == 1
  dftest: Syntax error near "(".

After:
  Filter: tcp == 1

  Constants:
  00000 PUT_FVALUE	01 <FT_PROTOCOL> -> reg#1

  Instructions:
  (same)

  Filter: tcp() == 1
  dftest: Function 'tcp' does not exist

It's also a goal to make it easier to modify the lexer rules.

Ping #12810.
2021-10-14 16:45:19 +01:00
João Valverde 3e6cc8ce4a dfilter: Remove unused function definition 2021-10-14 16:21:33 +01:00
João Valverde 309388a683 dfilter: Replace node in convert_to_bytes() 2021-10-14 11:15:03 +01:00
Guy Harris 119667d886 doc: fix the macOS build.
BUNDLE_RESOURCE_SHARE_MAN[14]_FILES shouold *not* have the generate_
prefixes; names with those prefixes are fake targets, not names of files
that we generate, so attempting to copy files with those names fails.

It should, however, have "doc/" before the names of the man pages, as
they're generated into the doc directory of the top-level build
directory.
2021-10-14 00:30:08 -07:00
Guy Harris 79920cbc5f dumpcap: do all packet counting in capture_loop_wrote_one_packet().
We need to update global_ld.inpkts_to_sync_pipe as soon as we've written
a packet to the current capture file.  If we're writing to multiple
files, then, if we delay counting until after we switch to another file,
the packet-count message we send to the parent before switching won't
include the packet, and the first packet-count message we send to the
parent *after* switching *will* include the packet, which could mean the
parent will try to read more packets than there are in the new file, in
which case it'll get an EOF and, at least in the case of TShark, treat
that as an error and stop capturing.

This should fix issue #17654.

While we're at it, don't send a "we have no packets" packet-count
message even for the packet-count message we send just before switching
files.
2021-10-13 17:18:50 -07:00
Gerald Combs 74747c4d2f CMake: Try to make our man page builds faster.
Depend on our generator targets instead of the generated files, which
allows parallel builds outside of Ninja. Don't reserve JRE memory when
building HTML and man page targets. This reduces the "docs" target build
time on my Windows VM here from over two minutes to under one.
2021-10-13 23:10:35 +00:00
Chuck Craft 1e18f79373 captype: add options to Usage: and man page 2021-10-13 22:54:20 +00:00
Vadim Yanitskiy 30863e5298 GSM A-bis/RSL: dissect some more Osmocom specific IEs 2021-10-13 18:10:49 +00:00
Vadim Yanitskiy 278dcc83ea GSM A-bis/RSL: add a checkbox for Osmocom specific definitions 2021-10-13 18:10:49 +00:00
Vadim Yanitskiy 91f050cd82 GSM A-bis/RSL: fix wrong tree/length in dissect_rsl_ie_message_id() 2021-10-13 18:10:49 +00:00
Gerald Combs 2236009e21 Packaging: Add captype to the Windows installers.
Add captype and its documentation to the NSIS and WiX packages.
2021-10-13 17:54:02 +00:00
Gerald Combs acaaad150b BT HCI_ISO: Don't overrun our reassembly buffer.
Fixes #17649.
2021-10-13 17:36:13 +00:00
Ben Huddleston 79ed34e1c6 couchbase: Add Subdoc replace body with xattr opcode
Change-Id: Icce8f7a30caf0d52c01b20b8535a1f157a1e4f56
2021-10-13 15:55:13 +00:00
Ben Huddleston 7fa7aa8191 couchbase: Add ReviveDocument subdoc flag
Change-Id: I914f4aae11b4c459a6db0d7b18ab81b73747fd58
2021-10-13 15:55:13 +00:00
Ben Huddleston 0e019290ef couchbase: Add new subdoc error codes
Change-Id: I7d5350d1a590e8c5a2b87f4cc0d815d5da63a2f1
2021-10-13 15:55:13 +00:00
Stig Bjørlykke bb0b4ad4b3 eNode-B: Fix check for eri_enb_log_magic
Files not having the eri_enb_log_magic should not be opened as a
eNode-B raw log file format.
2021-10-13 12:06:44 +02:00
Joakim Karlsson 9cc514957f gprscdr: Update to 3GPP TS 32.298 V17.0.0 2021-10-13 08:29:20 +00:00
Anders Broman db80da2adc SIP: 200 ok put resp to method in info col 2021-10-13 09:25:41 +02:00
Joakim Karlsson 4887894a15 pfcp: Update to 3GPP TS 29.244 V17.2.0 2021-10-13 06:02:34 +00:00
Chuck Craft a3625ec9f6 extcap: reword error message referencing captype
There exists a program called "captype" but it's not used here.
2021-10-13 05:03:31 +00:00
John Thacker c6e44fb00c BT-uTP: Track conversations
Add endpoint type for uTP connection IDs.
Manage uTP conversations, creating generated stream ID to filter
on both sides of a conversation.
Display more information in INFO column, similar to TCP.
This is some progress towards #8792.
2021-10-13 04:37:21 +00:00
Martin Mathieson abcadce44f BPV7: Address check_static.py issues
epan/dissectors/packet-bpv7.c (00000000000010d0 T bp_block_canonical_free) is not referred to so could be static?
epan/dissectors/packet-bpv7.c (0000000000000e50 T bp_creation_ts_new) is not referred to so could be static?

One function was not called at all - the other only in this dissector so could be static.
2021-10-13 04:21:31 +00:00
Brian Sipos 01e858e0a3 BP: Fix crashes on invalid fuzzed inputs 2021-10-12 23:15:50 +00:00
Chuck Craft ade523d7ba docs: -z stats - bootp now dhcp; not all in man page 2021-10-12 21:17:25 +00:00
Chuck Craft 07143b1c47 docs: -z stats - bootp now dhcp; not all in man page 2021-10-12 21:17:25 +00:00
Chuck Craft 1998e7f34b capinfos: man page typos; add longopts to Usage:
The verbiage for first/last packets and start/end times seem
to not be consistent. Changing will also require a change to
Capture File Statistics in the Wireshark Gui. Future MR.
2021-10-12 20:35:15 +00:00
David Perry fd076e6ca8 Proposed rewording of filter tooltips
For #16186. Proposed changes to the tooltips which appear when a filter
expression is potentially problematic.

Rename references to "User's Guide" to "Help" since the link to the
User's Guide in the Help menu is just called *Contents*.

Name specific sections within the help which pertain to the warning
tooltip being shown. Gives first-time users some help in finding the
right part of the sizeable User's Guide.
2021-10-12 06:54:25 +00:00
Chuck Craft fefad2e7cf dumpcap: double received count when using threads
Closes #17089
2021-10-12 06:37:46 +00:00
John Thacker 634650f1e4 TCP: Follow: Don't treat placeholder value 0 as a real ACK number
Since the wraparound aware GT_SEQ is used, passing in 0 for the
ACK number can result in thinking that bytes are missing and
dropping frames from the follow stream tap.
2021-10-12 04:09:11 +00:00
Eugene Adell f6b0de6b12 TCP: Port reuse ends with false Retransmissions
In rare circumstances when a connection could not established on
the first try, succeeding in establishing it later would generate
many Retransmissions. Closes 17616.
2021-10-12 03:52:01 +00:00
Gerald Combs ed98abe208 BT-DHT: Exit a loop.
Always make sure our offset advances in dissect_bencoded_list.
Fixes #17651.
2021-10-12 03:35:32 +00:00
Gerald Combs 643fbe52ae Docs: Use Asciidoctor to copy ws.css.
Use the `copycss` attribute in the release notes and FAQ to copy ws.css
to the right location.
2021-10-12 01:02:53 +00:00