What is a VoidString object?

痴心易碎 提交于 2019-12-25 02:19:28

问题


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:


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.



来源:https://stackoverflow.com/questions/51261175/what-is-a-voidstring-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!