Commit Graph

82297 Commits

Author SHA1 Message Date
João Valverde 541d45fc6f dfilter: Remove no-op statement 2021-10-08 04:01:24 +00:00
John Thacker dbf5782b70 BT-DHT: Support BEP 42, DHT Security Extension
Properly support BEP 42: the 'ip' string includes the port, so the
expected length is 6 octets, not 4. That key also appears on the top
level, and sorts before the 'r' key, so add it to heuristics.

Take the opportunity to strengthen the heuristics; certain other keys
never sort before others, and we know the types of several of the keys.
That allows us to go from seven possibilities for the first four bytes
to four possibilities for the first five bytes, which is surely precise
enough to enable the heuristic by default.

Sort the value_strings.
2021-10-08 03:45:22 +00:00
Gerald Combs 991fc16e85 Qt: Remove Q_OBJECT in a few places where it's not needed.
Q_OBJECT is only needed for signals+slots, translations, and other
meta-object services. Remove it in some classes, since having it means
we're generating and compiling code unnecessarily.
2021-10-08 03:29:30 +00:00
João Valverde 4d2f469212 dfilter: Use exceptions for error handling in semcheck
Instead of checking for an error return and throwing the exception
then do it where the errors occurs. This takes advantage of the nice
properties of error exceptions to reduce the amount of error
checking code.
2021-10-07 23:01:50 +00:00
João Valverde 5fcdf25697 dfilter: Generalize special case of one byte literal
Instead of only accepting a byte literal specification if the LHS is a
len-1 byte string, accept it everywhere bytes are wanted.

Before:
  $ dftest "frame[1] contains 0x01"
  Filter: frame[1] contains 0x01

  Constants:
  00000 PUT_FVALUE	01 <FT_BYTES> -> reg#2

  Instructions:
  (...)

  $ dftest "frame[1:4] contains 0x01"
  Filter: frame[1:4] contains 0x01
  dftest: "0x01" is not a valid byte string.

After:
  $ dftest "frame[1:4] contains 0x01"
  $ Filter: frame[1:4] contains 0x01

  Constants:
  00000 PUT_FVALUE	01 <FT_BYTES> -> reg#2

  Instructions:
  (...)
2021-10-07 23:01:50 +00:00
Martin Mathieson d8b28f8040 Fix some field mask widths. 2021-10-07 21:33:49 +00:00
Gerald Combs 0c4d4f6835 Version: 3.5.1 → 3.7.0
[skip ci]
2021-10-07 14:27:38 -07:00
João Valverde 9dab2280ca dfilter: Fix parsing of octal character escape sequences
Octal escape sequences \NNN can have between 1 and 3 digits. If
the sequence had less than 3 digits the parser got out of sync
with an incorrect double increment of the pointer and errors out
parsing sequences like \0, \2 or \33.

Before:
  Filter: ip.proto == '\33'
  dftest: "'\33'" is too long to be a valid character constant.

After:
  Filter: ip.proto == '\33'

  Constants:
  00000 PUT_FVALUE	27 <FT_UINT8> -> reg#1

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

Fixes #16525.
2021-10-07 18:44:37 +00:00
Evan Huus 0eda51a646 to_str: scope tvb_ip6_to_str 2021-10-07 13:31:23 -04:00
Michail Koreshkov 086feb2f09 Ignore length of data parameter in DT1 message
Some upper level tracing tool writes message in single DT1 even
length of data greater than 255 bytes.
2021-10-07 16:01:22 +00:00
Evan Huus 07f5472aa7 to_str: scope tvb_ip_to_str 2021-10-07 10:25:12 -04:00
João Valverde 4a2b18a9c0 dfilter: Skip equality test and add explanation
Also fix a byte typo in the 'eth' filter expression.
2021-10-07 13:21:32 +00:00
Anders Broman 83446c4719 LTE-RRC: Add a couple of more "protocols". 2021-10-07 12:22:26 +00:00
Roy Zhang c946ee3686 5G LI: Add dissector for 5G Lawful Interception
packet-li5g.c used to parse the LI x2/x3 PDU header which defined in ETSI TS 103 221-2
lix2 used to parse the x2 xIRI payload, the ASN.1 defined in 3GPP 33.128.

Add the dissector generated by asnwer

will merge this file in a new request, so, delete it from the 5G LI branch

Add a comment line stating the 3gpp document in lix2.asn

fix the commit warning
2021-10-07 03:53:50 +00:00
John Thacker ca5a45428f SMPP: Handle unaligned PDUs better
Test to see if the start of a packet looks like SMPP before
calling tcp_dissect_pdus, so that we don't calculate a bogus
length (and fail to process many packets) if the capture
starts in the middle of a TCP connection.

