Wireshark Lua 解析插件表错误

我有一个带有尾随数据的数据包,就像 ixia 时间戳尾随。 我正在尝试为 Wireshark 编写一个解析器,它与 ixia-packet_trailer 插件非常相似。 https://raw.githubusercontent.com/boundary/wireshark/master/epan/dissectors/packet-ixiatrailer.c

但是我想用 Lua 写,这样最容易更改。 因此,我用 Lua 替换了 C 行

heur_dissector_add("eth.trailer", dissect_ixiatrailer, proto_ixiatrailer);

如下所示

eth_table = DissectorTable.get("eth.trailer")

但是我从 Wireshark 中得到了错误信息 "bad argument to get (DissectorTable_get no such dissector table)"

点赞
用户2755698
用户2755698

由于"eth.trailer"被注册为启发式列表(见packet-eth.c),我认为你可能需要遵循此处提供的示例:https://mika-s.github.io/wireshark/lua/dissector/2018/12/30/creating-port-independent-wireshark-dissectors-in-lua.html

基本上,我认为你需要像这样做:

your_protocol:register_heuristic("eth.trailer", heuristic_checker)

其中heuristic_checker是检查是否实际上是为你的解剖器服务的尾随者的函数。

2019-03-31 16:24:21