Wireshark-bugs: [Wireshark-bugs] [Bug 8503] Add USBPcap support

Date: Thu, 21 Mar 2013 09:19:06 +0000

changed bug 8503

What Removed Added
CC   [email protected]

Comment # 2 on bug 8503 from
Hi Tomasz,

I had a really quick look at your patch. It sounds promising but I spotted a
few issues.

Instead of:
tvb_memcpy(tvb, (guint8 *)&val16, 0, 2);
proto_tree_add_uint(tree, hf_usb_win32_header_len, tvb, 0, 2, val16);
you should simply use:
proto_tree_add_item(tree, hf_usb_win32_header_len, tvb, 0, 2, ENC_BIG_ENDIAN);
assuming that this protocol is big endian. Otherwise use ENC_LITTLE_ENDIAN.

To get data, why not use the accessors tvb_get_guint8 & Co instead of
systematically using tvb_memcpy? You could replace
tvb_memcpy(tvb, (guint8 *)&iso_offset, offset, 4);
by
iso_offset = tvb_get_ntohl(tvb, offset); (still assuming big endian).

Lines like
proto_tree_add_item(tree, hf_usb_win32_iso_offset, tvb, offset, 4, iso_offset);
are wrong. Instead it should be:
proto_tree_add_item(tree, hf_usb_win32_iso_offset, tvb, offset, 4,
ENC_BIG_ENDIAN);

Best regards,
Pascal.


You are receiving this mail because:
  • You are watching all bug changes.