kwalify structure schema, eth-frame, tcp and a example (which is tcp...)
This commit is contained in:
parent
df03df1b5a
commit
3547c20733
|
@ -0,0 +1,70 @@
|
|||
# Example YAML protocol structure
|
||||
|
||||
protocol: &tcp
|
||||
name: TCP
|
||||
fields:
|
||||
-
|
||||
field: source port
|
||||
length: 2
|
||||
-
|
||||
field: destination port
|
||||
length: 2
|
||||
-
|
||||
field: sequence number
|
||||
length: 4
|
||||
-
|
||||
field: acknowledgment number
|
||||
length: 4
|
||||
-
|
||||
field: data offset
|
||||
bitfield: yes
|
||||
length: 4
|
||||
-
|
||||
field: reserved
|
||||
bitfield: yes
|
||||
length: 6
|
||||
-
|
||||
field: URG
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: ACK
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: PSH
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: RST
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: SYN
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: FIN
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: window
|
||||
length: 2
|
||||
-
|
||||
field: checksum
|
||||
length: 2
|
||||
-
|
||||
field: options
|
||||
length: 4
|
||||
optional: true
|
||||
repeatable: true
|
||||
-
|
||||
field: data
|
||||
length: 0
|
||||
data: true
|
||||
osilayer: 4
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
#Ethernet
|
||||
---
|
||||
protocol: ð
|
||||
name: eth
|
||||
osilayer: 2
|
||||
fields:
|
||||
-
|
||||
field: destination MAC
|
||||
length: 6
|
||||
-
|
||||
field: source MAC
|
||||
length: 6
|
||||
-
|
||||
field: vlan tag
|
||||
length: 4
|
||||
subfields:
|
||||
-
|
||||
field: tag protocol identifier (0x8100)
|
||||
length: 2
|
||||
-
|
||||
field: tag control information
|
||||
length: 2
|
||||
subfields:
|
||||
-
|
||||
field: priority code point (PCP)
|
||||
bitfield: yes
|
||||
length: 3
|
||||
-
|
||||
field: drop eligible indicator (DEI)
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: VLAN identifier (VID)
|
||||
bitfield: yes
|
||||
length: 12
|
||||
-
|
||||
field: Ethertype (Eth II) or length (IEEE 802.3)
|
||||
length: 2
|
||||
-
|
||||
field: data
|
||||
length: 0
|
||||
data: true
|
||||
-
|
||||
field: FCS (32-bit CRC)
|
||||
length: 4
|
|
@ -0,0 +1,64 @@
|
|||
---
|
||||
protocol: &tcp
|
||||
name: TCP
|
||||
fields:
|
||||
-
|
||||
field: source port
|
||||
length: 2
|
||||
-
|
||||
field: destination port
|
||||
length: 2
|
||||
-
|
||||
field: sequence number
|
||||
length: 4
|
||||
-
|
||||
field: acknowledgment number
|
||||
length: 4
|
||||
-
|
||||
field: data offset
|
||||
bitfield: yes
|
||||
length: 4
|
||||
-
|
||||
field: reserved
|
||||
bitfield: yes
|
||||
length: 6
|
||||
-
|
||||
field: URG
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: ACK
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: PSH
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: RST
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: SYN
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: FIN
|
||||
bitfield: yes
|
||||
length: 1
|
||||
-
|
||||
field: window
|
||||
length: 2
|
||||
-
|
||||
field: checksum
|
||||
length: 2
|
||||
-
|
||||
field: options
|
||||
length: 4
|
||||
optional: true
|
||||
repeatable: true
|
||||
-
|
||||
field: data
|
||||
length: 0
|
||||
data: true
|
||||
osilayer: 4
|
|
@ -0,0 +1,36 @@
|
|||
type: map
|
||||
mapping:
|
||||
"protocol":
|
||||
type: map
|
||||
required: yes
|
||||
mapping:
|
||||
"name":
|
||||
type: str
|
||||
required: yes
|
||||
"fields":
|
||||
type: seq
|
||||
required: yes
|
||||
sequence: &fieldsseq
|
||||
- type: map
|
||||
mapping:
|
||||
"field":
|
||||
type: str
|
||||
required: yes
|
||||
"length": #length in bytes, except bitfield is set to true!
|
||||
type: int
|
||||
required: yes
|
||||
"bitfield": #if this is true length is in BITS!
|
||||
type: bool
|
||||
"optional":
|
||||
type: bool
|
||||
"repeatable":
|
||||
type: bool
|
||||
"data": #data placeholder for next layer (length should be 0!)
|
||||
type: bool
|
||||
"subfields":
|
||||
type: seq
|
||||
sequence: *fieldsseq
|
||||
"osilayer":
|
||||
type: int
|
||||
range: { max: 7, min: 1 }
|
||||
required: yes
|
Reference in New Issue