python-can icon indicating copy to clipboard operation
python-can copied to clipboard

support pcapng file format

Open dsseng opened this issue 8 months ago • 4 comments

This PR adds support for Pcapng files to the I/O module

Related to #1403, pcap should be rather simple to implement based on these changes.

  • Factor out common SocketCAN ser/des parts
  • Add PcapngWriter
  • Add PcapngReader

TODO:

  • [x] tests
  • [x] gzip, ~~lz4~~, zst, perhaps other compression types readers know about

dsseng avatar Apr 08 '25 09:04 dsseng

Keep the changes minimal. Move the socketcan files back to where they belong, remove zstd and all other unrelated changes. Add test data and documentation (see file_io.rst)

zariiii9003 avatar May 30 '25 10:05 zariiii9003

Keep the changes minimal. Move the socketcan files back to where they belong, remove zstd and all other unrelated changes. Add test data and documentation (see file_io.rst)

I abstracted out some common SocketCAN files for the purpose of not duplicating the code. pcapng expects packets to be serialized as SocketCAN packets, so this code has to be shared. Let me know if there is a better place or way to refactor this.

dsseng avatar May 30 '25 10:05 dsseng

you could just import from socketcan without moving the files

zariiii9003 avatar May 30 '25 11:05 zariiii9003

you could just import from socketcan without moving the files

Is this a correct pattern for an IO module to import an interface module? That felt a bit counter-logical

dsseng avatar May 30 '25 12:05 dsseng