YAML structure field type objects

A structure field type object is the type of structure data fields, found in data streams.

A structure data field is a sequence of named data fields, or members. In CTF, the names of those members are found in the metadata stream.

Properties

Name Type Description Req? Default

class

String

This property’s value must be one of:

  • structure

  • struct

Yes if the $inherit property is not set.

$inherit

String

Name of a field type alias from which to inherit.

Yes if the class property is not set.

minimum-alignment

Power-of-two integer

Minimum alignment of the first bit of this field type’s instances within a CTF packet (bits).

No

1

members

Sequence of mappings, where each mapping has a single entry:

Key

Member’s name.

Value

Structure field type member object or string.

This sequence is considered to be an ordered mapping, similar to YAML’s !!omap type. Therefore, each mapping key must be unique.

Members of this structure field type.

If a mapping’s value is a string, it must be the name of an existing field type alias. This field type must not be a structure field type.

No

No members

Structure field type member object

A member within a structure field type object.

Properties

Name Type Description Req?

field-type

Field type object (except a structure field type object) or string

Member’s field type.

If this property’s value is a string, it must be the name of an existing field type alias. This field type must not be a structure field type.

Yes

Examples

Example 1. Basic structure field type object with no members.
class: structure
Example 2. Structure field type object with three members using field type aliases.
class: structure
members:
  - msg: string
  - msg_id: uint32
  - src_ip_addr: ipv4
Example 3. Structure field type object with one member object.
class: structure
members:
  - msg: string
  - msg_id:
      field-type:
        class: unsigned-integer
        size: 32
  - src_ip_addr: ipv4
Example 4. Structure field type object with an explicit minimum alignment.
class: structure
minimum-alignment: 64
members:
  - msg: string
  - msg_id: uint32
  - src_ip_addr: ipv4