diff --git a/protocols/osi3/ipv4.yml b/protocols/osi3/ipv4.yml index 2ecd550..722d53b 100644 --- a/protocols/osi3/ipv4.yml +++ b/protocols/osi3/ipv4.yml @@ -66,4 +66,9 @@ protocol: length: 4 optional: yes - field: data - data: true \ No newline at end of file + data: true + nextlayer: + - { protocol: tcp, identifier: 6 } + - { protocol: udp, identifier: 17 } + + \ No newline at end of file diff --git a/protocols/osi3/ipv6.yml b/protocols/osi3/ipv6.yml index 6729f65..46b2296 100644 --- a/protocols/osi3/ipv6.yml +++ b/protocols/osi3/ipv6.yml @@ -20,6 +20,7 @@ protocol: - field: nextheader desc: next header identifier (see ipv4 protocol id) length: 1 + nextlayer: yes - field: hoplimit desc: hop limit length: 1 @@ -28,4 +29,74 @@ protocol: length: 16 - field: dstaddress desc: destination address - length: 16 \ No newline at end of file + length: 16 + nextlayer: + - { protocol: hopbyhop, identifier: 0, extension: yes } + - { protocol: destoptions, identifier: 60, extension: yes } + - { protocol: routing, identifier: 43, extension: yes } + - { protocol: fragment, identifier: 44, extension: yes } + - { protocol: ipsec_ah, identifier: 51 } + - { protocol: ipsec_esp, identifier: 50 } + - { protocol: mobility, identifier: 135, extension: yes } + - { protocol: tcp, identifier: 6 } + - { protocol: udp, identifier: 17 } + extensionreferencefield: nextheader + extensions: + - extension: + name: hopbyhop + referenceid: 0 + fields: &hopbyhop + - field: nextheader + length: 1 + nextlayer: yes + - field: extlength + desc: Header extension lengthin octets + length: 1 + - field: options + length: 6 + - field: options + length: 8 + optional: yes + repeatable: yes + - extension: + name: destoptions + referenceid: 60 + fields: *hopbyhop + - extension: + name: routing #is deprecated (see http://en.wikipedia.org/wiki/IPv6_packet) + referenceid: 43 + fields: + - field: nextheader + length: 1 + nextlayer: yes + - field: extlength + length: 1 + - field: routingtype + length: 1 + - field: segmentsleft + length: 1 + - field: typedata + length: 4 + - field: typedata + length: 8 + optional: yes + - extension: + name: fragment + referenceid: 44 + fields: + - field: nextheader + length: 1 + nextlayer: yes + - field: reserved + length: 1 + - field: fragmentoffset + bitfield: yes + length: 13 + - field: reserved + bitfield: yes + length: 2 + - field: mflag + bitfield: yes + length: 1 + - field: identification + length: 4 \ No newline at end of file diff --git a/structure-schema.yml b/structure-schema.yml index 1631a5b..449c7c5 100644 --- a/structure-schema.yml +++ b/structure-schema.yml @@ -54,6 +54,8 @@ mapping: required: yes "extension": type: bool + "extensionreferencefield": + type: str "extensions": type: seq sequence: @@ -67,7 +69,6 @@ mapping: required: yes "referencedfrom": #referencing field of protocol definition type: str - required: yes "referenceid": #reference id used in protocol definition or extension itself type: int required: yes