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

Wireshark-dev: Re: [Wireshark-dev] New in Wireshark making a dissector

From: Christopher Maynard <Christopher.Maynard@xxxxxxx>
Date: Wed, 27 Apr 2016 13:54:21 +0000 (UTC)
 <guembe.100649 <at> e.unavarra.es> writes:

> I want add subtree , a HEX value with 16bytes, but  buf max is 8 bytes,
> when I tried more not works. I tried defining Protofield  like a string
> and it works but I want to show in HEX . Why can do it?
> 
> local f_marker = ProtoField.string("myproto.marker", "MARKER", base.HEX)
> 
>   subtree = root:add(p_myproto, buf(0))
>   subtree:add(f_marker, buf(0,16))

Try declaring f_marker like so:

local f_marker = ProtoField.bytes("myproto.marker", "MARKER")

Ref:
https://www.wireshark.org/docs/wsdg_html_chunked
/lua_module_Proto.html#lua_class_ProtoField,
specifically section 11.6.7.24.

Also, you should probably start a new thread for each new question you have
rather than continue an old, unrelated thread.  You could also visit
https://ask.wireshark.org/ to search for answers to Wireshark-related
questions or to post your own question.

- Chris