Commit Graph

56 Commits

Author SHA1 Message Date
Martin Mathieson c331e17bea Ignore or fix more warnings (check_typed_item_calls) 2023-02-06 09:24:26 +00:00
Martin Mathieson ed8ee831fd More fussing with items and calls. 2023-01-31 17:32:05 +00:00
Martin Mathieson efe35a4ccc Fix or suppress more warnings from check_typed_item_calls 2023-01-30 10:28:24 +00:00
Martin Mathieson 407b707e1f check_typed_item_calls: filter out some false positives 2023-01-29 18:39:20 +00:00
Martin Mathieson 32d80bd54e check_typed_item_calls.py: change re for calls to allow ws before params 2023-01-24 12:23:43 +00:00
Martin Mathieson c84a54c82f Checked encoded values for proto_tree_add_item() 2023-01-21 11:16:20 +00:00
Martin Mathieson be51acfffb Fix some issues seen by tools/check_typed_item_calls.py 2023-01-20 12:47:59 +00:00
Martin Mathieson 4dd78f11c9 Fix various issues seen with tools/check_typed_item_calls.py 2023-01-16 15:35:04 +00:00
Martin Mathieson 872db1fe87 For 'fields' param in add_bitmask_, check item masks 2023-01-03 07:28:48 +00:00
Martin Mathieson 92a81b1361 Enable checks for proto_tree_add_bits APIs 2022-12-29 17:35:18 +00:00
Martin Mathieson 5bbe533244 WIP: Check types for _add_bits_ functions, and ensure no mask 2022-12-27 12:10:03 +00:00
Martin Mathieson d17c018013 tools/check_typed_item_calls: check FT_BOOLEAN mask length 2022-12-15 13:28:05 +00:00
Martin Mathieson b7c3bae518 check_typed_item_calls: add check for add_bitmask fields 2022-12-03 17:15:24 +00:00
Martin Mathieson 6eb734995a Change the re for matching an item's label 2022-11-30 09:25:13 +00:00
Simon Holesch 8f6a640337 epan: Allow FT_UINT_STRING for proto_tree_add_string()
Since cbd3c447 ("ftypes: Add FT_UINT_STRING to IS_FT_STRING() macro")
proto_tree_add_string() accepts FT_UINT_STRING, but the API check still
fails. Update the API check to reflect that change.
2022-10-31 14:54:39 +00:00
Martin Mathieson 1337db5a18 check_typed_item_calls.py: check for consecutive calls to same item 2022-08-12 16:20:35 +00:00
Martin Mathieson 17367e4648 check_typed_item_calls: skip mask checks if can't parse 2022-05-21 19:54:13 +00:00
Martin Mathieson 24d65950e9 check_typed_item_calls: Count all warnings 2022-04-17 22:47:09 +00:00
Martin Mathieson 55d3a9db9e tools/check_*.py: allow multiple --file entries 2022-02-20 23:12:10 +00:00
Martin Mathieson 095255481a Tidy up some masks in items. 2022-02-08 08:56:17 +00:00
Martin Mathieson 19ec126687 check_typed_item_calls.py - Find all (but 3) items from calls. 2022-01-29 15:54:19 +00:00
Martin Mathieson 89b7a1328b tools/check_typed_item_calls.py: improve detection of missing items 2022-01-25 11:43:32 +00:00
John Thacker b4e74af118 check_typed_item_calls.py: Don't match files with extra extensions
When checking is_dissector_file(), only match against files that
end in ".c" and not, e.g. ".c.swp" ".c~" or other such temporary
files that might be binary files (as with vim .swp files).

Prevents errors like "UnicodeDecodeError: 'utf-8' codec can't decode
byte 0xe4 in position 18: invalid continuation byte" with Python 3
when a dissector file is open in vim.
2022-01-23 00:00:32 +00:00
Martin Mathieson d7d2994228 check_typed_item_calls.py: fix matching of calls 2022-01-21 21:59:50 +00:00
Martin Mathieson 4720967c4a tools/check_typed_item_calls.py improvements 2022-01-19 22:32:04 +00:00
Martin Mathieson 73b94e7aef Improvements to check_typed_item_calls.py 2022-01-19 17:14:59 +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
Martin Mathieson 263189e23d Fix some spelling errors. 2021-11-18 04:43:51 +00:00
Martin Mathieson ef2468662b check_typed_item_calls.py: Flag bits set outside mask
Current errors are:
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)
Error: epan/dissectors/packet-opa-snc.c filter= opa.snc.rhf.eccerr 0x200000000 with len is 9 but type FT_BOOLEAN  indicates max of 8 and extra digits are non-zero (2)
Error: plugins/epan/ethercat/packet-ethercat-datagram.c filter= ecat.reg.ctrlstat.rdacc 0x0100 with len is 4 but type FT_BOOLEAN  indicates max of 2 and extra digits are non-zero (01)
Error: plugins/epan/ethercat/packet-ethercat-datagram.c filter= ecat.reg.ctrlstat.wracc 0x0200 with len is 4 but type FT_BOOLEAN  indicates max of 2 and extra digits are non-zero (02)
Error: plugins/epan/ethercat/packet-ethercat-datagram.c filter= ecat.reg.ctrlstat.reloadacc 0x0400 with len is 4 but type FT_BOOLEAN  indicates max of 2 and extra digits are non-zero (04)
Error: plugins/epan/ethercat/packet-ethercat-datagram.c filter= ecat.reg.ctrlstat.crcerr 0x0800 with len is 4 but type FT_BOOLEAN  indicates max of 2 and extra digits are non-zero (08)
Error: plugins/epan/ethercat/packet-ethercat-datagram.c filter= ecat.reg.ctrlstat.lderr 0x1000 with len is 4 but type FT_BOOLEAN  indicates max of 2 and extra digits are non-zero (10)
Error: plugins/epan/ethercat/packet-ethercat-datagram.c filter= ecat.reg.ctrlstat.cmderr 0x2000 with len is 4 but type FT_BOOLEAN  indicates max of 2 and extra digits are non-zero (20)
Error: plugins/epan/ethercat/packet-ethercat-datagram.c filter= ecat.reg.ctrlstat.wrerr 0x4000 with len is 4 but type FT_BOOLEAN  indicates max of 2 and extra digits are non-zero (40)
Error: plugins/epan/ethercat/packet-ethercat-datagram.c filter= ecat.reg.ctrlstat.busy 0x8000 with len is 4 but type FT_BOOLEAN  indicates max of 2 and extra digits are non-zero (80)
2021-10-04 18:07:28 +00:00
Martin Mathieson 543ea3968c ethercat: Fix some too-wide mask widths.
N.B. Some other issues spotted have been reported in
https://gitlab.com/wireshark/wireshark/~/issues/17605
2021-09-21 11:04:31 +01:00
Martin Mathieson d3b016a365 Remove trailing colons from item label names
This is a new check added to check_typed_item_calls.py --label

