111 lines
3.3 KiB
YAML
111 lines
3.3 KiB
YAML
type: map
|
|
mapping:
|
|
"protocol":
|
|
type: map
|
|
required: yes
|
|
mapping:
|
|
"name":
|
|
type: str
|
|
required: yes
|
|
"longname":
|
|
type: str
|
|
"fields":
|
|
type: seq
|
|
required: yes
|
|
sequence: &fieldsseq
|
|
- type: map
|
|
mapping:
|
|
"field": #field name (best if only one word, for easier referencing)
|
|
type: str
|
|
required: yes
|
|
"desc": #short description
|
|
type: str
|
|
"length": #length in bytes, except bitfield is set to true!
|
|
type: int
|
|
"bitfield": #if this is true length is in BITS!
|
|
type: bool
|
|
"optional":
|
|
type: bool
|
|
"repeatable":
|
|
type: bool
|
|
"nextlayer": #identifies this field as nextlayer field (see nextlayer definition below)
|
|
type: bool
|
|
"data": #data placeholder for next layer
|
|
type: bool
|
|
"reference": #reference another protocol directly (e.g. ethpacket->ethframe)
|
|
type: str
|
|
"reflength": #reference another field for length of this field
|
|
type: str
|
|
"subfields":
|
|
type: seq
|
|
sequence: *fieldsseq
|
|
"osilayer":
|
|
type: int
|
|
range: { max: 7, min: 1 }
|
|
required: yes
|
|
"extensionreferencefield":
|
|
type: str
|
|
"extensions":
|
|
type: seq
|
|
sequence:
|
|
- type: map
|
|
mapping:
|
|
"extension": &extension
|
|
type: map
|
|
mapping:
|
|
"name":
|
|
type: str
|
|
required: yes
|
|
"referencedfrom": #referencing field of protocol definition
|
|
type: str
|
|
"referenceid": #reference id used in protocol definition or extension itself
|
|
type: int
|
|
required: yes #really? maybe not...
|
|
"before": # standard is after the normal protocol structure, but could be used for vlan in ethernet for example.
|
|
type: str
|
|
"after":
|
|
type: str
|
|
"fields":
|
|
type: seq
|
|
sequence: *fieldsseq
|
|
"documentation":
|
|
type: map
|
|
mapping:
|
|
"summary": # a summary about this protocol (optional)
|
|
type: str
|
|
"descriptions": # descriptions of the fields
|
|
type: seq
|
|
sequence:
|
|
- type: map
|
|
mapping:
|
|
"field": # field name as defined in the protocol structure
|
|
type: str
|
|
required: yes
|
|
"desc": # description
|
|
type: str
|
|
required: yes
|
|
... #kwalify needs this, or it goes crazy validating, but only when there are comments beneath
|
|
|
|
|
|
# constraints
|
|
|
|
# even possible?
|
|
# how to implement?
|
|
|
|
#maybe like this:
|
|
# "constraint":
|
|
# type: map
|
|
# mapping:
|
|
# "name":
|
|
# type: str
|
|
# "type": # hmm, maybe better in triggers with "function": ?
|
|
# enum: [ crc, ...? ]
|
|
# "triggers":
|
|
# type: seq
|
|
# ....
|
|
# "actions":
|
|
# type: seq
|
|
# sequence:
|
|
# - type: map
|
|
# mapping:
|
|
# "extension": *extension |