When the heuristic dissector has found SMPP, mark it as a
conversation with the SMPP dissector.

There's room for more improvement by scanning through the current
segment to look for the PDU start, but this makes it work
considerably better, at least as well as 1.10.x. Improves #11306.
2021-10-07 03:37:56 +00:00
João Valverde e4e0b97082 dfilter: Use wslog with ws_assert_magic() 2021-10-06 15:44:48 +00:00
João Valverde 8c5a4f9100 dfilter: Replace node accessor macros with functions
Replace macro magic to improve ease of comprehension and maintenance.
2021-10-06 15:44:48 +00:00
João Valverde a7242733a4 dfilter: Fix ws_assert_magic() macro
We need to use WS_DISABLE_DEBUG, not WS_DEBUG.

Fixes 0e50979b3f.

Rename some lingering assert_magic() references.
2021-10-06 15:44:48 +00:00
João Valverde 5f8ab69cb5 Windows: Fix stdint.h redefinition warnings
We must include the headers, particulary stdint.h, at the top of
scanner.l so that the stdint.h defintions precede flex's own
replacements.
2021-10-06 16:03:19 +01:00
Stig Bjørlykke e3ba0c5ea5 lwm2mtlv: Decode Location Velocity
Decode Location Velocity opaque value according to 3GPP GAD spec,
using dissect_description_of_velocity().
2021-10-06 14:13:19 +00:00
Stig Bjørlykke d3695f8b53 gsm_a: Fix dissect_description_of_velocity()
Several improvements to dissect_description_of_velocity()
- Velocity Type is first 4 bits, do not increase offset after this
- Direction of Vertical Speed is bit 7
- Only increase curr_offset in this function
2021-10-06 13:52:30 +00:00
João Valverde 4804c1224d dfilter: Use syntax tree node replacement semantics
Instead of using 3 operations (new + free + reassign_to_parent) to transform
the tree use a simpler single replace operation instead.

This also avoids having to manually copy token values.

The set search and replace method is now obsolete.
2021-10-06 10:34:21 +00:00
Martin Mathieson af19fc795a Add NGAP Stats. 2021-10-06 09:26:42 +00:00
Martin Mathieson b240d5baa0 Ethercat: try to fix EEPROM Ctrl/Status bitmask fields
Fixes remaining errors detected by

./tools/check_typed_item_calls.py --mask
2021-10-06 04:53:50 +00:00
John Thacker 1dd8f3a666 capinfos: Calculate hashes after determining if a capture file
Calculate the hashes for a file after the wtap_open_offline, to avoid
spending time calculating them for files that aren't known capture
formats. We wouldn't print the checksums in those cases anyway,
and the time savings can be considerable on large non-capture files.
2021-10-06 04:38:00 +00:00
Oscar Gonzalez de Dios 7bdfa653a1 PCEP: Added support of draft-ietf-pce-segment-routing-policy-cp-05
added SR Policy Name TLV
added SR Policy Candidate Path Identifiers TLV
added SR Policy Candidate Path Name TLV
added SR Policy Candidate Path Preference TLV
Extended Association ID TLV format for assoc_type 6 included

Removed development comments and formatted code

Association type field values are displayed, according to IANA registered values

fixed filters for extended-association-id TLVs
2021-10-06 04:21:06 +00:00
John Thacker 9ae0d3c4f1 BSSAP: Use VLR number field
For some reason (copy and paste?) the SGSN number field was substituted
for the VLR number field, and then later the latter got commented out
as it was being unused.
2021-10-06 04:04:04 +00:00
Gerald Combs aa41dd9a56 GitLab CI: Restrict our merges to master. 2021-10-06 03:45:55 +00:00
Anders Broman d2dff29c83 NR RRC: Make more PDUs set col and proto. 2021-10-06 03:08:22 +00:00
Gerald Combs 0aae44e145 GitLab CI: Switch to clang 13.
Clang 13 was added to the Ubuntu image in wireshark-containers
e5725506f4.
2021-10-06 00:28:01 +00:00
Gerald Combs 4f4e9bfbc4 Transifex: Update our configuration.
Update our configuration to match recent changes on transifex.com.
2021-10-06 00:04:08 +00:00
Brian Sipos bc3bced07d COSE: Handle indefinite tstr/bstr encodings 2021-10-05 21:11:36 +00:00
João Valverde 39036a0a30 dfilter: Add some more syntax tests 2021-10-05 19:19:36 +01:00
João Valverde 7bf02254c1 dfilter: Rename function production rule
Make it more obvious that entities are also functions.
2021-10-05 19:19:36 +01:00
João Valverde a940318f37 dfilter: Minor grammar fixups
Clean up syntax error code. TEST and SET are never returned by
the tokenizer.

