diff options
author | Tomasz Moń <desowin@gmail.com> | 2019-05-26 16:49:22 +0200 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2019-06-05 17:10:23 +0000 |
commit | f29d6d1e00999be3d6a836522112ac3347b68844 (patch) | |
tree | de12d02b871d40c1b9c166ce7ce4a4bff1f20490 /epan | |
parent | f35e7f874de990bbd1a028b057539212e0ebbedd (diff) |
USB: Use standard descriptor strings in GET DESCRIPTOR
Display the default strings in all contexts where usb.bDescriptor is used.
Change-Id: I9f4479ccc0664585fc259927c0b2ee1149b02454
Reviewed-on: https://code.wireshark.org/review/33368
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-usb.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index b72e7e2ebc..3276bb41dd 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -1924,7 +1924,6 @@ proto_item * dissect_usb_descriptor_header(proto_tree *tree, { guint8 desc_type; proto_item *length_item; - proto_item *type_item; length_item = proto_tree_add_item(tree, hf_usb_bLength, @@ -1932,14 +1931,14 @@ proto_item * dissect_usb_descriptor_header(proto_tree *tree, offset++; desc_type = tvb_get_guint8(tvb, offset); - type_item = proto_tree_add_item(tree, hf_usb_bDescriptorType, - tvb, offset, 1, ENC_LITTLE_ENDIAN); /* if the caller provided no class specific value string, we're * using the standard descriptor types */ if (!type_val_str) - type_val_str = &std_descriptor_type_vals_ext; - proto_item_append_text(type_item, " (%s)", - val_to_str_ext(desc_type, type_val_str, "unknown")); + type_val_str = &std_descriptor_type_vals_ext; + + proto_tree_add_uint_format_value(tree, hf_usb_bDescriptorType, + tvb, offset, 1, desc_type, "0x%02x (%s)", desc_type, + val_to_str_ext(desc_type, type_val_str, "unknown")); return length_item; } @@ -5912,7 +5911,7 @@ proto_register_usb(void) { &hf_usb_bDescriptorType, { "bDescriptorType", "usb.bDescriptorType", - FT_UINT8, BASE_HEX, NULL, 0x0, + FT_UINT8, BASE_HEX|BASE_EXT_STRING, &std_descriptor_type_vals_ext, 0x0, NULL, HFILL }}, /* Only used when descriptor type cannot be determined */ |