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

Adding new next level protocol for CAN

0

Hello, I am trying to create a new dissector for CAN. I copied and modified the J1939 dissector. I successfully compiled the new dissector and it is visible as an enabled protocol but it is not visible as a next level protocol under CAN. I see CANopen, DeviceNet and J1939 but not the new dissector. Where are the next level protocols defined for CAN?

Thanks Patrick

asked 12 Apr '15, 00:06

pmendiuk's gravatar image

pmendiuk
6112
accept rate: 0%


One Answer:

1

You need to edit packet-socketcan.c file and add your new protocol at the same places as you can find the J1939 one.

answered 12 Apr '15, 05:31

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

Thanks that was it.

(12 Apr '15, 08:21) pmendiuk

If an answer has solved your issue, please accept the answer for the benefit of other users by clicking the checkmark icon next to the answer. Please read the FAQ for more information.

(12 Apr '15, 09:24) grahamb ♦

Note that CAN subdissector registration has changed, now your subdissector should register with the "can.subdissector" table using dissector_add_for_decode_as.

Searching the dissectors for "can.subdissector" will show examples.

(30 Nov '15, 08:14) grahamb ♦