如何在lua中创建自定义大小的整数字段?

我正在开发分析器,我需要一个长度为48位的ProtoField。(它也可以是12位,我正在寻找自定义大小的长整数)

我查看了许多在线分析器示例,其ProtoField设置部分如下所示:

message_length = ProtoField.int32("mongodb.message_length", "messageLength",
base.DEC)
request_id = ProtoField.int32("mongodb.requestid", "requestID",
base.DEC)
response_to = ProtoField.int32("mongodb.responseto", "responseTo",
base.DEC)

其中点后面通常是int8、int16或int32。

代码来自以下链接:

https://github.com/mika-s/mika-s.github.io/blob/master/assets/creating-wireshark-dissectors-3/mongodb.lua

点赞