packetforge: add packetforge for generic flow to extras 49/36149/21
authorTing Xu <ting.xu@intel.com>
Sun, 24 Apr 2022 06:14:25 +0000 (06:14 +0000)
committerDave Wallace <dwallacelf@gmail.com>
Tue, 20 Sep 2022 20:44:42 +0000 (20:44 +0000)
commitce4b6451787389c5b0ebfac413c350ef3a424b8b
treeaa777368e14fca9b6613f747817331336ca2b11b
parentf5e0a17c9cca09822296a0ed3196fde36c1ca5f8
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 <ting.xu@intel.com>
Change-Id: Ia9f539741c5dca27ff236f2bcc493c5dd48c0df1
98 files changed:
MAINTAINERS
extras/packetforge/Edge.py [new file with mode: 0644]
extras/packetforge/EdgeAction.py [new file with mode: 0644]
extras/packetforge/ExpressionConverter.py [new file with mode: 0644]
extras/packetforge/ForgeResult.py [new file with mode: 0644]
extras/packetforge/InputFormat.py [new file with mode: 0644]
extras/packetforge/LICENSE.txt [new file with mode: 0644]
extras/packetforge/Node.py [new file with mode: 0644]
extras/packetforge/NodeAttribute.py [new file with mode: 0644]
extras/packetforge/NodeField.py [new file with mode: 0644]
extras/packetforge/ParseGraph.py [new file with mode: 0644]
extras/packetforge/Path.py [new file with mode: 0644]
extras/packetforge/PathNode.py [new file with mode: 0644]
extras/packetforge/PathNodeField.py [new file with mode: 0644]
extras/packetforge/ProtocolHeader.py [new file with mode: 0644]
extras/packetforge/ProtocolHeaderAttribute.py [new file with mode: 0644]
extras/packetforge/ProtocolHeaderField.py [new file with mode: 0644]
extras/packetforge/README.rst [new file with mode: 0644]
extras/packetforge/StringFormat.py [new file with mode: 0644]
extras/packetforge/flow_create.py [new file with mode: 0644]
extras/packetforge/packetforge.py [new file with mode: 0644]
extras/packetforge/parsegraph/.gitattributes [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ah_after_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ah_after_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/arpv4_after_macvlan.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/esp_after_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/esp_after_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/gre_after_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/gre_after_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/gtpc_after_udp.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/gtppsc_after_gtpu.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/gtpu_after_udp.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/icmp_after_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/icmpv6_after_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ip_after_gtppsc.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ip_after_gtpu.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv4_after_geneve.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv4_after_gre.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv4_after_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv4_after_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv4_after_macvlan.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv4_after_vxlangpe.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv6_after_geneve.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv6_after_gre.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv6_after_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv6_after_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv6_after_macvlan.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv6_after_vxlangpe.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/ipv6srh_after_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/l2tpv2_after_udp.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/mac_after_geneve.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/mac_after_gre.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/mac_after_nvgre.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/mac_after_vxlan.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/mac_after_vxlangpe.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/pfcp_after_udp.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/sctp_after_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/sctp_after_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/tcp_after_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/tcp_after_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/tunnel_after_udp.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/udp_after_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/udp_after_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/edges/vlan_after_macvlan.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/ah.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/arpv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/esp.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/geneve.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/gre.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/gtpc.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/gtppsc.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/gtpu.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/icmp.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/icmpv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/ipv6crh16.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/ipv6crh32.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/ipv6srh.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/l2tpv2ctl.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/l2tpv2data.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/mac.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/nvgre.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/payload.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/pfcp.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/sctp.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/tcp.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/udp.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/vlan.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/vxlan.json [new file with mode: 0644]
extras/packetforge/parsegraph/nodes/vxlangpe.json [new file with mode: 0644]
extras/packetforge/parsegraph/samples/mac_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/samples/mac_ipv4_udp.json [new file with mode: 0644]
extras/packetforge/parsegraph/samples/mac_ipv4_udp_gtpu_gtppsc_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/samples/mac_ipv4_udp_vxlan_mac_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/samples/mac_ipv6.json [new file with mode: 0644]
extras/packetforge/parsegraph/samples/mac_vlan_ipv4.json [new file with mode: 0644]
extras/packetforge/parsegraph/spec.md [new file with mode: 0644]