2015-01-04 11:23:12 +01:00
|
|
|
type: map
|
|
|
|
mapping:
|
|
|
|
"protocol":
|
|
|
|
type: map
|
|
|
|
required: yes
|
|
|
|
mapping:
|
|
|
|
"name":
|
|
|
|
type: str
|
|
|
|
required: yes
|
2015-01-04 22:34:34 +01:00
|
|
|
"longname":
|
2015-01-04 12:04:36 +01:00
|
|
|
type: str
|
2015-01-04 11:23:12 +01:00
|
|
|
"fields":
|
|
|
|
type: seq
|
|
|
|
required: yes
|
|
|
|
sequence: &fieldsseq
|
|
|
|
- type: map
|
|
|
|
mapping:
|
2015-01-04 12:04:36 +01:00
|
|
|
"field": #field name (best if only one word, for easier referencing)
|
2015-01-04 11:23:12 +01:00
|
|
|
type: str
|
|
|
|
required: yes
|
2015-01-04 12:04:36 +01:00
|
|
|
"desc": #short description
|
|
|
|
type: str
|
2015-01-04 11:23:12 +01:00
|
|
|
"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
|
2015-01-04 15:14:17 +01:00
|
|
|
"nextlayer": #identifies this field as nextlayer field (see nextlayer definition below)
|
|
|
|
type: bool
|
2015-01-04 12:04:36 +01:00
|
|
|
"data": #data placeholder for next layer
|
2015-01-04 11:23:12 +01:00
|
|
|
type: bool
|
2015-01-04 12:04:36 +01:00
|
|
|
"reference": #reference another protocol directly (e.g. ethpacket->ethframe)
|
|
|
|
type: str
|
2015-02-24 20:31:27 +01:00
|
|
|
"reflength": #reference another field for length of this field
|
|
|
|
type: str
|
2015-01-04 11:23:12 +01:00
|
|
|
"subfields":
|
|
|
|
type: seq
|
|
|
|
sequence: *fieldsseq
|
|
|
|
"osilayer":
|
2015-01-04 14:54:50 +01:00
|
|
|
type: int
|
2015-01-04 11:23:12 +01:00
|
|
|
range: { max: 7, min: 1 }
|
|
|
|
required: yes
|
2015-01-04 16:07:28 +01:00
|
|
|
"extensionreferencefield":
|
|
|
|
type: str
|
2015-01-04 14:54:50 +01:00
|
|
|
"extensions":
|
|
|
|
type: seq
|
|
|
|
sequence:
|
|
|
|
- type: map
|
|
|
|
mapping:
|
2015-01-04 17:33:34 +01:00
|
|
|
"extension": &extension
|
2015-01-04 14:54:50 +01:00
|
|
|
type: map
|
|
|
|
mapping:
|
|
|
|
"name":
|
|
|
|
type: str
|
|
|
|
required: yes
|
|
|
|
"referencedfrom": #referencing field of protocol definition
|
|
|
|
type: str
|
2015-01-04 15:14:17 +01:00
|
|
|
"referenceid": #reference id used in protocol definition or extension itself
|
|
|
|
type: int
|
2015-01-04 17:33:34 +01:00
|
|
|
required: yes #really? maybe not...
|
2015-01-04 15:14:17 +01:00
|
|
|
"before": # standard is after the normal protocol structure, but could be used for vlan in ethernet for example.
|
|
|
|
type: str
|
|
|
|
"after":
|
|
|
|
type: str
|
2015-01-04 14:54:50 +01:00
|
|
|
"fields":
|
|
|
|
type: seq
|
|
|
|
sequence: *fieldsseq
|
2015-01-04 17:14:17 +01:00
|
|
|
"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
|
2015-01-04 17:36:43 +01:00
|
|
|
... #kwalify needs this, or it goes crazy validating, but only when there are comments beneath
|
|
|
|
|
|
|
|
|
2015-01-04 17:33:34 +01:00
|
|
|
# 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
|