什么是VoidString对象? [英] What is a VoidString object?

查看:139
本文介绍了什么是VoidString对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Wireshark编写LUA Dissector,并了解了有关在创建ProtoField对象时可以通过的VoidString对象的信息.有关更多信息,请参见 https://wiki.wireshark.org/LuaAPI/Proto#ProtoField 信息.我不想再谈论这个对象以及使用它的目的是什么.如果单击链接"VoidString",很不幸会显示一个空页面,因为似乎缺少此对象的文档.我已经用谷歌搜索了,但是什么也没找到.有任何想法吗?

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?

预先感谢!

推荐答案

我从Wireshark提供的示例中学到,可以将voidString传递给表.该表将您期望的值与该值的含义相对应.

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.

这篇关于什么是VoidString对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