Hi, I want to create an EtherCAT subdissector in Lua, to dissect the payload of the EtherCAT datagrams. Consulting the WireShark documentation didn't help me out, I know how to build a custom (chain/post-) dissector in Lua but not how to dissect data of an existing protocol. Post- or Chain dissectors allow me to dissect the data outside of the existing protocol, so my tree items are listed below the EtherCAT dataframes instead of expanding the ecat protocol. In other words, I can do this:
But I want to do something like this:
On WireShark EtherCAT protocol they recommend using the Any ideas or tips on how to access and dissect Best regards, Gerald asked 17 Sep '13, 19:31 Gerald edited 19 Sep '13, 23:39 |
2 Answers:
registering heuristic dissectors is not implemented for Lua, that's the reason you cannot do it. Unless somebody (you or a Wireshark developer) implements that feature, your only option is to write the sub-dissector in C.
You may try to use a post dissector. However I'm not sure if that will work with your problem. It depends on your requirements. Maybe you just try it.
Regards answered 20 Sep '13, 05:09 Kurt Knochner ♦ |
Heuristic dissector support for Lua scripts is now available in 1.11.3, in the latest nightly builds. This was added as part of enhancement bug 9815. answered 15 Mar '14, 09:03 Hadriel |
Thank you for your answer.
I hoped to avoid using C, but it seems Lua is not (yet) able to fulfill my requirements.
I tried using both a chained and a post dissector, but the results are the same. My dissection works perfectly, but only after the standard (in my case ecat) protocol/dissector. I cannot find a way to (sub-) dissect the 'ecat.data' field within the standard protocol/dissector.
Maybe I should give up on using Lua and try this in C.
Best regards, Gerald
if you need a real sub-dissector (your description sounds like that), then yes.
You could also try to add sub-dissector support for Lua to Wireshark ;-)