I'm building a LUA dissector. I want to run another dissector on the data before i continue examining the data but i am failing miserably. I have tried this with 1.10.5 and 1.11.2 and it fails in either case. This line of code is failing, (i am trying to mimic what the docs do, but obviously the docs are less than adequate):
Simple. Get the moldudp64 dissector and call it. It fails with this in the tree pane: bad argument #1 to 'get (Dissector_get: No such dissector) I KNOW the dissector exists, you can go to "Internals" -> "Supported Protocols" and there it is:
In fact if i right click a line and click on Decode As... i can select "MoldUDP64" and it works. By the way i have tried using different variations of the "MoldUDP64" string for the get call. I am flabbergasted at how hard this simple thing is turning out to be. I'm probably completely misunderstanding something and will feel like a dummy once the obvious is pointed out to me. Here is the complete lua dissector. Obviously it is not finished and broken in many places, but i can't even get past the first .get call in the dissector definition:
|
As an FYI, the following dissectors are registered such that Lua can call them (in Wireshark 1.11.3):
|
Finding a dissector by name only works if the dissector rgister by name which this one seems to not be doing. Well that makes sense. Is there a way to tell how the dissector is registered?
(13 Feb '14, 14:24)
shredluc
Non other than looking at the register routine in the source code of the dissector as far as I know.
(13 Feb '14, 14:28)
Anders ♦
So this is the registration in the source code:
I don't understand why i can't look it up by name. It doesn't make any sense to me.
(14 Feb '14, 06:10)
shredluc
The lookup failed because moldudp do not perform named dissector registration through new_register_dissector().
(14 Feb '14, 08:28)
RuAnShi
You can try following hack. Assign port 43210 in moldudp64 protocol preferences. In LUA script use:
(14 Feb '14, 08:39)
RuAnShi
|