ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Chained CAN dissecector: Can not get reference for CAN disse

From: Sebastian Schildt <sebastian@xxxxxxxxxxxxxx>
Date: Mon, 21 Dec 2015 11:06:11 +0100
Hi,

I made a patch calling register_dissector for CAN (https://code.wireshark.org/review/#/c/12780/). Actually it was quite easy, 30% of the time was needed to make Wireshark build at all, 2% to make and test the patch and the rest to get this gerrit thingy running :D

If/when it gets applied all that is needed to get a reference to the CAN dissector is

original_can_dissector = Dissector.get("can")

However, for the benefit of people just googling it, if the patch is not accepted or you are using a stable version of Wireshark, this is a workaround for Lua:

local WTAP_ENCAP_SOCKETCAN = 125      --from wtap.h
wtap_tbl=DissectorTable.get("wtap_encap")
original_can_dissector = wtap_tbl:get_dissector(WTAP_ENCAP_SOCKETCAN)


Sebastian 

Am 15.12.2015 um 12:25 schrieb Pascal Quantin <pascal.quantin@xxxxxxxxx>:




Hi Sebastian,

The CAN dissector does not register itself by name (no call to register_dissector() function), so as you noticed you will not find it on the list.
The best way to move forward would be be to contribute to Wireshark so as to add the missing register_dissector function call. But it will be only added to the development tree (Wireshark 2.1) and not backported to stable releases as I do not think it will be considered as a fix, but an enhancement.

Regards,
Pascal.