Hello, I'm writing a Lua dissector for a custom simple protocol. My protocol basically wraps CAN frames over ethernet media. Thus, wireshark captures ethernet frames from the ethernet card, and I hooked to them my LUA dissector. I can successfully parse some fields (timestamp and other random flags) and I can extract CAN ID, CAN len, and CAN payload. Then I would like to chain to the standard wireshark CAN dissector, but I failed to do this. If I do: local can_dis = Dissector.get("can") Wireshark complains about not found dissector "bad argument #1 to 'get' (Dissector_get: No such dissector)". The "can" dissector should anyway be present in my Wireshark since I used it with socketcan devices successfully, and from menu "Internals->Supported protocol" it seems "can" is correctly listed. BTW version is 1.10.2 (SVN Rev 51934 from /trunk-1.10) (Linux) Any suggestion would be appreciated :) Thanks Andrea asked 29 Apr '14, 05:27 Andrea |
One Answer:
What Anders means is: in order for you to call a built-in Wireshark dissector such as the CAN one by using There are multiple ways dissectors can register themselves to handle dissecting frames/packets. For the CAN protocol, it registers its dissector in two tables by number: in the " So that means you can get the CAN dissector by getting that number's entry from the
or this is quicker:
As an aside... to see what dissectors are registered by name, you can use the Lua
If you do that, you’ll see there is no dissector named “ You can also see what the available
If you do that, you’ll see there is one named “ answered 30 Apr ‘14, 11:09 Hadriel You could submit a patch to the can dissector to register by name. (30 Apr ‘14, 14:30) Anders ♦ Thanks for your detailed explanation: I appreciate it a lot. And it worked! :) About submitting the patch, maybe I will do that also. Thanks Andrea (01 May ‘14, 23:15) Andrea |
For that to work I think the can dissector needs to register by name. Check if it does.
Is it possible to register a dissector from LUA script ? Can you please tell me how? Thank you