This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

calling a plugin dissector from another plugin dissector

0

hi all, I have created two plugin dissectors for two different packets of a same protocol. But i cant use the wireshark to dissect both of the packets at the same time, i need to run the wireshark separately for each of the packet using the plugins for those packets. There is no issue in dissecting the packets, But now i want to run the wireshark in such a way that it can use both the plugins at the same time and call the plugin according to the packet.

So in order to do this thing i used "call_dissector(plugin_handle, tvb, pinfo, tree);" in one of my plugin which calls second plugin if the packet is for second plugin. And to detect the type of packet i have the msgid which i can use successfully to know that which packet is this,

Now the problem is that when i trying to dissect the packet in wireshark it giving me the following error, "ERROR:packet.c:2281:call_dissector_only: assertion failed: (handle != NULL)"

i have used find_dissector("dissector_name"); to get the refernce of the plugin dissector..

please help me on this and tell me how i can do this ..

Thanks

asked 12 Aug '15, 05:36

zombimind's gravatar image

zombimind
6337
accept rate: 0%

edited 12 Aug '15, 05:40

anybody please help on this, i am not finding any way to do this, suggest me something

many thanks in advance

(13 Aug '15, 00:10) zombimind
1

I don't see why you should have two dissectors for the same protocol, that sounds wierd but:

Did you register the dissector name in the register routine with new_register_dissector(); or register_dissector(); and have the find_dissector() call in the handoff routine?

(13 Aug '15, 01:05) Anders ♦

thanks for replying anders, actually the single dissector which i was having before for my protocol can dissect a particular packet, but now i have another packet which comes under the same protocol and needed to be dissect. so i created a plugin dissector for the 2nd packet so whenever the 2nd packet is there, this plugin dissector can be used by the previously existed dissector.

And yeah i didnt register my plugin dissector as you said with either "register_dissector" nor with "new_register_dissector", i will try this way,

thanks

(13 Aug '15, 01:31) zombimind

One Answer:

1

You're passing in a NULL handle as the first parameter, it should be the handle of the dissector you wish to call. I suspect the result of find_dissector() is NULL.

It's possible that the second dissector hasn't registered when you make the find_dissector call.

answered 13 Aug '15, 01:00

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

yeah thats true, the result of find_dissector() is NULL and the reason i think is that, it is not registered,

thanks for your reply

(13 Aug '15, 01:33) zombimind