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] Input plugin for PEAK Systems CAN interfaces

From: Miklos Marton <martonmiklosqdev@xxxxxxxxx>
Date: Sat, 27 Mar 2021 23:04:36 +0100

Hi Miklos,

About 2 years ago I created a plugin to capture CAN packets in windows from a device called AnaGate CAN. This AnaGate CAN unit uses a tcp/ip connection to communicate with another computer and of course its own protocol. You can probably find some emails from me about this topic here in the mailing list.

It also took a fairly long time to find out how the extcap plugins work (no descent/commented examples present) and rudimentary error handling is missing in the wireshark extcap interface towards the wireshark framework. I still need to address that in the mailing list. It was a fairly long time ago so it could have changed in the meanwhile.

This extcap plugin I made was written with a lot of comments and uses (as far as I know) the best practices how to use the interface, the purpose was to give it back to the community as a well documented example for other starters so they don't spoil there precious time. This plugin also has a user interface where you can configure parameters, so this can be a good starting point for you.

A had  to reverse engineer the right calls to use, because none of the existing plugins do things a similar way (different ordering, missing things in some existing extcap plugins etc.) and it was totally unclear to me which calls are best to be used. Also how to integrate the sources into the build system were not (completely) documented.

The plugin does work, but error handling is missing because of lacking support in the wireshark framework and if something goes wrong you need to kill the sub process or wait for a timeout. I cannot fix that in the plugin itself. Another thing I need to check/implement if it can be made more efficient by using poll()/select() in the loop code.

Also I need to test in under Linux, the code is aware of it but never tested.

I need to dig-up the code and port it to the latest version, the previous version I used was wireshark 2.9.1.

The PCAN-USB does it the a serial device class on USB or some proprietary protocol?

regards,

Henri


Hello Henri,

Thank you very much for your anwer, I would deeply appericiate if you could share me that code (in any shape) with me.

The PCAN-USB does it the a serial device class on USB or some proprietary protocol?
At USB level it uses a proprietary protocol, however PEAK supply a DLL for the Windows platform which operates at the CAN network level.

--
Best regards,
Miklos Marton