Remove unnecessary range_body() grammar element. Fix a comment.

Move the stnode_token_value() function to its proper place.
2021-10-05 17:56:21 +01:00
João Valverde d45ba348fd dfilter: Strengthen sanity check for range
Allow an entity in the grammar as range body. Perform a stronger
sanity check during semantic analysis everywhere a range is used.
This is both safer (unless we want to allow FIELD bodies only, but
functions are allowed too) and also provides better error messages.

Previously a range of range only compiled on the RHS. Now it can
appear on both sides of a relation.

This fixes a crash with STRING entities similar to #10690 for
UNPARSED.

This also adds back support for slicing functions that was removed
in f3f833ccec (by accident presumably).

Ping #10690
2021-10-05 16:39:41 +01:00
João Valverde f7a2abb4ae dfilter: Don't include type name in 'tostr' output
This makes 'stnode_tostr()' more useful for end-user error reporting.
For debugging purposes we tack on the type name in the debug specific
code instead.
2021-10-05 16:25:36 +01:00
Jaap Keuter b700448745 Eth: Segment routing over IPv6 2021-10-05 13:29:55 +00:00
Stig Bjørlykke 0ca24f01d7 cose: Fix memory leaks
Do not allocate cose_param_key_t in dissect_header_pair(), this may
leak. Use wmem_strdup() to temporary copy a string.

Fixes #17627
2021-10-05 08:18:31 +02:00
AndersBroman 60899ed216 Update README.developer 2021-10-05 05:40:16 +00:00
João Valverde 6898210ded docs: Add section about architecture to README.developer 2021-10-05 05:40:16 +00:00
Gerald Combs f51510f401 IDMP: Fix a string allocation.
protocolID is packet scoped, so it can lead to hilarity if we add it to
the ROS dissector's epan scoped wmem_map. Add an epan-scoped copy of
protocolID instead. Blind attempt at fixing #16342.
2021-10-05 05:15:32 +00:00
Evan Huus f9ac0f40f7 to_str: scope decode_bits_in_field
Mostly straightforward. The only complication was
proto_tree_add_split_bits_crumb which needed some manipulation to
guarantee a non-null tree so we could use its memory scope.

This is one of the last non-dissector uses of wmem_packet_scope!
2021-10-05 04:42:13 +00:00
Piotr Winiarczyk 4661e1ddd9 btmesh: improve scheduler dissection
Add better month and week of day dissections for three messages.
2021-10-05 04:26:10 +00:00
Anders Broman b4cd8c0a8e NR RRC: Register protocols which sets proto and info columns. 2021-10-05 03:48:51 +00:00
Martin Mathieson 79c9e46144 Fix some items where mask was wider than field.
Detected by ./tools/check_typed_item_calls.py --mask

Error: epan/dissectors/packet-asterix.c filter= asterix.021_161_TN 0x0fff with len is 4 but type FT_UINT8  indicates max of 2 and extra digits are non-zero (0f)
Error: epan/dissectors/packet-capwap.c filter= capwap.control.message_element.ieee80211_station_session_key.flags_a 0x2000 with len is 4 but type FT_BOOLEAN  indicates max of 1 and extra digits are non-zero (200)
Error: epan/dissectors/packet-capwap.c filter= capwap.control.message_element.ieee80211_station_session_key.flags_c 0x1000 with len is 4 but type FT_BOOLEAN  indicates max of 1 and extra digits are non-zero (100)
Error: epan/dissectors/packet-cfdp.c filter= cfdp.trans_stat_2_b 0x6000 with len is 4 but type FT_UINT8  indicates max of 2 and extra digits are non-zero (60)
Error: epan/dissectors/packet-cfdp.c filter= cfdp.suspension_ind_b 0x8000 with len is 4 but type FT_UINT8  indicates max of 2 and extra digits are non-zero (80)
Error: epan/dissectors/packet-ixveriwave.c filter= ixveriwave.tx.factorydebug 0x7f80 with len is 4 but type FT_UINT8  indicates max of 2 and extra digits are non-zero (7f)
2021-10-04 21:58:33 +00:00
Gerald Combs d4c908a573 Revert "TCP: last out-of-order packet is marked as a retransmission"
Manually revert commit 4e3ec2d01a in order to work around a conflict
with 2484ad2f72.
2021-10-04 21:41:37 +00:00
Pascal Quantin 924bb5b8b3 F1AP: upgrade dissector to v16.7.0 2021-10-04 20:48:05 +00:00
Pascal Quantin d6e2dbe407 E1AP: upgrade dissector to v16.7.0 2021-10-04 20:31:05 +00:00
Pascal Quantin 5cf2a61938 XnAP: upgrade dissector to v16.7.0 2021-10-04 20:13:51 +00:00