Extending canfd Dissector in Lua
I'm curious to know if it's possible to extend the existing CANFD dissector in a Lua plugin and how that would work. I've asked ChatGPT as many different ways as I can but I think it's knowledge is exhausted in this area (It thought you could just clone() the proto and add fields).
Here's the socketcan plugin in C: https://github.com/wireshark/wireshar...
Chained Dissectors: https://wiki.wireshark.org/Lua/Dissec...
Other information: https://www.wireshark.org/lists/wires...
CANFD Dissector (in C though): https://github.com/wireshark/wireshar...
UAVCAN/CAN Dissector (in C though): https://raw.githubusercontent.com/Pet...
Merging in the other can sub dissectors? https://gitlab.com/wireshark/wireshar...
Is this possible in Lua? My feeling is that it should be possible, but my experiments aren't working.
This may be a similar question to https://osqa-ask.wireshark.org/questi...
There is a sample capture (vcan0-canfd-mixed-traffic.pcapng) attached to 12687: SocketCAN dissector does not support CAN FD
How about a post dissector that looks for
canfd
and ifcan.len
is greater than 0 it grabsdata.data
then processes it adding additional fields for a new protocol?By "extending" do you mean "dissecting CANFD headers that the existing CANFD dissector doesn't dissect", or do you mean "dissecting the CANFD data field as a particular protocol that runs atop CAN"? The latter isn't "extending the existing CAN/CANFD dissector", it's "adding support for a new protocol that runs on top of CAN/CANFD".
I need to decode both the CANFD header (subfields of the Node ID) and the data payload too. Thanks for your comments! I'll check out those links!