What is a VoidString object?

139 views Asked by At

I am programming a LUA Dissector for Wireshark and have read about a VoidString object which could be passed by while creating a ProtoField object. See https://wiki.wireshark.org/LuaAPI/Proto#ProtoField for more information. I would like to no more about this object and what's the purpose of using it. If I am clicking on the link ''VoidString'' an empty page is getting displayed unfortunately because the documentation for this object seems to be missed. I have googled it but found nothing. Any Ideas?

Thanks in Advance!

1

There are 1 answers

0
Aldo Perez On

I have learned from the examples provided by Wireshark that voidString can be passed an table. This table maps the values that you expect with what the value means.

local packet_type = {
        [0] = "Data",
        [1] = "heartBeat",
        [2] = "Keep Alive",
}
local pf_packet_type = ProtoField.uint16("my_discector.packet_type", "Packet Type", base.DEC, packet_type, nil, "This describes a packet type")

This packet will show the string along with the actual value it got instead of just the value. Hope this helps.