首页 > 解决方案 > Wireshark Lua 解析器插件表错误

问题描述

我在 ixia 时间戳拖车中的数据包之后有带有拖车数据的数据包。我正在尝试为 Wireshark 编写一个与 ixia-packet_trailer 插件完全相同的解析器。 https://raw.githubusercontent.com/boundary/wireshark/master/epan/dissectors/packet-ixiatrailer.c

但我想用 Lua 写,所以最容易改变。所以我更换了C线

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

通过以下在 Lua

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

但我从 Wireshark 得到错误“获取错误的参数(DissectorTable_get no such dissector table)”

标签: luawireshark

解决方案


由于"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检查预告片是否真的适合您的解剖器的功能在哪里。


推荐阅读