aboutsummaryrefslogtreecommitdiffstats
path: root/extras/packetforge/parsegraph
diff options
context:
space:
mode:
Diffstat (limited to 'extras/packetforge/parsegraph')
-rw-r--r--extras/packetforge/parsegraph/.gitattributes2
-rw-r--r--extras/packetforge/parsegraph/edges/ah_after_ipv4.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ah_after_ipv6.json11
-rw-r--r--extras/packetforge/parsegraph/edges/arpv4_after_macvlan.json11
-rw-r--r--extras/packetforge/parsegraph/edges/esp_after_ipv4.json11
-rw-r--r--extras/packetforge/parsegraph/edges/esp_after_ipv6.json11
-rw-r--r--extras/packetforge/parsegraph/edges/gre_after_ipv4.json11
-rw-r--r--extras/packetforge/parsegraph/edges/gre_after_ipv6.json11
-rw-r--r--extras/packetforge/parsegraph/edges/gtpc_after_udp.json11
-rw-r--r--extras/packetforge/parsegraph/edges/gtppsc_after_gtpu.json19
-rw-r--r--extras/packetforge/parsegraph/edges/gtpu_after_udp.json11
-rw-r--r--extras/packetforge/parsegraph/edges/icmp_after_ipv4.json11
-rw-r--r--extras/packetforge/parsegraph/edges/icmpv6_after_ipv6.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ip_after_gtppsc.json5
-rw-r--r--extras/packetforge/parsegraph/edges/ip_after_gtpu.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv4_after_geneve.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv4_after_gre.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv4_after_ipv4.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv4_after_ipv6.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv4_after_macvlan.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv4_after_vxlangpe.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv6_after_geneve.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv6_after_gre.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv6_after_ipv4.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv6_after_ipv6.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv6_after_macvlan.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv6_after_vxlangpe.json11
-rw-r--r--extras/packetforge/parsegraph/edges/ipv6srh_after_ipv6.json11
-rw-r--r--extras/packetforge/parsegraph/edges/l2tpv2_after_udp.json11
-rw-r--r--extras/packetforge/parsegraph/edges/mac_after_geneve.json11
-rw-r--r--extras/packetforge/parsegraph/edges/mac_after_gre.json5
-rw-r--r--extras/packetforge/parsegraph/edges/mac_after_nvgre.json5
-rw-r--r--extras/packetforge/parsegraph/edges/mac_after_vxlan.json5
-rw-r--r--extras/packetforge/parsegraph/edges/mac_after_vxlangpe.json11
-rw-r--r--extras/packetforge/parsegraph/edges/pfcp_after_udp.json11
-rw-r--r--extras/packetforge/parsegraph/edges/sctp_after_ipv4.json11
-rw-r--r--extras/packetforge/parsegraph/edges/sctp_after_ipv6.json11
-rw-r--r--extras/packetforge/parsegraph/edges/tcp_after_ipv4.json11
-rw-r--r--extras/packetforge/parsegraph/edges/tcp_after_ipv6.json11
-rw-r--r--extras/packetforge/parsegraph/edges/tunnel_after_udp.json11
-rw-r--r--extras/packetforge/parsegraph/edges/udp_after_ipv4.json11
-rw-r--r--extras/packetforge/parsegraph/edges/udp_after_ipv6.json11
-rw-r--r--extras/packetforge/parsegraph/edges/vlan_after_macvlan.json15
-rw-r--r--extras/packetforge/parsegraph/nodes/ah.json26
-rw-r--r--extras/packetforge/parsegraph/nodes/arpv4.json54
-rw-r--r--extras/packetforge/parsegraph/nodes/esp.json14
-rw-r--r--extras/packetforge/parsegraph/nodes/geneve.json51
-rw-r--r--extras/packetforge/parsegraph/nodes/gre.json56
-rw-r--r--extras/packetforge/parsegraph/nodes/gtpc.json48
-rw-r--r--extras/packetforge/parsegraph/nodes/gtppsc.json28
-rw-r--r--extras/packetforge/parsegraph/nodes/gtpu.json63
-rw-r--r--extras/packetforge/parsegraph/nodes/icmp.json18
-rw-r--r--extras/packetforge/parsegraph/nodes/icmpv6.json18
-rw-r--r--extras/packetforge/parsegraph/nodes/ipv4.json76
-rw-r--r--extras/packetforge/parsegraph/nodes/ipv6.json47
-rw-r--r--extras/packetforge/parsegraph/nodes/ipv6crh16.json36
-rw-r--r--extras/packetforge/parsegraph/nodes/ipv6crh32.json32
-rw-r--r--extras/packetforge/parsegraph/nodes/ipv6srh.json40
-rw-r--r--extras/packetforge/parsegraph/nodes/l2tpv2ctl.json74
-rw-r--r--extras/packetforge/parsegraph/nodes/l2tpv2data.json79
-rw-r--r--extras/packetforge/parsegraph/nodes/mac.json22
-rw-r--r--extras/packetforge/parsegraph/nodes/nvgre.json52
-rw-r--r--extras/packetforge/parsegraph/nodes/payload.json18
-rw-r--r--extras/packetforge/parsegraph/nodes/pfcp.json58
-rw-r--r--extras/packetforge/parsegraph/nodes/sctp.json22
-rw-r--r--extras/packetforge/parsegraph/nodes/tcp.json79
-rw-r--r--extras/packetforge/parsegraph/nodes/udp.json24
-rw-r--r--extras/packetforge/parsegraph/nodes/vlan.json30
-rw-r--r--extras/packetforge/parsegraph/nodes/vxlan.json33
-rw-r--r--extras/packetforge/parsegraph/nodes/vxlangpe.json53
-rw-r--r--extras/packetforge/parsegraph/samples/mac_ipv4.json24
-rw-r--r--extras/packetforge/parsegraph/samples/mac_ipv4_udp.json27
-rw-r--r--extras/packetforge/parsegraph/samples/mac_ipv4_udp_gtpu_gtppsc_ipv4.json43
-rw-r--r--extras/packetforge/parsegraph/samples/mac_ipv4_udp_vxlan_mac_ipv4.json43
-rw-r--r--extras/packetforge/parsegraph/samples/mac_ipv6.json44
-rw-r--r--extras/packetforge/parsegraph/samples/mac_vlan_ipv4.json34
-rw-r--r--extras/packetforge/parsegraph/spec.md533
77 files changed, 2351 insertions, 0 deletions
diff --git a/extras/packetforge/parsegraph/.gitattributes b/extras/packetforge/parsegraph/.gitattributes
new file mode 100644
index 00000000000..dfe0770424b
--- /dev/null
+++ b/extras/packetforge/parsegraph/.gitattributes
@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto
diff --git a/extras/packetforge/parsegraph/edges/ah_after_ipv4.json b/extras/packetforge/parsegraph/edges/ah_after_ipv4.json
new file mode 100644
index 00000000000..7f123916114
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ah_after_ipv4.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv4",
+ "end" : "ah",
+ "actions" : [
+ {
+ "dst" : "start.protocol",
+ "src" : "51"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ah_after_ipv6.json b/extras/packetforge/parsegraph/edges/ah_after_ipv6.json
new file mode 100644
index 00000000000..64620fa276b
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ah_after_ipv6.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv6,ipv6srh,ipv6crh16,ipv6crh32",
+ "end" : "ah",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "51"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/arpv4_after_macvlan.json b/extras/packetforge/parsegraph/edges/arpv4_after_macvlan.json
new file mode 100644
index 00000000000..28c042b9c93
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/arpv4_after_macvlan.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "mac,vlan",
+ "end" : "arpv4",
+ "actions" : [
+ {
+ "dst" : "start.ethertype",
+ "src" : "0x0806"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/esp_after_ipv4.json b/extras/packetforge/parsegraph/edges/esp_after_ipv4.json
new file mode 100644
index 00000000000..c573ee3aa28
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/esp_after_ipv4.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv4",
+ "end" : "esp",
+ "actions" : [
+ {
+ "dst" : "start.protocol",
+ "src" : "50"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/esp_after_ipv6.json b/extras/packetforge/parsegraph/edges/esp_after_ipv6.json
new file mode 100644
index 00000000000..e3d8bf660d3
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/esp_after_ipv6.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv6,ipv6srh,ipv6crh16,ipv6crh32",
+ "end" : "esp",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "50"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/gre_after_ipv4.json b/extras/packetforge/parsegraph/edges/gre_after_ipv4.json
new file mode 100644
index 00000000000..5ae8eb27681
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/gre_after_ipv4.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv4",
+ "end" : "gre,nvgre",
+ "actions" : [
+ {
+ "dst" : "start.protocol",
+ "src" : "47"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/gre_after_ipv6.json b/extras/packetforge/parsegraph/edges/gre_after_ipv6.json
new file mode 100644
index 00000000000..a5a53139de3
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/gre_after_ipv6.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv6,ipv6srh,ipv6crh16,ipv6crh32",
+ "end" : "gre,nvgre",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "47"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/gtpc_after_udp.json b/extras/packetforge/parsegraph/edges/gtpc_after_udp.json
new file mode 100644
index 00000000000..237704c87cc
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/gtpc_after_udp.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "udp",
+ "end" : "gtpc",
+ "actions" : [
+ {
+ "dst" : "start.dst",
+ "src" : "2123"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/gtppsc_after_gtpu.json b/extras/packetforge/parsegraph/edges/gtppsc_after_gtpu.json
new file mode 100644
index 00000000000..ec985bb888f
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/gtppsc_after_gtpu.json
@@ -0,0 +1,19 @@
+{
+ "type" : "edge",
+ "start" : "gtpu",
+ "end" : "gtppsc",
+ "actions" : [
+ {
+ "dst" : "start.e",
+ "src" : "1"
+ },
+ {
+ "dst" : "start.nextextentionheadertype",
+ "src" : "0x85"
+ },
+ {
+ "dst" : "start.messagetype",
+ "src" : "0xff"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/gtpu_after_udp.json b/extras/packetforge/parsegraph/edges/gtpu_after_udp.json
new file mode 100644
index 00000000000..e2591fad5ac
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/gtpu_after_udp.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "udp",
+ "end" : "gtpu",
+ "actions" : [
+ {
+ "dst" : "start.dst",
+ "src" : "2152"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/icmp_after_ipv4.json b/extras/packetforge/parsegraph/edges/icmp_after_ipv4.json
new file mode 100644
index 00000000000..e701cc8c28c
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/icmp_after_ipv4.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv4",
+ "end" : "icmp",
+ "actions" : [
+ {
+ "dst" : "start.protocol",
+ "src" : "1"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/icmpv6_after_ipv6.json b/extras/packetforge/parsegraph/edges/icmpv6_after_ipv6.json
new file mode 100644
index 00000000000..a83181450ad
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/icmpv6_after_ipv6.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv6,ipv6srh,ipv6crh16,ipv6crh32",
+ "end" : "icmpv6",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "58"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ip_after_gtppsc.json b/extras/packetforge/parsegraph/edges/ip_after_gtppsc.json
new file mode 100644
index 00000000000..13e11a3c67a
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ip_after_gtppsc.json
@@ -0,0 +1,5 @@
+{
+ "type" : "edge",
+ "start" : "gtppsc",
+ "end" : "ipv4"
+}
diff --git a/extras/packetforge/parsegraph/edges/ip_after_gtpu.json b/extras/packetforge/parsegraph/edges/ip_after_gtpu.json
new file mode 100644
index 00000000000..03d89ffc4b9
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ip_after_gtpu.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "gtpu",
+ "end" : "ipv4,ipv6",
+ "actions" : [
+ {
+ "dst" : "start.messagetype",
+ "src" : "0xff"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv4_after_geneve.json b/extras/packetforge/parsegraph/edges/ipv4_after_geneve.json
new file mode 100644
index 00000000000..40c733b9688
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv4_after_geneve.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "geneve",
+ "end" : "ipv4",
+ "actions" : [
+ {
+ "dst" : "start.protocoltype",
+ "src" : "0x0800"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv4_after_gre.json b/extras/packetforge/parsegraph/edges/ipv4_after_gre.json
new file mode 100644
index 00000000000..87cd14beecd
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv4_after_gre.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "gre",
+ "end" : "ipv4",
+ "actions" : [
+ {
+ "dst" : "start.protocoltype",
+ "src" : "0x0800"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv4_after_ipv4.json b/extras/packetforge/parsegraph/edges/ipv4_after_ipv4.json
new file mode 100644
index 00000000000..0590f6738b3
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv4_after_ipv4.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv4",
+ "end" : "ipv4",
+ "actions" : [
+ {
+ "dst" : "start.protocol",
+ "src" : "4"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv4_after_ipv6.json b/extras/packetforge/parsegraph/edges/ipv4_after_ipv6.json
new file mode 100644
index 00000000000..e804139cfe5
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv4_after_ipv6.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv6,ipv6srh,ipv6crh16,ipv6crh32",
+ "end" : "ipv4",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "4"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv4_after_macvlan.json b/extras/packetforge/parsegraph/edges/ipv4_after_macvlan.json
new file mode 100644
index 00000000000..3722126f6f4
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv4_after_macvlan.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "mac,vlan",
+ "end" : "ipv4",
+ "actions" : [
+ {
+ "dst" : "start.ethertype",
+ "src" : "0x0800"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv4_after_vxlangpe.json b/extras/packetforge/parsegraph/edges/ipv4_after_vxlangpe.json
new file mode 100644
index 00000000000..ab7c16707fb
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv4_after_vxlangpe.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "vxlangpe",
+ "end" : "ipv4",
+ "actions" : [
+ {
+ "dst" : "start.nextprotocol",
+ "src" : "1"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv6_after_geneve.json b/extras/packetforge/parsegraph/edges/ipv6_after_geneve.json
new file mode 100644
index 00000000000..6ad81a4550a
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv6_after_geneve.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "geneve",
+ "end" : "ipv6",
+ "actions" : [
+ {
+ "dst" : "start.protocoltype",
+ "src" : "0x86dd"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv6_after_gre.json b/extras/packetforge/parsegraph/edges/ipv6_after_gre.json
new file mode 100644
index 00000000000..90c40ec3974
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv6_after_gre.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "gre",
+ "end" : "ipv6",
+ "actions" : [
+ {
+ "dst" : "start.protocoltype",
+ "src" : "0x86dd"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv6_after_ipv4.json b/extras/packetforge/parsegraph/edges/ipv6_after_ipv4.json
new file mode 100644
index 00000000000..cc57b44cf25
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv6_after_ipv4.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv4",
+ "end" : "ipv6",
+ "actions" : [
+ {
+ "dst" : "start.protocol",
+ "src" : "41"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv6_after_ipv6.json b/extras/packetforge/parsegraph/edges/ipv6_after_ipv6.json
new file mode 100644
index 00000000000..79184bb55dd
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv6_after_ipv6.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv6,ipv6srh,ipv6crh16,ipv6crh32",
+ "end" : "ipv6",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "41"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv6_after_macvlan.json b/extras/packetforge/parsegraph/edges/ipv6_after_macvlan.json
new file mode 100644
index 00000000000..6da21082024
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv6_after_macvlan.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "mac,vlan",
+ "end" : "ipv6",
+ "actions" : [
+ {
+ "dst" : "start.ethertype",
+ "src" : "0x86dd"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv6_after_vxlangpe.json b/extras/packetforge/parsegraph/edges/ipv6_after_vxlangpe.json
new file mode 100644
index 00000000000..ebd294cf378
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv6_after_vxlangpe.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "vxlangpe",
+ "end" : "ipv6",
+ "actions" : [
+ {
+ "dst" : "start.nextprotocol",
+ "src" : "2"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/ipv6srh_after_ipv6.json b/extras/packetforge/parsegraph/edges/ipv6srh_after_ipv6.json
new file mode 100644
index 00000000000..9ddea00e926
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/ipv6srh_after_ipv6.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv6,ipv6srh,ipv6crh16,ipv6crh32",
+ "end" : "ipv6srh",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "43"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/l2tpv2_after_udp.json b/extras/packetforge/parsegraph/edges/l2tpv2_after_udp.json
new file mode 100644
index 00000000000..c34927ac47f
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/l2tpv2_after_udp.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "udp",
+ "end" : "l2tpv2ctl,l2tpv2data",
+ "actions" : [
+ {
+ "dst" : "start.dst",
+ "src" : "1701"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/mac_after_geneve.json b/extras/packetforge/parsegraph/edges/mac_after_geneve.json
new file mode 100644
index 00000000000..3eba08ee802
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/mac_after_geneve.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "geneve",
+ "end" : "mac",
+ "actions" : [
+ {
+ "dst" : "start.protocoltype",
+ "src" : "0x6558"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/mac_after_gre.json b/extras/packetforge/parsegraph/edges/mac_after_gre.json
new file mode 100644
index 00000000000..cb5fd4078e5
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/mac_after_gre.json
@@ -0,0 +1,5 @@
+{
+ "type" : "edge",
+ "start" : "gre",
+ "end" : "mac"
+}
diff --git a/extras/packetforge/parsegraph/edges/mac_after_nvgre.json b/extras/packetforge/parsegraph/edges/mac_after_nvgre.json
new file mode 100644
index 00000000000..1c9f98373bf
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/mac_after_nvgre.json
@@ -0,0 +1,5 @@
+{
+ "type" : "edge",
+ "start" : "nvgre",
+ "end" : "mac"
+}
diff --git a/extras/packetforge/parsegraph/edges/mac_after_vxlan.json b/extras/packetforge/parsegraph/edges/mac_after_vxlan.json
new file mode 100644
index 00000000000..c1c1fa25540
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/mac_after_vxlan.json
@@ -0,0 +1,5 @@
+{
+ "type" : "edge",
+ "start" : "vxlan",
+ "end" : "mac"
+}
diff --git a/extras/packetforge/parsegraph/edges/mac_after_vxlangpe.json b/extras/packetforge/parsegraph/edges/mac_after_vxlangpe.json
new file mode 100644
index 00000000000..b5012bf71fb
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/mac_after_vxlangpe.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "vxlangpe",
+ "end" : "mac",
+ "actions" : [
+ {
+ "dst" : "start.nextprotocol",
+ "src" : "3"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/pfcp_after_udp.json b/extras/packetforge/parsegraph/edges/pfcp_after_udp.json
new file mode 100644
index 00000000000..fec4aaa739e
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/pfcp_after_udp.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "udp",
+ "end" : "pfcp",
+ "actions" : [
+ {
+ "dst" : "start.dst",
+ "src" : "8805"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/sctp_after_ipv4.json b/extras/packetforge/parsegraph/edges/sctp_after_ipv4.json
new file mode 100644
index 00000000000..e58c36efc7a
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/sctp_after_ipv4.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv4",
+ "end" : "sctp",
+ "actions" : [
+ {
+ "dst" : "start.protocol",
+ "src" : "132"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/sctp_after_ipv6.json b/extras/packetforge/parsegraph/edges/sctp_after_ipv6.json
new file mode 100644
index 00000000000..7fa306811eb
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/sctp_after_ipv6.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv6",
+ "end" : "sctp",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "132"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/tcp_after_ipv4.json b/extras/packetforge/parsegraph/edges/tcp_after_ipv4.json
new file mode 100644
index 00000000000..13c74f85edc
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/tcp_after_ipv4.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv4",
+ "end" : "tcp",
+ "actions" : [
+ {
+ "dst" : "start.protocol",
+ "src" : "6"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/tcp_after_ipv6.json b/extras/packetforge/parsegraph/edges/tcp_after_ipv6.json
new file mode 100644
index 00000000000..f0d0b415e22
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/tcp_after_ipv6.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv6,ipv6srh,ipv6crh16,ipv6crh32",
+ "end" : "tcp",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "6"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/tunnel_after_udp.json b/extras/packetforge/parsegraph/edges/tunnel_after_udp.json
new file mode 100644
index 00000000000..fa498d4378e
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/tunnel_after_udp.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "udp",
+ "end" : "geneve,vxlan,vxlangpe",
+ "actions" : [
+ {
+ "dst" : "start.dst",
+ "src" : "end.udpport"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/udp_after_ipv4.json b/extras/packetforge/parsegraph/edges/udp_after_ipv4.json
new file mode 100644
index 00000000000..cb2f533bd39
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/udp_after_ipv4.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv4",
+ "end" : "udp",
+ "actions" : [
+ {
+ "dst" : "start.protocol",
+ "src" : "17"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/udp_after_ipv6.json b/extras/packetforge/parsegraph/edges/udp_after_ipv6.json
new file mode 100644
index 00000000000..fbbe972e4e5
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/udp_after_ipv6.json
@@ -0,0 +1,11 @@
+{
+ "type" : "edge",
+ "start" : "ipv6,ipv6srh,ipv6crh16,ipv6crh32",
+ "end" : "udp",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "17"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/edges/vlan_after_macvlan.json b/extras/packetforge/parsegraph/edges/vlan_after_macvlan.json
new file mode 100644
index 00000000000..5c0b81ebacf
--- /dev/null
+++ b/extras/packetforge/parsegraph/edges/vlan_after_macvlan.json
@@ -0,0 +1,15 @@
+{
+ "type" : "edge",
+ "start" : "mac,vlan",
+ "end" : "vlan",
+ "actions" : [
+ {
+ "dst" : "start.ethertype",
+ "src" : "end.tpid"
+ },
+ {
+ "dst" : "end.ethertype",
+ "src" : "start.ethertype"
+ }
+ ]
+}
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"
+ }
+ ]
+}
diff --git a/extras/packetforge/parsegraph/samples/mac_ipv4.json b/extras/packetforge/parsegraph/samples/mac_ipv4.json
new file mode 100644
index 00000000000..c0a8d18177d
--- /dev/null
+++ b/extras/packetforge/parsegraph/samples/mac_ipv4.json
@@ -0,0 +1,24 @@
+{
+ "type" : "path",
+ "stack" : [
+ {
+ "header" : "mac"
+ },
+ {
+ "header" : "ipv4",
+ "fields" : [
+ {
+ "name" : "src",
+ "value" : "1.1.1.1",
+ "mask" : "255.255.255.255"
+ },
+ {
+ "name" : "dst",
+ "value" : "2.2.2.2",
+ "mask" : "255.255.255.255"
+ }
+ ]
+ }
+ ],
+ "actions" : "redirect-to-queue 3"
+}
diff --git a/extras/packetforge/parsegraph/samples/mac_ipv4_udp.json b/extras/packetforge/parsegraph/samples/mac_ipv4_udp.json
new file mode 100644
index 00000000000..7df27cfdf12
--- /dev/null
+++ b/extras/packetforge/parsegraph/samples/mac_ipv4_udp.json
@@ -0,0 +1,27 @@
+{
+ "type" : "path",
+ "stack" : [
+ {
+ "header" : "mac"
+ },
+ {
+ "header" : "ipv4",
+ "fields" : [
+ {
+ "name" : "src",
+ "value" : "1.1.1.1",
+ "mask" : "255.255.255.255"
+ },
+ {
+ "name" : "dst",
+ "value" : "2.2.2.2",
+ "mask" : "255.255.255.255"
+ }
+ ]
+ },
+ {
+ "header" : "udp"
+ }
+ ],
+ "actions" : "rss"
+} \ No newline at end of file
diff --git a/extras/packetforge/parsegraph/samples/mac_ipv4_udp_gtpu_gtppsc_ipv4.json b/extras/packetforge/parsegraph/samples/mac_ipv4_udp_gtpu_gtppsc_ipv4.json
new file mode 100644
index 00000000000..39a8d6159b4
--- /dev/null
+++ b/extras/packetforge/parsegraph/samples/mac_ipv4_udp_gtpu_gtppsc_ipv4.json
@@ -0,0 +1,43 @@
+{
+ "type" : "path",
+ "stack" : [
+ {
+ "header" : "mac"
+ },
+ {
+ "header" : "ipv4"
+ },
+ {
+ "header" : "udp"
+ },
+ {
+ "header" : "gtpu",
+ "fields" : [
+ {
+ "name" : "teid",
+ "value" : "32",
+ "mask" : "0xffffffff"
+ }
+ ]
+ },
+ {
+ "header" : "gtppsc"
+ },
+ {
+ "header" : "ipv4",
+ "fields" : [
+ {
+ "name" : "src",
+ "value" : "1.1.1.1",
+ "mask" : "255.255.255.255"
+ },
+ {
+ "name" : "dst",
+ "value" : "2.2.2.2",
+ "mask" : "255.255.255.255"
+ }
+ ]
+ }
+ ],
+ "actions" : "rss"
+}
diff --git a/extras/packetforge/parsegraph/samples/mac_ipv4_udp_vxlan_mac_ipv4.json b/extras/packetforge/parsegraph/samples/mac_ipv4_udp_vxlan_mac_ipv4.json
new file mode 100644
index 00000000000..346dcd27fcb
--- /dev/null
+++ b/extras/packetforge/parsegraph/samples/mac_ipv4_udp_vxlan_mac_ipv4.json
@@ -0,0 +1,43 @@
+{
+ "type" : "path",
+ "stack" : [
+ {
+ "header" : "mac"
+ },
+ {
+ "header" : "ipv4"
+ },
+ {
+ "header" : "udp"
+ },
+ {
+ "header" : "vxlan",
+ "fields" : [
+ {
+ "name" : "vni",
+ "value" : "100",
+ "mask" : "0xffffff"
+ }
+ ]
+ },
+ {
+ "header" : "mac"
+ },
+ {
+ "header" : "ipv4",
+ "fields" : [
+ {
+ "name" : "src",
+ "value" : "1.1.1.1",
+ "mask" : "255.255.255.255"
+ },
+ {
+ "name" : "dst",
+ "value" : "2.2.2.2",
+ "mask" : "255.255.255.255"
+ }
+ ]
+ }
+ ],
+ "actions" : "rss"
+}
diff --git a/extras/packetforge/parsegraph/samples/mac_ipv6.json b/extras/packetforge/parsegraph/samples/mac_ipv6.json
new file mode 100644
index 00000000000..17b6490c099
--- /dev/null
+++ b/extras/packetforge/parsegraph/samples/mac_ipv6.json
@@ -0,0 +1,44 @@
+{
+ "type" : "path",
+ "stack" : [
+ {
+ "header" : "mac",
+ "fields" : [
+ {
+ "name" : "src",
+ "value" : "00:00:00:00:00:01",
+ "mask" : "ff:ff:ff:ff:ff:ff"
+ },
+ {
+ "name" : "dst",
+ "value" : "00:00:00:00:00:02",
+ "mask" : "ff:ff:ff:ff:ff:ff"
+ },
+ {
+ "name" : "ethertype",
+ "value" : "0x2345"
+ }
+ ]
+ },
+ {
+ "header" : "ipv6",
+ "fields" : [
+ {
+ "name" : "flowlabel",
+ "value" : "1"
+ },
+ {
+ "name" : "src",
+ "value" : "0001:0002:0003:0004:0005:0006:0007:0008",
+ "mask" : "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
+ },
+ {
+ "name" : "dst",
+ "value" : "0001:0002:0003:0004:0005:0006:0007:0008",
+ "mask" : "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
+ }
+ ]
+ }
+ ],
+ "actions" : "rss"
+}
diff --git a/extras/packetforge/parsegraph/samples/mac_vlan_ipv4.json b/extras/packetforge/parsegraph/samples/mac_vlan_ipv4.json
new file mode 100644
index 00000000000..7905133a8e0
--- /dev/null
+++ b/extras/packetforge/parsegraph/samples/mac_vlan_ipv4.json
@@ -0,0 +1,34 @@
+{
+ "type" : "path",
+ "stack" : [
+ {
+ "header" : "mac"
+ },
+ {
+ "header" : "vlan",
+ "fields" : [
+ {
+ "name" : "vid",
+ "value" : "100",
+ "mask" : "0xfff"
+ }
+ ]
+ },
+ {
+ "header" : "ipv4",
+ "fields" : [
+ {
+ "name" : "src",
+ "value" : "1.1.1.1",
+ "mask" : "255.255.255.255"
+ },
+ {
+ "name" : "dst",
+ "value" : "2.2.2.2",
+ "mask" : "255.255.255.255"
+ }
+ ]
+ }
+ ],
+ "actions" : "rss"
+}
diff --git a/extras/packetforge/parsegraph/spec.md b/extras/packetforge/parsegraph/spec.md
new file mode 100644
index 00000000000..93ff7791f20
--- /dev/null
+++ b/extras/packetforge/parsegraph/spec.md
@@ -0,0 +1,533 @@
+#### Packet Forger JSON Specification Rev 0.1
+
+### 0. Change Logs
+
+2021-10, initialized by Zhang, Qi
+
+### 1. Parse Graph
+
+A Parse Graph is a unidirectional graph. It is consist of a set of nodes and edges. A node represent a network protocol header, and an edge represent the linkage of two protocol headers which is adjacent in the packet. An example of a parse graph have 5 nodes and 6 edges.
+
+[![](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBKChNQUMpKSAtLT4gQigoSVB2NCkpXG4gICAgQSgoTUFDKSkgLS0-IEMoKElQdjYpKVxuICAgIEIgLS0-IEQoKFRDUCkpXG4gICAgQyAtLT4gRCgoVENQKSlcbiAgICBCIC0tPiBFKChVRFApKVxuICAgIEMgLS0-IEUoKFVEUCkpXG4gICAgIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRhcmsifSwidXBkYXRlRWRpdG9yIjpmYWxzZSwiYXV0b1N5bmMiOnRydWUsInVwZGF0ZURpYWdyYW0iOmZhbHNlfQ)](https://mermaid-js.github.io/mermaid-live-editor/edit#eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBKChNQUMpKSAtLT4gQigoSVB2NCkpXG4gICAgQSgoTUFDKSkgLS0-IEMoKElQdjYpKVxuICAgIEIgLS0-IEQoKFRDUCkpXG4gICAgQyAtLT4gRCgoVENQKSlcbiAgICBCIC0tPiBFKChVRFApKVxuICAgIEMgLS0-IEUoKFVEUCkpXG4gICAgIiwibWVybWFpZCI6IntcbiAgXCJ0aGVtZVwiOiBcImRhcmtcIlxufSIsInVwZGF0ZUVkaXRvciI6ZmFsc2UsImF1dG9TeW5jIjp0cnVlLCJ1cGRhdGVEaWFncmFtIjpmYWxzZX0)
+
+A Node or an Edge is described by a json object. There is no json representation for a parse graph, software should load all json objects of nodes and edges then build the parse graph logic in memory.
+
+### 2. Node
+
+A json object of Node will include below properties:
+
+* **type**
+
+ This should always be "node".
+
+* **name**
+
+ This is the name of the protocol.
+
+* **layout**
+
+ This is an array of fields in the protocol header which also imply the bit order. For example, json object of mac header as below:
+ ```
+ {
+ "type" : "node",
+ "name" : "mac",
+ "layout" : [
+ {
+ "name" : "src",
+ "size" : "48",
+ "format" : "mac",
+ },
+ {
+ "name" : "dst",
+ "size" : "48",
+ "format" : "mac",
+ },
+ {
+ "name" : "ethertype",
+ "size" : "16",
+ }
+ ]
+ }
+ ```
+
+ For each field, there are properties can be defined:
+
+ * **name**
+
+ The name of the field, typically it should be unique to all fields in the same node, except when it is "reserved".
+
+ * **size**
+
+ Size of the field, note, the unit is "bit" but not "byte".
+ Sometime a field's size can be decided by another field's value, for example, a geneve header's "options" field's size is decided by "optlen" field's value, so we have below:
+
+ ```
+ "name" : "geneve",
+ "layout" : [
+
+ ......
+
+ {
+ "name" : "reserved",
+ "size" : "8"
+ },
+ {
+ "name" : "options",
+ "size" : "optlen<<5"
+ }
+ ],
+ ```
+ Since when "optlen" increases 1 which means 4 bytes (32 bits) increase of "options"'s size so the bit value should shift left 5.
+
+ * **format**
+
+ Defined the input string format of the value, all formats are described in the section **Input Format** which also described the default format if it is not explicitly defined.
+
+ * **default**
+
+ Defined the default value of the field when a protocol header instance is created by the node. If not defined, the default value is always 0. The default value can be overwritten when forging a packet with specific value of the field. For example, we defined the default ipv4 address as below:
+
+ ```
+ "name" : "ipv4",
+ "layout" : [
+
+ ......
+
+ {
+ "name" : "src",
+ "size" : "32",
+ "format" : "ipv4",
+ "default" : "1.1.1.1"
+ },
+ {
+ "name" : "dst",
+ "size" : "32",
+ "format" : "ipv4",
+ "default" : "2.2.2.2"
+ }
+ ]
+ ```
+
+ * **readonly**
+
+ Define if a field is read only or not, typically it will be used together with "default". For example, the version of IPv4 header should be 4 and can't be overwritten.
+
+ ```
+ "name" : "ipv4",
+ "layout" : [
+ {
+ "name" : "version",
+ "size" : "4",
+ "default" : "4",
+ "readonly" : "true"
+ },
+ ......
+ ],
+ ```
+ A reserved field implies it is "readonly" and should always be 0.
+
+ * **optional**
+
+ A field could be optional depends on some flag as another field. For example, the GRE header has couple optional fields.
+
+ ```
+ "name" : "gre",
+ "layout" : [
+ {
+ "name" : "c",
+ "size" : "1",
+ },
+ {
+ "name" : "reserved",
+ "size" : "1",
+ },
+ {
+ "name" : "k",
+ "size" : "1",
+ },
+ {
+ "name" : "s",
+ "size" : "1",
+ },
+
+ ......
+
+ {
+ "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"
+ }
+ ]
+ ```
+
+ The expresion of an optional field can use "**&**" or "**|**" combine multiple conditions, for example for gtpu header, we have below optional fields.
+
+ ```
+ "name" : "gtpu",
+ "layout" : [
+
+ ......
+
+ {
+ "name" : "e",
+ "size" : "1"
+ },
+ {
+ "name" : "s",
+ "size" : "1"
+ },
+ {
+ "name" : "pn",
+ "size" : "1"
+ },
+
+ ......
+
+ {
+ "name" : "teid",
+ "size" : "16"
+ },
+ {
+ "name" : "sequencenumber",
+ "size" : "16",
+ "optional" : "e=1|s=1|pn=1",
+ },
+
+ ......
+ ]
+
+ ```
+
+ * **autoincrease**
+
+ Some field's value cover the length of the payload or size of an optional field in the same header, so it should be auto increased during packet forging. For example the "totallength" of ipv4 header is a autoincrease feild.
+
+ ```
+ "name" : "ipv4",
+ "layout" : [
+
+ ......
+
+ {
+ "name" : "totallength",
+ "size" : "16",
+ "default" : "20",
+ "autoincrease" : "true",
+ },
+
+ ......
+
+ ]
+ ```
+
+ A field which is autoincrease also imply its readonly.
+
+ * **increaselength**
+
+ Typically this should only be enabled for an optional field to trigger another field's autoincrease. For example, the gtpc's "messagelength" field cover all the data start from field "teid", so its default size is 4 bytes which cover sequencenumber + 8 reserved bit, and should be increased if "teid" exist or any payload be appended.
+
+ ```
+ "name" : "gtpc",
+ "layout" : [
+
+ ......
+
+ {
+ "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",
+ }
+ ]
+ ```
+
+* **attributes**
+
+ This defines an array of attributes, the attribute does not define the data belongs to current protocol header, but it impact the behaviour during applying actions of an edge when the protocol header is involved. For example, a geneve node has attribute "udpport" which define the udp tunnel port, so when it is appended after a udp header, the udp header's dst port is expected to be changed to this value.
+
+ ```
+ "name" : "geneve",
+
+ "fields" : [
+
+ ......
+
+ ],
+ "attributes" : [
+ {
+ "name" : "udpport",
+ "size" : "16",
+ "default" : "6081"
+ }
+ ]
+ ```
+
+ An attribute can only have below properties which take same effect when they are in field.
+
+ * name
+ * size (must be fixed value)
+ * default
+ * format
+
+### 3. Edge
+
+ A json object of Edge will include below properties:
+
+ * **type**
+
+ This should always be "edge".
+
+ * **start**
+
+ This is the start node of the edge.
+
+ * **end**
+
+ This is the end node of the edge.
+
+ * **actions**
+
+ This is an array of actions the should be applied during packet forging.
+ For example, when append a ipv4 headers after a mac header, the "ethertype" field of mac should be set to "0x0800":
+
+ ```
+ {
+ "type" : "edge",
+ "start" : "mac",
+ "end" : "ipv4",
+ "actions" : [
+ {
+ "dst" : "start.ethertype",
+ "src" : "0x0800"
+ }
+ ]
+ }
+ ```
+ Each action should have two properties:
+
+ * **dst**
+
+ This describe the target field to set, it is formatted as <node>.<field>
+ node must be "start" or "end".
+
+ * **src**
+
+ This describe the value to set, it could be a const value or same format as dst's.
+ For example when append a vlan header after mac, we will have below actions:
+
+ ```
+ {
+ "type" : "edge",
+ "start" : "mac",
+ "end" : "vlan",
+ "actions" : [
+ {
+ "dst" : "start.ethertype",
+ "src" : "end.tpid"
+ },
+ {
+ "dst" : "end.ethertype",
+ "src" : "start.ethertype"
+ }
+ ]
+ }
+ ```
+
+
+ To avoid duplication, multiple edges can be aggregate into the one json object if there actions are same. So, multiple node name can be added to **start** or **end** with seperateor "**,**".
+
+ For example, all ipv6 and ipv6 extention header share the same actions when append a udp header
+
+ ```
+ {
+ "type" : "edge",
+ "start" : "ipv6,ipv6srh,ipv6crh16,ipv6crh32",
+ "end" : "udp",
+ "actions" : [
+ {
+ "dst" : "start.nextheader",
+ "src" : "17"
+ }
+ ]
+ }
+ ```
+
+ Another examples is gre and nvgre share the same actions when be appanded after a ipv4 header:
+ ```
+ {
+ "type" : "edge",
+ "start" : "ipv4",
+ "end" : "gre,nvgre",
+ "actions" : [
+ {
+ "dst" : "start.protocol",
+ "src" : "47"
+ }
+ ]
+ }
+ ```
+
+### 4. Path
+
+A path defines a sequence of nodes which is the input parameter for a packet forging, a packet forging should fail if the path can't be recognised as a subgraph of the parser graph.
+
+A json object of a path should include below properties:
+
+* **type**
+
+ This should always be "path".
+
+* **stack**
+
+ This is an array of node configurations which also imply the protocol header sequence of a packet. Below is an example to forge an ipv4 / udp packet with default value.
+
+ ```
+ {
+ "type" : "path",
+ "stack" : [
+ {
+ "header" : "mac"
+ },
+ {
+ "header" : "ipv4"
+ },
+ {
+ "header" : "udp"
+ },
+ ]
+ }
+ ```
+
+ A node configuration can have below properties:
+
+ * **header**
+
+ This is a protocol name (a node name).
+
+ * **fields**
+
+ This is an array of 3 member tuples:
+
+ * **name**
+
+ The name of the field or attribute that belongs to the node, note a readonly field should not be selected.
+
+ * **value**
+
+ The value to set the field or attribute.
+
+ * **mask**
+
+ This is optional, if it is not defined, corresponding bit of the mask should be set to 0, and it should be ignored for an attribute.
+
+* **actions**
+
+ This is optional. When this json file is the input of flow adding commands, it can be used directly as the flow rule's action.
+
+ An example to forge a ipv4 packet with src ip address 192.168.0.1 and dst ip address 192.168.0.2, also take ip address as mask.
+
+ ```
+ {
+ "type" : "path",
+ "stack" : [
+ {
+ "header" : "mac",
+ },
+ {
+ "header" : "ipv4",
+ "fields" : [
+ {
+ "name" : "src",
+ "value" : "192.168.0.1",
+ "mask" : "255.255.255.255"
+ },
+ {
+ "name" : "dst",
+ "value" : "192.168.0.2",
+ "mask" : "255.255.255.255"
+ }
+ ]
+ }
+ ],
+ "actions" : "redirect-to-queue 3"
+ }
+ ```
+
+
+### 5. Input Format
+
+Every field or attribute is associated with an **Input Format**, so the software can figure out how to parse default value in the node or a config value in the path.
+
+Currently we have 8 predefined format and don't support customised format.
+
+* **u8**
+
+ accept number from 0 to 255 or hex from 0x0 to 0xff.
+
+* **u16**
+
+ accept number from 0 to 65535 or hex from 0x0 to 0xffff.
+
+* **u32**
+
+ accept number from 0 to 4294967295 or hex from 0x0 to 0xffffffff
+
+* **u64**
+
+ accept number from 0 to 2^64 -1 or hex from 0x0 to 0xffffffffffffffff
+
+* **mac**
+
+ accept xx:xx:xx:xx:xx:xx , x in hex from 0 to f
+
+* **ipv4**
+
+ accept n.n.n.n , n from 0 to 255
+
+* **ipv6**
+
+ accept xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx, x in hex from 0 to f
+
+* **bytearray**
+
+ accept u8,u8,u8.....
+
+If format is not defined for a field or attribute, the default format will be selected base on size as below, and the MSB should be ignored by software if the value exceeds the limitation.
+
+| Size | Default Format |
+| ------------- | -------------- |
+| 1 - 8 | u8 |
+| 9 - 16 | u16 |
+| 17 - 32 | u32 |
+| 33 - 64 | u64 |
+| > 64 | bytearray |
+| variable size | bytearray |