Chapter 9. Packet Dissection
Prev | Part II. Wireshark Development | Next

## Chapter 9. Packet Dissection

## 9.1. How packet dissection works

Each dissector decodes its part of the protocol and then hands off decoding to subsequent dissectors for an encapsulated protocol.

Every dissection starts with the Frame dissector which dissects the details of the capture file itself (e.g. timestamps). From there it passes the data on to the lowest-level data dissector, e.g. the Ethernet dissector for the Ethernet header. The payload is then passed on to the next dissector (e.g. IP) and so on. At each stage, details of the packet are decoded and displayed.

Dissectors can either be built-in to Wireshark or written as a self-registering plugin (a shared library or DLL). There is little difference in having your dissector as either a plugin or built-in. You have limited function access through the ABI exposed by functions declared as WS_DLL_PUBLIC.

The big benefit of writing a dissector as a plugin is that rebuilding a plugin is much faster than rebuilding wireshark after editing a built-in dissector. As such, starting with a plugin often makes initial development quicker, while the finished code may make more sense as a built-in dissector.

| Read README.dissector
The file doc/README.dissector contains detailed information about writing a dissector. In many cases it is more up to date than this document.

Prev | Up | Next
8.2. Adding Capture Interfaces And Log Sources Using Extcap | Home | 9.2. Adding a basic dissector