“Apply as Column” for field in custom protocol in Wireshark
I've written a dissector in Lua for my custom protocol:
local myproto = Proto("MyProto", "My Custom Protocol")
myproto.fields.msg_counter = ProtoField.uint8("myproto.msg_counter", "Message counter", base.DEC)
function myproto.dissector(tvbuf, pktinfo, root)
pktinfo.cols.protocol = myproto.name
if root.visible then
root:add_le(myproto.fields.msg_counter, tvbuf(10, 1))
end
end
local udp_port = DissectorTable.get("udp.port")
udp_port:add(5432, myproto)
That works, the "Message counter" field and its value are correctly displayed in the tree area. But when I right click the field and choose "Apply as Column", the column is added but remains empty:
How can I fix this, so that the field values are displayed in the column view? I'm using Wireshark 3.2.3. Thanks in advance!