Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

help with LUA + ipv4 + append_text

in a LUA script I've multiple TLV tree items. Inside each tree item I'm able to visualize different type of variables, ie ipv4 addresses:

f.tlvvalue_ipv4 = ProtoField.ipv4 ("myproto.tlvvalue_ipv4", "TLV Value")
tlv_tree:add (f.tlvvalue_ipv4, buffer(offset, tlvlen))

Now I would like to repeat the same information (ipv4 address) in the append_text as well so it get visible avoiding to expand that specific tree item first.

For string I can do:

local tlvvalue_string=buffer(offset+4, tlvlen):string()
tlv_tree:append_text (", Value: " .. tlvvalue_string)

but not sure how to visualize the ipv4 or numbers...

So suppose buffer(offset+4, tlvlen) points to an ipv4.... how to print it with the append_text ?

Appreciated any help!!!