This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

I want add subtree , a HEX value with 16bytes, but buf max is 8 bytes

0

I asked this question on the wireshark-dev mailing list and @cmaynard solved it. YOU HAVE HERE:

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))

asked 03 May '16, 02:28

javiguembe's gravatar image

javiguembe
21448
accept rate: 0%

edited 03 May '16, 07:06

cmaynard's gravatar image

cmaynard ♦♦
9.4k1038142

What you should really do is rework your "question" to clearly state the problem, and then add an answer post with the answer and then accept the answer so others can see it's a helpful answer to your question. Then there's no need for the redundant "(SoLVED)" in the question title.

Please read the FAQ for the site for more information.

(03 May '16, 03:35) grahamb ♦

I've tried to clean it up.

(03 May '16, 07:13) cmaynard ♦♦

Sorry! Thanks!

(04 May '16, 01:18) javiguembe

One Answer:

2

The intent of sending javiguembe to this site was not to ask and answer this question but to make javiguembe aware of the site so that it might be utilized to search for answers to future questions or to ask new questions. But since the question has been asked here, I'll post the relevant part of the answer I gave on the mailing list, which apparently solved the problem:

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.

answered 03 May '16, 07:12

cmaynard's gravatar image

cmaynard ♦♦
9.4k1038142
accept rate: 20%