Ignoring cases where item type is FT_NONE, as fpr tjpse
text was appended that otherwise would lack a colon.
2021-08-23 08:32:56 +00:00
Martin Mathieson 545eab808e Fix some item label names with unbalanced parens/braces/brackets
Spotted by new check added to check_typed_item_calls.py --label
2021-08-14 21:24:13 +01:00
Martin Mathieson 03c3c9a056 check_typed_item_calls: Add some ptvcursor_add...() calls
Fix up some NFAPI calls.
2021-08-08 17:47:42 +01:00
Martin Mathieson 6d02f1dcf9 Check scripts: split issues into errors and warnings
For CI, will now return error codes only for those issues
that are definitely bugs that will require fixing. i.e.

- if the type is not compatible with the call

- if a TFS is (case-sensitively) identical to a tfs.c entrywq
2021-07-31 16:06:32 +01:00
Martin Mathieson d34d1a1e13 More fussing with masks.
Mostly longer masks with odd numbers of digits.
2021-07-29 10:15:58 +00:00
Martin Mathieson a7b5eec265 check_typed_item_calls.py: check add_bitmask() functions 2021-07-26 10:31:15 +00:00
Martin Mathieson a975ef7203 check_typed_item_calls.py: Add a check for all-zeroes mask
When the mask value is 0x0, it effectively means there is no
mask, and that all bits count.

Fix found instances and replace them with 0x0.
2021-07-24 10:58:15 +00:00
Martin Mathieson 86e2fda11e check_typed_item_calls: fix typo 2021-07-11 17:15:44 +01:00
Martin Mathieson 030d659f88 More mask checks and some fixes. 2021-07-11 14:55:55 +00:00
Martin Mathieson 9e5d051a8a check_typed_item_calls.py Some more mask checks
Fix a handful of (trivial) issues found.
2021-07-08 13:02:18 +00:00
Martin Mathieson 3dd7ba03fa tools/check_typed_item_calls.py: Add extra mask checks 2021-07-07 10:00:45 +01:00
Moshe Kaplan 009ce4b331 check_typed_item_calls.py: Avoid duplicating list entries
Avoid duplicating list entries and modifying a list during
iteration.
2021-01-25 10:08:45 +00:00
Moshe Kaplan 9592d3fee9 check_typed_item_calls.py: Avoid mutating default arguments
Python only creates the default argument once and reuses it for
further invocations. Instead, of mutating the default list,
set the default argument to be None and then create a
list, if needed. For more info, see
https://docs.python-guide.org/writing/gotchas/
2021-01-25 09:27:59 +00:00
Martin Mathieson 41d6deb7c3 Scripts: Check that files exist.
Prompted by seeing an exception when files have been deleted by commits.
2020-12-31 12:02:42 +00:00
Dario Lombardo bf81d7c16a tools: skip deleted files in check_typed_item_calls.
Ref: #17114.
2020-12-30 13:40:01 +00:00
Martin Mathieson e2593e2022 Call add item and tfs checking scripts in ubuntu pipeline
N.B. Neither of these scripts return an error code if issues are found.
2020-12-21 11:46:29 +00:00
Martin Mathieson b7cb24c1fd check_typed_item_calls.py: some tweaks 2020-12-15 11:54:48 +00:00
Martin Mathieson e1b3fb0262 tools/check_typed_item_calls.py: check consecutive mask 2020-11-16 10:12:51 +00:00
Martin Mathieson cfa55d6a46 tools/check_type_item_calls.py: Check lengths
For calls to proto_tree_add_item(), compare length field in call
with length implied by type of item.
2020-10-17 22:38:02 +00:00
Martin Mathieson 0ca5484aed check_typed_item_calls.py: Add some extra checks
Checks added for completeness, didn't uncover any current issues.
2020-10-09 21:20:12 +01:00