aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2021-09-15 21:32:56 +0200
committerTomasz Moń <desowin@gmail.com>2021-09-26 18:16:28 +0200
commit7b82110092a105eedd5209e4ed75416098161d1f (patch)
treef8393d14a485e04f9a3091f04b0cc23606aeffd9 /tools
parentd87e6e58fae2c36d3834a696b9a5a4ed8cc1d21b (diff)
USB HID: Parse bit fields with correct bit order
Implement little endian support for tvb_get_bits family of functions. The big/little endian refers to bit numbering within an octet. In big endian, the most significant bit is considered bit 0, while in little endian the least significant bit is considered bit 0. Add encoding parameters to proto tree bits format family functions. Specify ENC_BIG_ENDIAN in all dissectors using these functions except in USB HID that requires ENC_LITTLE_ENDIAN to work correctly. When formatting bits values, always display most significant bit on the leftmost position regardless of the encoding. This results in no gaps between octets and makes the displayed value comprehensible. Close #4478 Fix #17014
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkAPIs.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index 68c9caf82e..7679dbdc95 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -608,7 +608,7 @@ sub check_proto_tree_add_XXX($$)
#Check for accidental usage of ENC_ parameter
if ($args =~ /,\s*ENC_/xos) {
- if (!($func =~ /proto_tree_add_(time|item|bitmask|bits_item|bits_ret_val|item_ret_int|item_ret_uint|bytes_item|checksum)/xos)
+ if (!($func =~ /proto_tree_add_(time|item|bitmask|[a-z0-9]+_bits_format_value|bits_item|bits_ret_val|item_ret_int|item_ret_uint|bytes_item|checksum)/xos)
) {
print STDERR "Error: ".$filename." uses $func with ENC_*.\n";
$errorCount++;