Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cheat sheet

A Protocol Description has ten top-level keys. They are accepted in any order and listed here in the order the book and the examples use.

KeyRequiredMeaning
nameyesFilter name of the protocol: a lowercase letter, then lowercase letters, digits, _ or -, 2 to 32 characters.
titlenoFull name shown at the root of the protocol tree. Defaults to the uppercase name.
registrationnoPorts claimed by default, and Decode As (Registration). Leaving it out means Decode As only.
framingnoHow messages are found in a TCP stream: a constant header size and a length Expression (Framing).
endiannoDefault byte order, big (the default) or little.
infonoTemplate of the Info column (Info column). Without it, the column names the case of the outermost switch Field.
fieldsyesThe top-level layout: a non-empty list of Fields.
typesnoNamed Types, reusable groups of Fields.
enumsnoNamed tables of labels for integer values.
allownoNames of warnings to silence.

The smallest description is name: plus fields::

name: demo
fields:
  - { name: id, type: uint8 }

With a title and a silenced warning:

name: demo
title: Demo Protocol
fields:
  - { name: id, type: uint8 }
allow: [unknown-allow]

There is no format-version key and no top-level description: key: YAML comments document a file. (A Field’s own description: is its help text in Wireshark.)