tcpdump mailing list archives

Re: [PATCH] SocketCAN support for libpcap - draft implementation


From: Guy Harris <guy () alum mit edu>
Date: Sun, 11 Oct 2009 10:35:59 -0700


On Oct 11, 2009, at 2:58 AM, Felix Obenhuber wrote:

On Fri, 2009-10-09 at 08:27 -0400, Alexander Dupuy wrote:

        ...

Summing up the discussion till now, I'd like to request a new DLT for
SocketCAN that is called

DLT_CAN_SOCKETCAN

OK, I've assigned 227 to DLT_CAN_SOCKETCAN, and checked into the main branch and pushed changes for that

Are there any conventions about the DLT naming?

Not really.

If you ever think that SocketCAN/libpcap will be used on big-endian
systems, you might want to "canonicalize" the layout in the big- endian
format above for a more comprehensible diagram, and because
little-endian systems have htonl/ntohl macros that are not no-ops,
making portable user-level coding simpler (if you standardize the
little-endian format, portable code has to use #ifdefs to determine
byte-order and then call a swap() function/macro on big-endian
systems).

Think that the usage of SocketCAN/libpcap on BE machines may be need
once. Think about a Linux and PPC based CAN data logger for example.

Linux USB leaves the pseudo-header in host byte order - and, in the code that reads the savefile, libpcap byte-swaps the fields, if the capture file was written on a machine with the opposite byte order, so that they appear to be in the byte order of the host reading the file.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: