Wireshark中lua包的路径是什么?

我们编写的Lua自定义Wireshark解析器以以下方式开始:

-- 创建一个协议对象
test_protocol = Proto("test", "测试协议")

messageLength_F = ProtoField.uint32("test.messageLength", "messageLength", base.HEX)
requestID_F = ProtoField.uint32("test.requestID", "requestID", base.HEX)
responseTo_F = ProtoField.uint32("test.responseTo", "responseTo", base.HEX)
opCode_F = ProtoField.uint32("test.opCode", "opCode", base.HEX)

它可以正常工作,但是我使用的 Visual Studio Code 的 lua 扩展(sumneko.lua)报告说 Proto 和 ProtoField 是未定义的全局变量。我猜我需要告诉扩展lua运行时包路径。

Wireshark的包路径是什么?

我应该在解析器中使用 require 指定该路径吗?

点赞
用户4940771
用户4940771

我的问题已在这里得到解答:https://github.com/sumneko/lua-language-server/issues/545

2021-05-26 13:25:03