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] How to add a wtap encapsulation?

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 13 Oct 2010 10:45:12 -0700
On Oct 12, 2010, at 2:04 PM, Yo Mismo wrote:

> I want to add a wtap encapsulation for a new link layer protocol.

A Wiretap encapsulation is useful only if you have a capture file format that uses it.

What type of capture file is this?

If it's pcap or pcap-ng format, see the replies from Christopher Maynard and Jeff Morris - you'd need a DLT_ value (well, technically, a LINKTYPE_ value, but for all new values, they're the same) for use in the pcap file header or the pcap-ng Interface Description Block, and you could either use one of the "user-defined" values, in which case you'd also use the corresponding "user-defined" WTAP_ENCAP_ value, or you could get a new DLT_ value from tcpdump-workers@xxxxxxxxxxx, and modify wiretap/pcap-common.c to map that DLT_ value to your new WTAP_ENCAP_ value.

If it's some other format, you'd have to modify the Wiretap file for that file format to map a capture using that link-layer protocol to your new WTAP_ENCAP_ value.