Linux – tcpdump: decode packet starting at non-zero offset

linuxtcpdump

I'm debugging a Linux embedded platform which has an interface where regular ethernet frames have an additional 82-octet platform header tacked on the front. I am able to sniff from this interface using tcpdump, but tcpdump is not able to usefully decode because the ethernet headers are not starting where it expects them to. Thus all I can see is a hex dump with the -x option, but for convenience I would like tcpdump to decode them. I am not interested in the contents of 82-octet header, but would like to see a decode of the subsequent encapsulated ethernet frame.

Is there a way I can tell tcpdump to start decoding the ethernet header starting 82 octets offset from the start of the captured packet, rather than the usual 0 octets?

Best Answer

Not other than modifying tcpdump source.

If you want to do that, I'd suggest either using one of the DLT_USERn DLT_/LINKTYPE_ values for that device, or getting one officially assigned by tcpdump.org, hacking libpcap to return that DLT_ value for those devices, and hacking tcpdump to decode that by skipping (or decoding, if useful) the 82-octet platform header.