Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] Add computed bytes of different length

From: Kevin Cox <kevincox@xxxxxxxxxxx>
Date: Wed, 04 Jun 2014 10:09:11 -0400
Hello,

Please forgive me if I am missing something obvious.  I am trying to add
some computed bytes to the proto_tree and wish them to be filterable.
However, the proto_tree_add_bytes and similar functions only have one
length argument that is used for both the tvb and the value pointer.
The problem is that my bytestring is not directly from the tvb and is a
different length.  I was wondering how I could add this to the tree.

Currently I see only the following options:
- Add it with the correct length for the value and have the output show
the string coming from the wrong place in the packet.  This also has the
problem that I can extend past the end of the tvb possibly raising
exceptions.
- Use a FT_NONE and don't add the value byte string.  However this
removes the option of filtering on the value of the field.

Any advise would be appreciated,
Kevin

Attachment: signature.asc
Description: OpenPGP digital signature