Diagnostics index
One entry per Diagnostic, in alphabetical order, under the name Wirdigen prints in brackets
(error[unknown-key]) and links to at the end of each message. See Diagnostics for how errors,
warnings and allow: work.
Errors cannot be silenced: fix the description. Warnings can be fixed, or silenced by adding
their name to the top-level allow: list.
chained-comparison
Severity: error
Two comparisons follow each other without parentheses, as in a < b < c. Comparisons do not
chain: in C, 1 < 3 < 2 compares the 1 of 1 < 3 with 2, which is rarely what was meant. The
error points at the second comparison.
name: demo
fields: [ {name: data, type: bytes, size: "1 < 2 < 3"} ]
Fix: join the two comparisons with &&, as in a < b && b < c, or add parentheses to
compare the 1 or 0 of the first: (a < b) < c.
conditional-reference
Severity: error
An Expression reads a Field that is read only under an if: or
in a switch case, or a Field inside one, from
outside that if: or case. When the condition is false, or another case matched, the Field has
no value. Two if: with the same condition still count as different: conditions are never
compared.
name: demo
fields:
- { name: flags, type: uint8 }
- { name: len, type: uint8, if: "flags & 1" }
- { name: data, type: bytes, size: len, if: "flags & 1" }
Fix: put the Field and everything that reads it in one inline structure carrying the if::
name: demo
fields:
- { name: flags, type: uint8 }
- name: ext
if: "flags & 1"
fields:
- { name: len, type: uint8 }
- { name: data, type: bytes, size: len }
conflicting-field-kind
Severity: error
A Field has more than one of type:, fields: and switch:, so it has no single meaning.
A note points at the first of them.
name: demo
fields:
- { name: id, type: uint8, fields: [ {name: low, type: uint8} ] }
Fix: keep one. To group Fields under a name, use fields: alone.
conflicting-filter-name
Severity: error
Two Fields reach one filter name with ProtoFields that differ in type, display:, value
labels, label: or description:. The cases of a switch
add no segment to filter names, so a Field of one case and a Field of the same name in another
reach the same name, and Wireshark can register only one ProtoField under it. Wirdigen never
renames a Field on its own: filter names are what the description spells.
name: demo
fields:
- { name: kind, type: uint8 }
- name: body
switch: kind
cases:
1: [ { name: id, type: uint32 } ]
2: [ { name: id, type: uint16, label: Short id } ]
Fix: rename one of the Fields, or make them match so they share the ProtoField.
conflicting-length
Severity: error
A Field has more than one of size:, prefix: and terminator:, so its length has no single
meaning. A note points at the first of them.
name: demo
fields: [ {name: user, type: string, size: 8, terminator: 0} ]
Fix: keep the one key that says where the value ends.
conflicting-mappings
Severity: error
A Field has both values: and unit:. Wireshark shows either a label in place of the value or
a unit after it, never both.
name: demo
fields:
- name: length
type: uint16
values: { 0: Empty }
unit: [byte, bytes]
Fix: keep one of them. A label for a special value can go in the Field’s description:.
conflicting-repeat
Severity: error
A Field has both count: and repeat:, so the number of elements of the
array has no single meaning. A note points at count:.
name: demo
fields:
- name: items
count: 4
repeat: to_end
fields: [ {name: id, type: uint8} ]
Fix: keep count: when the number of elements is known before the array, or
repeat: to_end when the elements fill the rest of the message.
duplicate-field-name
Severity: error
Two Fields of the same structure share a name, so their filter name and any reference to them would be ambiguous. A note points at the first one.
name: demo
fields:
- { name: id, type: uint8 }
- { name: id, type: uint16 }
Fix: rename one of them.
duplicate-key
Severity: error
A key appears twice in the same mapping, so the description has no single meaning. A note points at the first occurrence.
name: demo
name: other
fields: [ {name: a, type: uint8} ]
Fix: keep one of the two.
empty-fields
Severity: error
The top-level fields: list is empty: a protocol must declare at least one Field. The same
holds for the fields: of an inline structure.
name: demo
fields: []
Fix: declare the Fields of the payload.
expression-syntax
Severity: error
An Expression cannot be read: a missing or extra value, operator or
parenthesis, a character Expressions do not use (such as = or a quote), a malformed or
oversized integer literal, a built-in other than _offset and _remaining, or a Field Path
with an empty segment. The error points at the offending token; in an escaped or multi-line
YAML string, at the whole value. Only the first error of each Expression is reported.
name: demo
fields: [ {name: data, type: bytes, size: "(4 + 2"} ]
Fix: correct the Expression, here by closing the parenthesis: "(4 + 2)".
expression-too-deep
Severity: error
An Expression nests more than 64 levels deep. Each
value, parenthesis and unary operator is a level, and so is each binary operator over its
operands, so a flat chain such as 1+1+…+1 of 65 operands is 65 deep. Lua cannot load the
Dissector such an Expression would make. The error points at the token that reaches depth 65.
name: demo
fields:
- name: data
type: bytes
size: "1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1"
Fix: make the Expression shallower. Group a long chain with parentheses, as
(1+1+…) + (1+1+…), which is about half as deep, and remove parentheses that change nothing.
field-too-deep
Severity: error
A Field is more than 64 deep: more than 64 Fields enclose it, counted through every
Type it is reached by. An inline structure, an array, a switch
Field, a bitfield (for its sub-Fields) and a Field of a Type each add one level; a switch case
adds none. That makes 64 the most names between the protocol’s and the Field’s own in its
filter name. The error points at each Field that is the
first past 64 on its path, once however many uses of a Type take it there, and names a filter
name that reaches it; the Fields under it are not reported.
name: demo
fields: [ { name: t, type: T1 } ]
types:
T1: { fields: [ { name: next, type: T2 } ] }
T2: { fields: [ { name: next, type: T3 } ] }
T3: { fields: [ { name: next, type: T4 } ] }
T4: { fields: [ { name: next, type: T5 } ] }
T5: { fields: [ { name: next, type: T6 } ] }
T6: { fields: [ { name: next, type: T7 } ] }
T7: { fields: [ { name: next, type: T8 } ] }
T8: { fields: [ { name: next, type: T9 } ] }
T9: { fields: [ { name: next, type: T10 } ] }
T10: { fields: [ { name: next, type: T11 } ] }
T11: { fields: [ { name: next, type: T12 } ] }
T12: { fields: [ { name: next, type: T13 } ] }
T13: { fields: [ { name: next, type: T14 } ] }
T14: { fields: [ { name: next, type: T15 } ] }
T15: { fields: [ { name: next, type: T16 } ] }
T16: { fields: [ { name: next, type: T17 } ] }
T17: { fields: [ { name: next, type: T18 } ] }
T18: { fields: [ { name: next, type: T19 } ] }
T19: { fields: [ { name: next, type: T20 } ] }
T20: { fields: [ { name: next, type: T21 } ] }
T21: { fields: [ { name: next, type: T22 } ] }
T22: { fields: [ { name: next, type: T23 } ] }
T23: { fields: [ { name: next, type: T24 } ] }
T24: { fields: [ { name: next, type: T25 } ] }
T25: { fields: [ { name: next, type: T26 } ] }
T26: { fields: [ { name: next, type: T27 } ] }
T27: { fields: [ { name: next, type: T28 } ] }
T28: { fields: [ { name: next, type: T29 } ] }
T29: { fields: [ { name: next, type: T30 } ] }
T30: { fields: [ { name: next, type: T31 } ] }
T31: { fields: [ { name: next, type: T32 } ] }
T32: { fields: [ { name: next, type: T33 } ] }
T33: { fields: [ { name: next, type: T34 } ] }
T34: { fields: [ { name: next, type: T35 } ] }
T35: { fields: [ { name: next, type: T36 } ] }
T36: { fields: [ { name: next, type: T37 } ] }
T37: { fields: [ { name: next, type: T38 } ] }
T38: { fields: [ { name: next, type: T39 } ] }
T39: { fields: [ { name: next, type: T40 } ] }
T40: { fields: [ { name: next, type: T41 } ] }
T41: { fields: [ { name: next, type: T42 } ] }
T42: { fields: [ { name: next, type: T43 } ] }
T43: { fields: [ { name: next, type: T44 } ] }
T44: { fields: [ { name: next, type: T45 } ] }
T45: { fields: [ { name: next, type: T46 } ] }
T46: { fields: [ { name: next, type: T47 } ] }
T47: { fields: [ { name: next, type: T48 } ] }
T48: { fields: [ { name: next, type: T49 } ] }
T49: { fields: [ { name: next, type: T50 } ] }
T50: { fields: [ { name: next, type: T51 } ] }
T51: { fields: [ { name: next, type: T52 } ] }
T52: { fields: [ { name: next, type: T53 } ] }
T53: { fields: [ { name: next, type: T54 } ] }
T54: { fields: [ { name: next, type: T55 } ] }
T55: { fields: [ { name: next, type: T56 } ] }
T56: { fields: [ { name: next, type: T57 } ] }
T57: { fields: [ { name: next, type: T58 } ] }
T58: { fields: [ { name: next, type: T59 } ] }
T59: { fields: [ { name: next, type: T60 } ] }
T60: { fields: [ { name: next, type: T61 } ] }
T61: { fields: [ { name: next, type: T62 } ] }
T62: { fields: [ { name: next, type: T63 } ] }
T63: { fields: [ { name: next, type: T64 } ] }
T64: { fields: [ { name: next, type: T65 } ] }
T65: { fields: [ { name: x, type: uint8 } ] }
Fix: flatten the layout: move the Field, or a Field enclosing it, closer to the top level, for example by reading records that each hold the next as an array of one Type.
forward-reference
Severity: error
An Expression reads a Field that is read only after it, or reads its own Field. A Dissector reads a packet in order, so the value does not exist yet. A note points at the later Field.
name: demo
fields:
- { name: data, type: bytes, size: length }
- { name: length, type: uint8 }
Fix: move the Field that is read before the Field that reads it.
incompatible-display
Severity: error
A Field’s display: or encoding: is not one its type takes, or the Field has a value-mapping
key its type does not take. Unsigned integers take dec, hex, oct, dec_hex and
hex_dec; signed integers are shown only as dec; bytes take plain, dot, dash,
colon and space; abs_time takes local, utc and doy_utc; string, rel_time,
bool, the floats and the address types take no display: at all. Only string, abs_time
and rel_time take encoding:, each its own values: ntp is an abs_time encoding only.
Only integers take values:, only bool takes true: and false:, only integers and floats
take unit:, and only bytes take dissector:. An inline structure takes none of these keys:
they belong on the Fields inside it. A bitfield sub-Field takes the displays of an unsigned integer, and true: and
false: only when it is boolean: 1 bit wide, without values:, unit: or display:.
name: demo
fields: [ {name: offset, type: int16, display: hex} ]
Fix: pick a value from the table in Fields, or remove
display: to use the type’s default. A signed value shown in hex needs an unsigned type. The
encodings are listed in Strings and bytes and
Timestamps, and the value mappings in
Value mappings.
invalid-array
Severity: error
A Field of a built-in type has count: or repeat:. Only an inline structure or a Field of a
Type repeats, so that each element is a subtree item of its own.
name: demo
fields:
- { name: ids, type: uint16, count: 4 }
Fix: put the value in an inline structure that repeats:
name: demo
fields:
- name: ids
count: 4
fields: [ {name: id, type: uint16} ]
See Arrays.
invalid-bit-width
Severity: error
A sub-Field or a { padding: n } entry of bits: is less than 1 bit wide.
name: demo
fields:
- name: flags
type: uint8
bits:
- { name: version, width: 0 }
- { name: rest, width: 8 }
Fix: give the width in bits, at least 1, or remove an entry that takes no bits.
invalid-bits
Severity: error
A Field with bits: is not a fixed-size unsigned integer. Only uint8 to uint64 Fields can
be split into sub-Fields: not a signed integer, bytes, an inline structure or a Field of a
Type.
name: demo
fields:
- name: flags
type: int8
bits: [ { name: low, width: 8 } ]
Fix: give the bitfield an unsigned integer type as wide as its sub-Fields, here uint8.
See Bitfields.
invalid-count
Severity: error
A constant count: is a negative number of elements, or an Expression that has no value: it
divides by zero, or shifts by a count outside 0 to 63. The error points at the dividing or
shifting operator.
name: demo
fields:
- name: items
count: -1
fields: [ {name: id, type: uint8} ]
Fix: write the number of elements, zero or more.
invalid-description
Severity: error
A Field’s description: spans several lines or is not a string. Wireshark shows it on one
line, in the status bar and the field reference.
name: demo
fields:
- { name: id, type: uint8, description: "Identifies\nthe request" }
Fix: write the description on one line, or quote a value YAML reads as a number or a bool.
invalid-dissector
Severity: error
A Field’s dissector: is not the name of a Dissector: it is
empty, has a space in it, or is not a string. A dissector name is one word, as Wireshark
registers it. Whether Wireshark has a dissector by that name is only known when a packet is
read, where an unknown one is a warning in the tree.
name: demo
fields:
- { name: payload, type: bytes, size: 8, dissector: "" }
Fix: write the name Wireshark registers the dissector under, such as json or data.
tshark -G dissectors lists them.
invalid-endian
Severity: error
An endian: value, at the top level, on a Type or on a Field, is not a byte order. Byte order
is big or little, never encoded in a type name.
name: demo
endian: network
fields: [ {name: id, type: uint16} ]
Fix: write big or little, or leave endian: out for big-endian.
It is also reported for endian: on a Field of a Type: a Type is read in its own byte order,
whichever Field uses it.
name: demo
fields:
- { name: hdr, type: Header, endian: little }
types:
Header:
fields: [ {name: length, type: uint16} ]
Fix: set endian: on the Type, or on the Fields inside it.
invalid-field-name
Severity: error
A Field’s name: is not a lowercase letter followed by lowercase letters, digits or _.
Names appear bare in filters and Expressions, so - and . are refused, and a leading _ is
kept for Wirdigen’s built-ins.
name: demo
fields: [ {name: msgType, type: uint8} ]
Fix: rename the Field, here msg_type. Its tree label is derived from the name
(“Msg type”).
invalid-framing
Severity: error
framing: cannot find a Message’s length from its header alone: its
header is below 1, a constant length is shorter than the header, or the length Expression
reads _offset, _remaining, a Field inside a structure, or a top-level Field that does not lie
entirely within the first header bytes (because it ends after them, is read under if:, or
comes after a Field whose size is known only once it is read).
name: demo
framing:
header: 2
length: "len + 4"
fields:
- { name: kind, type: uint16 }
- { name: len, type: uint16 }
Fix: make header cover every Field length reads, and give those Fields a fixed place at
the start of the Message:
name: demo
framing:
header: 4
length: "len + 4"
fields:
- { name: kind, type: uint16 }
- { name: len, type: uint16 }
- { name: body, type: bytes, size: len }
invalid-info
Severity: error
The top-level info: template cannot be read: it is not a string, it is on
several lines, a { or } pairs with nothing, or braces hold something other than a bare Field Path, such as
an Expression or a format specifier. Or a Field Path names an inline structure, a Field of a Type
or an array, which have no value of their own to show.
name: demo
info: "id={id:04x}"
fields:
- { name: id, type: uint16 }
Fix: write each Field Path in braces, {id}, and give the Field the
display: it should show with. Write {{ and }} for literal
braces, and reference a Field inside a structure rather than the structure.
invalid-label
Severity: error
A label is empty, blank, spans several lines or is not a string: a Field’s label:, a label
in a values table, or the true: or false: label of a bool. A label is one line of text
in the protocol tree.
name: demo
fields: [ {name: id, type: uint8, label: ""} ]
Fix: write a single-line label, or leave label: out to derive it from the name (“Id”).
invalid-padding
Severity: error
A constant padding: is a negative number of bytes, or an
Expression that has no value: it divides by zero, or shifts by a count outside 0 to 63. The
error points at the dividing or shifting operator.
name: demo
fields:
- { name: kind, type: uint8 }
- { padding: -2 }
Fix: write the number of bytes to skip, zero or more.
invalid-port
Severity: error
A port of registration: ports: is not a port number: port
0, a number above 65535, or a range reaching one of them.
name: demo
registration:
ports:
udp: [0, "65000-70000"]
fields:
- { name: id, type: uint8 }
Fix: write ports from 1 to 65535, here udp: ["65000-65535"].
invalid-prefix
Severity: error
A prefix: does not name an unsigned integer type. The prefix is the count of bytes read just
before the value, so it is one of uint8 to uint64.
name: demo
fields: [ {name: user, type: string, prefix: int16} ]
Fix: name the unsigned integer type of the count, here uint16.
invalid-protocol-name
Severity: error
name: is not a valid filter name. A name is a lowercase letter, then at least one lowercase
letter, digit, _ or -, 2 to 32 characters in all: Wireshark refuses one-character filter
names. Uppercase is never lowercased silently, and a . is refused because it would blur
where the Field Path starts in filters such as demo.id.
name: Demo
fields: [ {name: a, type: uint8} ]
Fix: choose a name that follows the rules, here demo. The uppercase form is derived for
the Protocol column, and title: sets the full name.
invalid-protocol-title
Severity: error
title: is empty, blank or spans several lines. A title is shown on one line at the root of
the protocol tree.
name: demo
title: ""
fields: [ {name: a, type: uint8} ]
Fix: write a single-line title, or leave title: out to use the uppercase name:.
invalid-repeat
Severity: error
A repeat: is not to_end, the only way to repeat other than count: in this version of
the format.
name: demo
fields:
- name: items
repeat: forever
fields: [ {name: id, type: uint8} ]
Fix: write repeat: to_end to read elements until the message ends, or give the number of
elements with count:. See Arrays.
invalid-size
Severity: error
A constant size: is a negative number of bytes, or an Expression that has no value: it
divides by zero, or shifts by a count outside 0 to 63. The error points at the dividing or
shifting operator.
name: demo
fields: [ {name: data, type: bytes, size: -4} ]
name: demo
fields: [ {name: data, type: bytes, size: "16 / (4 - 4)"} ]
Fix: write the length in bytes, zero or more.
invalid-terminator
Severity: error
A terminator: is not a byte from 0 to 255, or it is not 0 on a utf16 or ucs2 string,
which always ends at a 2-byte zero.
name: demo
fields: [ {name: user, type: string, encoding: utf16, terminator: 10} ]
Fix: write the byte value of the terminator, such as 0 or 10 for a line feed. A
utf16 or ucs2 string takes only terminator: 0.
invalid-type-name
Severity: error
The name of a Type under types: or of an Enum under enums: is not an uppercase letter
followed by letters or digits. Names of Types and Enums start with an uppercase letter so they
can never be mistaken for a Field or a built-in type, which are lowercase.
name: demo
fields:
- { name: kind, type: uint8, values: msg_type }
enums:
msg_type: { 1: Request }
Fix: rename the Enum and every values: naming it, here MsgType. For a Type, rename it
and every type: naming it.
invalid-unit
Severity: error
A form of a Field’s unit: is empty, blank, spans several lines or is not a string. The tree
prints the unit on the value’s line, right after it.
name: demo
fields:
- { name: length, type: uint16, unit: [byte, ""] }
Fix: write each form on one line (unit: [byte, bytes]), or remove unit:. Quote a unit
YAML reads as a number or a bool.
leading-zero-literal
Severity: error
An integer literal in an Expression starts with 0 and has more digits, such as 010. In C
that would be octal; Expressions have no octal, so the number is ambiguous.
name: demo
fields: [ {name: data, type: bytes, size: "4 * 010"} ]
Fix: write the decimal number without the zeros (10), or use 0x or 0b for hexadecimal
or binary (0x10, 0b10).
merge-key
Severity: error
The file uses a YAML merge key (<<:). Merge keys are not part of the YAML subset Wirdigen
reads, because a description reuses Fields through Types.
name: demo
fields: [ {name: a, type: uint8} ]
<<: {}
Fix: write the keys out, or move repeated Fields into a Type.
mismatched-bit-widths
Severity: error
The widths of a bitfield’s sub-Fields and padding do not add up to the bits of its container:
8 for a uint8, 16 for a uint16, and so on. Every bit must be named or padded, so that the
masks Wirdigen computes leave no bit ambiguous.
name: demo
fields:
- name: flags
type: uint8
bits:
- { name: version, width: 3 }
- { name: ext, width: 1 }
Fix: cover the bits nothing names with a { padding: n } entry, here { padding: 4 }
last, or correct a width.
missing-field-kind
Severity: error
A Field says nothing about what it is. A Field needs exactly one of type: (a built-in type
or a Type), fields: (an inline structure) or switch: (a choice of layout).
name: demo
fields: [ {name: id} ]
Fix: add the Field’s type:, here {name: id, type: uint8}.
missing-key
Severity: error
A required key is missing: every description needs name: and fields:. An empty file is
missing both.
name: demo
Fix: add the key. When the key is only misspelt, Wirdigen reports the
unknown-key instead, with the spelling it expected.
missing-length
Severity: error
A string or bytes Field does not say how long it is. Its length comes from exactly one of
size:, prefix: or terminator:.
name: demo
fields: [ {name: user, type: string} ]
Fix: add the length key that matches the wire: size: 16 for a constant length,
prefix: uint8 when a count comes just before the value, or terminator: 0 for a
NUL-terminated string. See Sizes.
multiple-documents
Severity: error
A Protocol Description is a single YAML document, but the file holds several, separated by
---.
name: a
fields: [ {name: a, type: uint8} ]
---
name: b
Fix: put each Protocol Description in its own file.
non-numeric-reference
Severity: error
An Expression reads a Field that has no number: a string, bytes, float, address, timestamp,
inline structure or Field of a Type. Only integer and bool Fields can be read.
name: demo
fields:
- { name: tag, type: string, size: 4 }
- { name: data, type: bytes, size: tag }
Fix: read an integer Field, or go into the structure for one: header.length rather than
header.
overlapping-cases
Severity: error
Two cases of a switch match a same value: a value inside
a range, two ranges that share values, or one value spelt twice. A value picks one layout, so
the description has no single meaning. The subject is a signed 64-bit value, so -1 and
18446744073709551615 are the same case.
name: demo
fields:
- { name: kind, type: uint8 }
- name: body
switch: kind
cases:
"1-5": [ { name: small, type: uint8 } ]
3: [ { name: three, type: uint16 } ]
Fix: give each value to a single case, here by splitting the range into "1-2" and
"4-5".
overlapping-ports
Severity: error
A port is declared twice on one transport of
registration: ports:: listed twice, spelt twice (5000
and 0x1388), or inside a range of the same list. The same port on UDP and on TCP is fine.
name: demo
registration:
ports:
udp: ["5000-5010", 5005]
fields:
- { name: id, type: uint8 }
Fix: declare each port once, here by removing 5005.
overlapping-values
Severity: error
Two keys of one values table match a same value: a value inside a range, two ranges that
share values, or one value spelt twice (16 and 0x10). The Dissector could show only one of
the labels.
name: demo
fields:
- name: kind
type: uint8
values:
"0-9": Low
5: Five
Fix: give each value one label, here by splitting the range into "0-4" and "6-9".
protocol-name-taken
Severity: warning
Wireshark already has a protocol with one of the names the description gives its own: the
filter name name:, the short name (name: in uppercase) or the full name (title:, or the
short name without one). Wireshark refuses to load a Dissector whose protocol names are taken.
name: dns
fields:
- { name: id, type: uint16 }
The built-in protocols are those of the latest stable Wireshark when this Wirdigen was released. They vary with the Wireshark version and build, which is why this is a warning.
Fix: pick a name and a title of your own, such as name: mydns. When the Wireshark you
target lacks the built-in protocol, allow the warning:
name: dns
fields:
- { name: id, type: uint16 }
allow: [protocol-name-taken]
recursive-type
Severity: error
A Type contains itself, directly or through other Types, so reading it would never end. Each cycle is reported once, at the use the first-declared Type of the cycle makes of the next one, and a note spells the whole cycle.
name: demo
fields:
- { name: root, type: Node }
types:
Node:
fields:
- { name: id, type: uint8 }
- { name: child, type: Node }
Fix: break the cycle, for example by giving the inner Field a Type of its own that does not use the outer one.
tcp-without-framing
Severity: warning
registration: ports: declares TCP ports, but the
description has no framing:. Each TCP segment is then dissected as one message, which goes
wrong when a message is split across segments or a segment holds several messages.
name: demo
registration:
ports:
tcp: [5000]
fields:
- { name: id, type: uint8 }
Fix: add framing: to say where each message ends. When every message travels in a
segment of its own, allow the warning:
name: demo
registration:
ports:
tcp: [5000]
fields:
- { name: id, type: uint8 }
allow: [tcp-without-framing]
unexpected-length
Severity: error
A Field of a fixed-size type has a length key (size:, prefix: or terminator:). Its size
already follows from its type, or for a timestamp (abs_time, rel_time) from its
encoding:. An inline structure takes no length key either: it is as long as its Fields.
name: demo
fields: [ {name: id, type: uint32, size: 4} ]
Fix: remove the length key.
unknown-allow
Severity: warning
An allow: entry names no warning: either no Diagnostic has that name, or it names an error,
which cannot be silenced. It is a warning rather than an error so that a description allowing a
warning added by a newer Wirdigen still works with an older one.
name: demo
fields: [ {name: a, type: uint8} ]
allow: [bogus]
Fix: correct the name or remove the entry. To keep an entry meant for a newer Wirdigen, allow this warning too:
name: demo
fields: [ {name: a, type: uint8} ]
allow: [unknown-allow, bogus]
unknown-enum
Severity: error
A Field’s values: names an Enum that the top-level enums: does not declare.
name: demo
fields:
- { name: kind, type: uint8, values: MsgTyp }
enums:
MsgType: { 1: Request }
Fix: correct the name, here MsgType, or declare the Enum under enums:. To label the
values of this Field only, write the table inline: values: { 1: Request }.
unknown-field
Severity: error
A name in an Expression matches no Field read before
it: a misspelling, a path into a structure that has no such Field or into a Field that is not a
structure, a path into the structure still being read, or a path into an
array, whose Fields only its elements can read. Inside a Type, a name
the Type does not declare is looked up where the Type is used, and the error points at that
use. A Field Path of the info: template is checked the same way, from the
top-level Fields.
name: demo
fields:
- { name: length, type: uint8 }
- { name: data, type: bytes, size: "lengths * 2" }
name: demo
fields:
- { name: record, type: Record }
types:
Record:
fields: [ {name: data, type: bytes, size: count} ]
Fix: correct the name, or declare the Field it reads before the Field that reads it: here
length, and a count Field before record.
unknown-key
Severity: error
A key is not part of the format. When it is close to a known key, the message suggests that key.
name: demo
bogus: 1
fields: [ {name: a, type: uint8} ]
Fix: correct the spelling, or remove the key. Use a YAML comment to document a description.
unknown-type
Severity: error
A Field’s type: names no built-in type and no Type. When the name is close to a built-in or
to a declared Type, the message suggests it. An unknown Type is reported once, at its first
use, however many Fields use it.
name: demo
fields: [ {name: id, type: unit8} ]
Fix: correct the spelling, here uint8, or declare the Type under types:. The built-in
types are listed in Fields.
unreachable-expect
Severity: warning
An expect: lists no value the Field’s type can hold: 256 on
a uint8, 2 on a bool, 4 on a 2-bit sub-Field. It never matches, so every packet gets
the “Unexpected value” expert info. A list or a range is reported only when none of its values
fit.
name: demo
fields:
- { name: version, type: uint8, expect: 256 }
Fix: correct the value, or widen the Field’s type if the value can occur. To flag every packet on purpose, allow the warning:
name: demo
fields:
- { name: version, type: uint8, expect: 256 }
allow: [unreachable-expect]
unreachable-field
Severity: warning
A Field comes after a Field that reads every byte left in the message, so it is always empty
or truncated. The earlier Field is a size: "_remaining" Field or a repeat: to_end
array, or an inline structure, a Field of a Type or a switch that always
reads one: a switch only when every case does. A Field under if: or an array with count:
may read nothing, so it does not count.
name: demo
fields:
- { name: body, type: bytes, size: "_remaining" }
- { name: checksum, type: uint16 }
name: demo
fields:
- name: records
repeat: to_end
fields: [ {name: tag, type: uint8} ]
- { name: checksum, type: uint16 }
name: demo
fields:
- name: body
fields:
- { name: kind, type: uint8 }
- { name: data, type: bytes, size: "_remaining" }
- { name: checksum, type: uint16 }
Fix: give the earlier Field a size that leaves room, such as "_remaining - 2", or a
count: in place of repeat: to_end, or remove the later Field. When the later Field is meant
to be empty, allow the warning:
name: demo
fields:
- { name: body, type: bytes, size: "_remaining" }
- { name: checksum, type: uint16 }
allow: [unreachable-field]
unreachable-value
Severity: warning
A key of a values table is outside the range of the Field’s type, so no packet can show its
label: 256 on a uint8, or -1 on any unsigned type. A range is reported only when none of
its values fit. For an Enum, each key is reported once, for the first Field whose type cannot
hold it. The Dissector leaves the key out.
name: demo
fields:
- { name: kind, type: uint8, values: { 1: One, 256: Never } }
Fix: remove the key, or widen the Field’s type if the value can occur. An Enum shared by Fields of several widths can keep keys only the widest reaches; allow the warning then:
name: demo
fields:
- { name: short_kind, type: uint8, values: Kind }
- { name: long_kind, type: uint16, values: Kind }
enums:
Kind: { 1: One, 256: Wide }
allow: [unreachable-value]
unused-enum
Severity: warning
An Enum under enums: is never named by a Field’s values:.
name: demo
fields:
- { name: kind, type: uint8 }
enums:
MsgType: { 1: Request }
Fix: use it with values: MsgType, or remove it. To keep it for later, allow the warning:
name: demo
fields:
- { name: kind, type: uint8 }
enums:
MsgType: { 1: Request }
allow: [unused-enum]
unused-type
Severity: warning
A Type under types: is never named by a Field’s type:, so the Dissector never reads it.
name: demo
fields:
- { name: id, type: uint8 }
types:
Header:
fields: [ {name: length, type: uint16} ]
Fix: use it with type: Header, or remove it. To keep it for later, allow the warning:
name: demo
fields:
- { name: id, type: uint8 }
types:
Header:
fields: [ {name: length, type: uint16} ]
allow: [unused-type]
wrong-value-type
Severity: error
A value has the wrong kind: a scalar where a list is expected, a list where a mapping is expected, a float or a bool where an integer is expected, and so on. The whole description must be a mapping.
name: demo
fields: [ {name: a, type: uint8} ]
allow: unknown-allow
Fix: write the value in the kind the message asks for, here a list:
allow: [unknown-allow].
yaml-alias
Severity: error
The file uses a YAML alias (*name). Aliases are not part of the YAML subset Wirdigen reads,
because a description reuses Fields through Types. An alias always comes with the anchor it
refers to, which is the error yaml-anchor.
x: &a demo
name: *a
fields: [ {name: a, type: uint8} ]
Fix: write the value out, or move repeated Fields into a Type.
yaml-anchor
Severity: error
The file declares a YAML anchor (&name). Anchors are not part of the YAML subset Wirdigen
reads, because a description reuses Fields through Types.
name: &n demo
fields: [ {name: a, type: uint8} ]
Fix: remove the anchor, and move repeated Fields into a Type.
yaml-syntax
Severity: error
The file is not well-formed YAML, so nothing else can be checked. The message is the YAML parser’s.
name: [demo
fields: []
Fix: correct the YAML at the position shown, here by closing the [ list or writing
name: demo.
yaml-tag
Severity: error
The file uses a YAML tag (!foo, !!str). Tags are not part of the YAML subset Wirdigen reads.
name: !foo demo
fields: [ {name: a, type: uint8} ]
Fix: remove the tag. To keep a value as text, quote it.
yaml-too-deep
Severity: error
The YAML nests more than 256 levels deep, anywhere in the file: the root is the first level, and
each value inside a list or a mapping is one level deeper. The error points at the first node
past the limit, and nothing else is checked. A description within the
field-too-deep limit nests at most about 194 levels.
name: demo
info: [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
fields: [ { name: a, type: uint8 } ]
Fix: flatten the nesting.