From ce4b6451787389c5b0ebfac413c350ef3a424b8b Mon Sep 17 00:00:00 2001 From: Ting Xu Date: Sun, 24 Apr 2022 06:14:25 +0000 Subject: packetforge: add packetforge for generic flow to extras Add a new tool packetforge to extras. This tool is to support generic flow. Packetforge is a library to translate naming or json profile format flow pattern to the required input of generic flow, i.e. spec and mask. Using python script flow_create.py, it can add and enable a new flow rule for an interface via flow VAPI, and can delete an existed flow rule as well. Command examples are shown below. Json profile examples can be found in ./parsegraph/samples. Naming format input: python flow_create.py --add -p "mac()/ipv4(src=1.1.1.1,dst=2.2.2.2)/udp()" -a "redirect-to-queue 3" -i 1 python flow_create.py --del -i 1 -I 0 Json profile format input: python flow_create.py -f "./flow_rule_examples/mac_ipv4.json" -i 1 With this command, flow rule can be added or deleted, and the flow entry can be listed with "show flow entry" command in VPP CLI. Packetforge is based on a parsegraph. The parsegraph can be built by users. A Spec can be found in ./parsegraph as guidance. More details about packetforge are in README file. Type: feature Signed-off-by: Ting Xu Change-Id: Ia9f539741c5dca27ff236f2bcc493c5dd48c0df1 --- extras/packetforge/parsegraph/nodes/ah.json | 26 +++++++ extras/packetforge/parsegraph/nodes/arpv4.json | 54 +++++++++++++++ extras/packetforge/parsegraph/nodes/esp.json | 14 ++++ extras/packetforge/parsegraph/nodes/geneve.json | 51 ++++++++++++++ extras/packetforge/parsegraph/nodes/gre.json | 56 +++++++++++++++ extras/packetforge/parsegraph/nodes/gtpc.json | 48 +++++++++++++ extras/packetforge/parsegraph/nodes/gtppsc.json | 28 ++++++++ extras/packetforge/parsegraph/nodes/gtpu.json | 63 +++++++++++++++++ extras/packetforge/parsegraph/nodes/icmp.json | 18 +++++ extras/packetforge/parsegraph/nodes/icmpv6.json | 18 +++++ extras/packetforge/parsegraph/nodes/ipv4.json | 76 +++++++++++++++++++++ extras/packetforge/parsegraph/nodes/ipv6.json | 47 +++++++++++++ extras/packetforge/parsegraph/nodes/ipv6crh16.json | 36 ++++++++++ extras/packetforge/parsegraph/nodes/ipv6crh32.json | 32 +++++++++ extras/packetforge/parsegraph/nodes/ipv6srh.json | 40 +++++++++++ extras/packetforge/parsegraph/nodes/l2tpv2ctl.json | 74 ++++++++++++++++++++ .../packetforge/parsegraph/nodes/l2tpv2data.json | 79 ++++++++++++++++++++++ extras/packetforge/parsegraph/nodes/mac.json | 22 ++++++ extras/packetforge/parsegraph/nodes/nvgre.json | 52 ++++++++++++++ extras/packetforge/parsegraph/nodes/payload.json | 18 +++++ extras/packetforge/parsegraph/nodes/pfcp.json | 58 ++++++++++++++++ extras/packetforge/parsegraph/nodes/sctp.json | 22 ++++++ extras/packetforge/parsegraph/nodes/tcp.json | 79 ++++++++++++++++++++++ extras/packetforge/parsegraph/nodes/udp.json | 24 +++++++ extras/packetforge/parsegraph/nodes/vlan.json | 30 ++++++++ extras/packetforge/parsegraph/nodes/vxlan.json | 33 +++++++++ extras/packetforge/parsegraph/nodes/vxlangpe.json | 53 +++++++++++++++ 27 files changed, 1151 insertions(+) create mode 100644 extras/packetforge/parsegraph/nodes/ah.json create mode 100644 extras/packetforge/parsegraph/nodes/arpv4.json create mode 100644 extras/packetforge/parsegraph/nodes/esp.json create mode 100644 extras/packetforge/parsegraph/nodes/geneve.json create mode 100644 extras/packetforge/parsegraph/nodes/gre.json create mode 100644 extras/packetforge/parsegraph/nodes/gtpc.json create mode 100644 extras/packetforge/parsegraph/nodes/gtppsc.json create mode 100644 extras/packetforge/parsegraph/nodes/gtpu.json create mode 100644 extras/packetforge/parsegraph/nodes/icmp.json create mode 100644 extras/packetforge/parsegraph/nodes/icmpv6.json create mode 100644 extras/packetforge/parsegraph/nodes/ipv4.json create mode 100644 extras/packetforge/parsegraph/nodes/ipv6.json create mode 100644 extras/packetforge/parsegraph/nodes/ipv6crh16.json create mode 100644 extras/packetforge/parsegraph/nodes/ipv6crh32.json create mode 100644 extras/packetforge/parsegraph/nodes/ipv6srh.json create mode 100644 extras/packetforge/parsegraph/nodes/l2tpv2ctl.json create mode 100644 extras/packetforge/parsegraph/nodes/l2tpv2data.json create mode 100644 extras/packetforge/parsegraph/nodes/mac.json create mode 100644 extras/packetforge/parsegraph/nodes/nvgre.json create mode 100644 extras/packetforge/parsegraph/nodes/payload.json create mode 100644 extras/packetforge/parsegraph/nodes/pfcp.json create mode 100644 extras/packetforge/parsegraph/nodes/sctp.json create mode 100644 extras/packetforge/parsegraph/nodes/tcp.json create mode 100644 extras/packetforge/parsegraph/nodes/udp.json create mode 100644 extras/packetforge/parsegraph/nodes/vlan.json create mode 100644 extras/packetforge/parsegraph/nodes/vxlan.json create mode 100644 extras/packetforge/parsegraph/nodes/vxlangpe.json (limited to 'extras/packetforge/parsegraph/nodes') diff --git a/extras/packetforge/parsegraph/nodes/ah.json b/extras/packetforge/parsegraph/nodes/ah.json new file mode 100644 index 00000000000..b3a32272f94 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/ah.json @@ -0,0 +1,26 @@ +{ + "type" : "node", + "name" : "ah", + "layout" : [ + { + "name" : "nextheader", + "size" : "8" + }, + { + "name" : "payloadlength", + "size" : "8" + }, + { + "name" : "reserved", + "size" : "16" + }, + { + "name" : "spi", + "size" : "32" + }, + { + "name" : "sequencenumber", + "size" : "32" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/arpv4.json b/extras/packetforge/parsegraph/nodes/arpv4.json new file mode 100644 index 00000000000..95c72c2b657 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/arpv4.json @@ -0,0 +1,54 @@ +{ + "type" : "node", + "name" : "arpv4", + "layout" : [ + { + "name" : "htype", + "size" : "16", + "default" : "1", + "readonly" : "true" + }, + { + "name" : "ptype", + "size" : "16", + "default" : "0x0800", + "readonly" : "true" + }, + { + "name" : "hlen", + "size" : "8", + "default" : "6", + "readonly" : "true" + }, + { + "name" : "plen", + "size" : "8", + "default" : "4", + "readonly" : "true" + }, + { + "name" : "operation", + "size" : "16" + }, + { + "name" : "sha", + "size" : "48", + "format" : "mac" + }, + { + "name" : "spa", + "size" : "32", + "format" : "ipv4" + }, + { + "name" : "tha", + "size" : "48", + "format" : "mac" + }, + { + "name" : "tpa", + "size" : "32", + "format" : "ipv4" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/esp.json b/extras/packetforge/parsegraph/nodes/esp.json new file mode 100644 index 00000000000..702408ab379 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/esp.json @@ -0,0 +1,14 @@ +{ + "type" : "node", + "name" : "esp", + "layout" : [ + { + "name" : "spi", + "size" : "32" + }, + { + "name" : "sequencenumber", + "size" : "32" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/geneve.json b/extras/packetforge/parsegraph/nodes/geneve.json new file mode 100644 index 00000000000..c31586b8f7a --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/geneve.json @@ -0,0 +1,51 @@ +{ + "type" : "node", + "name" : "geneve", + "layout" : [ + { + "name" : "version", + "size" : "2", + "default" : "0", + "readonly" : "true" + }, + { + "name" : "optlen", + "size" : "6" + }, + { + "name" : "o", + "size" : "1" + }, + { + "name" : "c", + "size" : "1" + }, + { + "name" : "reserved", + "size" : "6" + }, + { + "name" : "protocoltype", + "size" : "16" + }, + { + "name" : "vni", + "size" : "24" + }, + { + "name" : "reserved", + "size" : "8" + }, + { + "name" : "options", + "size" : "optlen<<5" + } + ], + "attributes" : [ + { + "name" : "udpport", + "size" : "16", + "default" : "6081" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/gre.json b/extras/packetforge/parsegraph/nodes/gre.json new file mode 100644 index 00000000000..db9579cd27f --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/gre.json @@ -0,0 +1,56 @@ +{ + "type" : "node", + "name" : "gre", + "layout" : [ + { + "name" : "c", + "size" : "1" + }, + { + "name" : "reserved", + "size" : "1" + }, + { + "name" : "k", + "size" : "1" + }, + { + "name" : "s", + "size" : "1" + }, + { + "name" : "reserved", + "size" : "9" + }, + { + "name" : "version", + "size" : "3", + "default" : "0", + "readonly" : "true" + }, + { + "name" : "protocoltype", + "size" : "16" + }, + { + "name" : "checksum", + "size" : "16", + "optional" : "c=1" + }, + { + "name" : "reserved", + "size" : "16", + "optional" : "c=1" + }, + { + "name" : "key", + "size" : "32", + "optional" : "k=1" + }, + { + "name" : "sequencenumber", + "size" : "32", + "optional" : "s=1" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/gtpc.json b/extras/packetforge/parsegraph/nodes/gtpc.json new file mode 100644 index 00000000000..99ed70c06e8 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/gtpc.json @@ -0,0 +1,48 @@ +{ + "type" : "node", + "name" : "gtpc", + "layout" : [ + { + "name" : "version", + "size" : "3", + "default" : "2", + "readonly" : "true" + }, + { + "name" : "p", + "size" : "1" + }, + { + "name" : "t", + "size" : "1" + }, + { + "name" : "reserved", + "size" : "3" + }, + { + "name" : "messagetype", + "size" : "8" + }, + { + "name" : "messagelength", + "size" : "16", + "default" : "4", + "autoincrease" : "true" + }, + { + "name" : "teid", + "size" : "32", + "optional" : "t=1", + "increaselength" : "true" + }, + { + "name" : "sequencenumber", + "size" : "24" + }, + { + "name" : "reserved", + "size" : "8" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/gtppsc.json b/extras/packetforge/parsegraph/nodes/gtppsc.json new file mode 100644 index 00000000000..d6814be503c --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/gtppsc.json @@ -0,0 +1,28 @@ +{ + "type" : "node", + "name" : "gtppsc", + "layout" : [ + { + "name" : "length", + "size" : "1", + "default" : "1", + "readonly" : "true" + }, + { + "name" : "pdutype", + "size" : "4" + }, + { + "name" : "reserved", + "size" : "4" + }, + { + "name" : "reserved", + "size" : "2" + }, + { + "name" : "qfi", + "size" : "6" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/gtpu.json b/extras/packetforge/parsegraph/nodes/gtpu.json new file mode 100644 index 00000000000..244e7d9ced0 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/gtpu.json @@ -0,0 +1,63 @@ +{ + "type" : "node", + "name" : "gtpu", + "layout" : [ + { + "name" : "version", + "size" : "3", + "default" : "1", + "readonly" : "true" + }, + { + "name" : "pt", + "size" : "1" + }, + { + "name" : "reserved", + "size" : "1" + }, + { + "name" : "e", + "size" : "1" + }, + { + "name" : "s", + "size" : "1" + }, + { + "name" : "pn", + "size" : "1" + }, + { + "name" : "messagetype", + "size" : "8" + }, + { + "name" : "messagelength", + "size" : "16", + "autoincrease" : "true" + }, + { + "name" : "teid", + "size" : "32" + }, + { + "name" : "sequencenumber", + "size" : "16", + "optional" : "e=1|s=1|pn=1", + "increaselength" : "true" + }, + { + "name" : "npdunumber", + "size" : "8", + "optional" : "e=1|s=1|pn=1", + "increaselength" : "true" + }, + { + "name" : "nextextentionheadertype", + "size" : "8", + "optional" : "e=1|s=1|pn=1", + "increaselength" : "true" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/icmp.json b/extras/packetforge/parsegraph/nodes/icmp.json new file mode 100644 index 00000000000..4d96a34bd7e --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/icmp.json @@ -0,0 +1,18 @@ +{ + "type" : "node", + "name" : "icmp", + "layout" : [ + { + "name" : "type", + "size" : "8" + }, + { + "name" : "code", + "size" : "8" + }, + { + "name" : "checksum", + "size" : "16" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/icmpv6.json b/extras/packetforge/parsegraph/nodes/icmpv6.json new file mode 100644 index 00000000000..c4e89cbae81 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/icmpv6.json @@ -0,0 +1,18 @@ +{ + "type" : "node", + "name" : "icmpv6", + "layout" : [ + { + "name" : "type", + "size" : "8" + }, + { + "name" : "code", + "size" : "8" + }, + { + "name" : "checksum", + "size" : "16" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/ipv4.json b/extras/packetforge/parsegraph/nodes/ipv4.json new file mode 100644 index 00000000000..297f60000cc --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/ipv4.json @@ -0,0 +1,76 @@ +{ + "type" : "node", + "name" : "ipv4", + "layout" : [ + { + "name" : "version", + "size" : "4", + "default" : "4", + "readonly" : "true" + }, + { + "name" : "ilh", + "size" : "4", + "default" : "5", + "readonly" : "true" + }, + { + "name" : "dscp", + "size" : "6" + }, + { + "name" : "ecn", + "size" : "2" + }, + { + "name" : "totallength", + "size" : "16", + "default" : "20", + "autoincrease" : "true" + }, + { + "name" : "identification", + "size" : "16" + }, + { + "name" : "reserved", + "size" : "1" + }, + { + "name" : "df", + "size" : "1" + }, + { + "name" : "mf", + "size" : "1" + }, + { + "name" : "fragmentoffset", + "size" : "13" + }, + { + "name" : "ttl", + "size" : "8" + }, + { + "name" : "protocol", + "size" : "8" + }, + { + "name" : "checksum", + "size" : "16" + }, + { + "name" : "src", + "size" : "32", + "format" : "ipv4", + "default" : "1.1.1.1" + }, + { + "name" : "dst", + "size" : "32", + "format" : "ipv4", + "default" : "2.2.2.2" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/ipv6.json b/extras/packetforge/parsegraph/nodes/ipv6.json new file mode 100644 index 00000000000..3de24a2d64b --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/ipv6.json @@ -0,0 +1,47 @@ +{ + "type" : "node", + "name" : "ipv6", + "layout" : [ + { + "name" : "version", + "size" : "4", + "default" : "6", + "readonly" : "true" + }, + { + "name" : "dscp", + "size" : "6" + }, + { + "name" : "ecn", + "size" : "2" + }, + { + "name" : "flowlabel", + "size" : "20" + }, + { + "name" : "payloadlength", + "size" : "16", + "autoincrease" : "true" + }, + { + "name" : "nextheader", + "size" : "8" + }, + { + "name" : "hoplimit", + "size" : "8" + }, + { + "name" : "src", + "size" : "128", + "format" : "ipv6" + }, + { + "name" : "dst", + "size" : "128", + "format" : "ipv6" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/ipv6crh16.json b/extras/packetforge/parsegraph/nodes/ipv6crh16.json new file mode 100644 index 00000000000..559ed870af2 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/ipv6crh16.json @@ -0,0 +1,36 @@ +{ + "type" : "node", + "name" : "ipv6crh16", + "layout" : [ + { + "name" : "nextheader", + "size" : "8" + }, + { + "name" : "headerextlength", + "size" : "8" + }, + { + "name" : "routingtype", + "size" : "8", + "default" : "5", + "readonly" : "true" + }, + { + "name" : "segmentleft", + "size" : "8" + }, + { + "name" : "sid0", + "size" : "16" + }, + { + "name" : "sid1", + "size" : "16" + }, + { + "name" : "sid16remains", + "size" : "headerextlength<<6" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/ipv6crh32.json b/extras/packetforge/parsegraph/nodes/ipv6crh32.json new file mode 100644 index 00000000000..457050b9f13 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/ipv6crh32.json @@ -0,0 +1,32 @@ +{ + "type" : "node", + "name" : "ipv6crh32", + "layout" : [ + { + "name" : "nextheader", + "size" : "8" + }, + { + "name" : "headerextlength", + "size" : "8" + }, + { + "name" : "routingtype", + "size" : "8", + "default" : "6", + "readonly" : "true" + }, + { + "name" : "segmentleft", + "size" : "8" + }, + { + "name" : "sid0", + "size" : "32" + }, + { + "name" : "sid32remains", + "size" : "headerextlength<<6" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/ipv6srh.json b/extras/packetforge/parsegraph/nodes/ipv6srh.json new file mode 100644 index 00000000000..48feaeb45fa --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/ipv6srh.json @@ -0,0 +1,40 @@ +{ + "type" : "node", + "name" : "ipv6srh", + "layout" : [ + { + "name" : "nextheader", + "size" : "8" + }, + { + "name" : "headerextlength", + "size" : "8" + }, + { + "name" : "routingtype", + "size" : "8", + "default" : "4", + "readonly" : "true" + }, + { + "name" : "segmentleft", + "size" : "8" + }, + { + "name" : "lastentry", + "size" : "8" + }, + { + "name" : "flags", + "size" : "8" + }, + { + "name" : "tag", + "size" : "16" + }, + { + "name" : "addresses", + "size" : "headerextlength<<6" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/l2tpv2ctl.json b/extras/packetforge/parsegraph/nodes/l2tpv2ctl.json new file mode 100644 index 00000000000..7af22dd92fa --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/l2tpv2ctl.json @@ -0,0 +1,74 @@ +{ + "type" : "node", + "name" : "l2tpv2ctl", + "layout" : [ + { + "name" : "t", + "size" : "1", + "default" : "1", + "readonly" : "true" + }, + { + "name" : "l", + "size" : "1", + "default" : "1", + "readonly" : "true" + }, + { + "name" : "reserved", + "size" : "2" + }, + { + "name" : "s", + "size" : "1", + "default" : "1", + "readonly" : "true" + }, + { + "name" : "reserved", + "size" : "1" + }, + { + "name" : "o", + "size" : "1", + "default" : "0", + "readonly" : "true" + }, + { + "name" : "p", + "size" : "1", + "default" : "0", + "readonly" : "true" + }, + { + "name" : "reserved", + "size" : "4" + }, + { + "name" : "version", + "size" : "4", + "default" : "2", + "readonly" : "true" + }, + { + "name" : "length", + "size" : "16" + }, + { + "name" : "tunnelid", + "size" : "16" + }, + { + "name" : "sessionid", + "size" : "16" + }, + { + "name" : "ns", + "size" : "16" + }, + { + "name" : "nr", + "size" : "16" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/l2tpv2data.json b/extras/packetforge/parsegraph/nodes/l2tpv2data.json new file mode 100644 index 00000000000..d9e8b006820 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/l2tpv2data.json @@ -0,0 +1,79 @@ +{ + "type" : "node", + "name" : "l2tpv2data", + "layout" : [ + { + "name" : "t", + "size" : "1", + "default" : "0", + "readonly" : "true" + }, + { + "name" : "l", + "size" : "1" + }, + { + "name" : "reserved", + "size" : "2" + }, + { + "name" : "s", + "size" : "1" + }, + { + "name" : "reserved", + "size" : "1" + }, + { + "name" : "o", + "size" : "1" + }, + { + "name" : "p", + "size" : "1" + }, + { + "name" : "reserved", + "size" : "4" + }, + { + "name" : "version", + "size" : "4", + "default" : "2", + "readonly" : "true" + }, + { + "name" : "length", + "size" : "16", + "optional" : "l=1" + }, + { + "name" : "tunnelid", + "size" : "16" + }, + { + "name" : "sessionid", + "size" : "16" + }, + { + "name" : "ns", + "size" : "16", + "optional" : "s=1" + }, + { + "name" : "nr", + "size" : "16", + "optional" : "s=1" + }, + { + "name" : "offsetsize", + "size" : "16", + "optional" : "o=1" + }, + { + "name" : "offsetpad", + "size" : "offsetsize<<3", + "optional" : "o=1" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/mac.json b/extras/packetforge/parsegraph/nodes/mac.json new file mode 100644 index 00000000000..6fc49096889 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/mac.json @@ -0,0 +1,22 @@ +{ + "type" : "node", + "name" : "mac", + "layout" : [ + { + "name" : "src", + "size" : "48", + "format" : "mac", + "default" : "00:00:00:00:00:01" + }, + { + "name" : "dst", + "size" : "48", + "format" : "mac", + "default" : "00:00:00:00:00:02" + }, + { + "name" : "ethertype", + "size" : "16" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/nvgre.json b/extras/packetforge/parsegraph/nodes/nvgre.json new file mode 100644 index 00000000000..ec6812c8500 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/nvgre.json @@ -0,0 +1,52 @@ +{ + "type" : "node", + "name" : "nvgre", + "layout" : [ + { + "name" : "c", + "size" : "1", + "default" : "0", + "readonly" : "true" + }, + { + "name" : "reserved", + "size" : "1" + }, + { + "name" : "k", + "size" : "1", + "default" : "1", + "readonly" : "true" + }, + { + "name" : "s", + "size" : "1", + "default" : "0", + "readonly" : "true" + }, + { + "name" : "reserved", + "size" : "9" + }, + { + "name" : "version", + "size" : "3", + "default" : "0", + "readonly" : "true" + }, + { + "name" : "protocoltype", + "size" : "16", + "default" : "0x6558", + "readonly" : "true" + }, + { + "name" : "vsid", + "size" : "16" + }, + { + "name" : "flowid", + "size" : "16" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/payload.json b/extras/packetforge/parsegraph/nodes/payload.json new file mode 100644 index 00000000000..202116ff1ee --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/payload.json @@ -0,0 +1,18 @@ +{ + "type" : "node", + "name" : "payload", + "layout" : [ + { + "name" : "data", + "size" : "bytes<<3", + "format" : "bytearray" + } + ], + "attributes" : [ + { + "name" : "bytes", + "size" : "16", + "default" : "16" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/pfcp.json b/extras/packetforge/parsegraph/nodes/pfcp.json new file mode 100644 index 00000000000..f1a6c1901bd --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/pfcp.json @@ -0,0 +1,58 @@ +{ + "type" : "node", + "name" : "pfcp", + "layout" : [ + { + "name" : "version", + "size" : "3", + "default" : "1", + "readonly" : "true" + }, + { + "name" : "reserved", + "size" : "3" + }, + { + "name" : "mp", + "size" : "1" + }, + { + "name" : "s", + "size" : "1" + }, + { + "name" : "messagetype", + "size" : "8" + }, + { + "name" : "messagelength", + "size" : "16", + "default" : "8", + "autoincrease" : "true" + }, + { + "name" : "seid", + "size" : "64", + "optional" : "s=1", + "increaselength" : "true" + }, + { + "name" : "sequencenumber", + "size" : "24" + }, + { + "name" : "messagepriority", + "size" : "4", + "optional" : "mp=1" + }, + { + "name" : "reserved", + "size" : "4", + "optional" : "mp=0" + }, + { + "name" : "reserved", + "size" : "4" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/sctp.json b/extras/packetforge/parsegraph/nodes/sctp.json new file mode 100644 index 00000000000..58ef88cec55 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/sctp.json @@ -0,0 +1,22 @@ +{ + "type" : "node", + "name" : "sctp", + "layout" : [ + { + "name" : "src", + "size" : "16" + }, + { + "name" : "dst", + "size" : "16" + }, + { + "name" : "veificationtag", + "size" : "16" + }, + { + "name" : "checksum", + "size" : "16" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/tcp.json b/extras/packetforge/parsegraph/nodes/tcp.json new file mode 100644 index 00000000000..7d0bac20ab1 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/tcp.json @@ -0,0 +1,79 @@ +{ + "type" : "node", + "name" : "tcp", + "layout" : [ + { + "name" : "src", + "size" : "16" + }, + { + "name" : "dst", + "size" : "16" + }, + { + "name" : "sequencenumber", + "size" : "32" + }, + { + "name" : "acknowledgementnumber", + "size" : "32" + }, + { + "name" : "dataoffset", + "size" : "4", + "default" : "5" + }, + { + "name" : "reserved", + "size" : "3" + }, + { + "name" : "ns", + "size" : "1" + }, + { + "name" : "cwr", + "size" : "1" + }, + { + "name" : "ece", + "size" : "1" + }, + { + "name" : "urg", + "size" : "1" + }, + { + "name" : "ack", + "size" : "1" + }, + { + "name" : "psh", + "size" : "1" + }, + { + "name" : "pst", + "size" : "1" + }, + { + "name" : "syn", + "size" : "1" + }, + { + "name" : "fin", + "size" : "1" + }, + { + "name" : "windowsize", + "size" : "16" + }, + { + "name" : "checksum", + "size" : "16" + }, + { + "name" : "urgentpointer", + "size" : "16" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/udp.json b/extras/packetforge/parsegraph/nodes/udp.json new file mode 100644 index 00000000000..75a95aec4a9 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/udp.json @@ -0,0 +1,24 @@ +{ + "type" : "node", + "name" : "udp", + "layout" : [ + { + "name" : "src", + "size" : "16" + }, + { + "name" : "dst", + "size" : "16" + }, + { + "name" : "length", + "size" : "16", + "default" : "8", + "autoincrease" : "true" + }, + { + "name" : "checksum", + "size" : "16" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/vlan.json b/extras/packetforge/parsegraph/nodes/vlan.json new file mode 100644 index 00000000000..4a87a14d12d --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/vlan.json @@ -0,0 +1,30 @@ +{ + "type" : "node", + "name" : "vlan", + "layout" : [ + { + "name" : "pcp", + "size" : "3" + }, + { + "name" : "dei", + "size" : "1" + }, + { + "name" : "vid", + "size" : "12" + }, + { + "name" : "ethertype", + "size" : "16", + "readonly" : "true" + } + ], + "attributes" : [ + { + "name" : "tpid", + "size" : "16", + "default" : "0x8100" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/vxlan.json b/extras/packetforge/parsegraph/nodes/vxlan.json new file mode 100644 index 00000000000..f797075aa84 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/vxlan.json @@ -0,0 +1,33 @@ +{ + "type" : "node", + "name" : "vxlan", + "layout" : [ + { + "name" : "reserved", + "size" : "4" + }, + { + "name" : "i", + "size" : "1" + }, + { + "name" : "reserved", + "size" : "11" + }, + { + "name" : "vni", + "size" : "24" + }, + { + "name" : "reserved", + "size" : "8" + } + ], + "attributes" : [ + { + "name" : "udpport", + "size" : "16", + "default" : "4789" + } + ] +} diff --git a/extras/packetforge/parsegraph/nodes/vxlangpe.json b/extras/packetforge/parsegraph/nodes/vxlangpe.json new file mode 100644 index 00000000000..711e8bbcd04 --- /dev/null +++ b/extras/packetforge/parsegraph/nodes/vxlangpe.json @@ -0,0 +1,53 @@ +{ + "type" : "node", + "name" : "vxlangpe", + "layout" : [ + { + "name" : "reserved", + "size" : "2" + }, + { + "name" : "version", + "size" : "2" + }, + { + "name" : "i", + "size" : "1" + }, + { + "name" : "p", + "size" : "1" + }, + { + "name" : "b", + "size" : "1" + }, + { + "name" : "o", + "size" : "1" + }, + { + "name" : "reserved", + "size" : "16" + }, + { + "name" : "nextprotocol", + "size" : "8" + }, + { + "name" : "vni", + "size" : "24" + }, + { + "name" : "reserved", + "size" : "8" + } + ], + "attributes" : [ + { + "name" : "udpport", + "size" : "16", + "default" : "4790" + } + ] +} -- cgit 1.2.3-korg