summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWilliam Tu <u9012063@gmail.com>2016-12-18 00:13:02 -0800
committerBen Pfaff <blp@ovn.org>2016-12-19 21:02:10 -0800
commit7ae62a676d3a754aa5a0dcb310eff6e1b93c91b9 (patch)
treeff8afcba14c0420db7babf453070d2166700ec22 /include
parent4b1a2aef1a0546d16cff25bfae2798256a3cdd5d (diff)
downloadopenvswitch-7ae62a676d3a754aa5a0dcb310eff6e1b93c91b9.tar.gz
ofp-actions: Add clone action.
This patch adds OpenFlow clone action with syntax as below: "clone([action][,action...])". The clone() action makes a copy of the current packet and executes the list of actions against the packet, without affecting the packet after the "clone(...)" action. In other word, the packet before the clone() and after the clone() is the same, no matter what actions executed inside the clone(). Use case 1: Set different fields and output to different ports without unset actions= clone(mod_dl_src:<mac1>, output:1), clone(mod_dl_dst:<mac2>, output:2), output:3 Since each clone() has independent packet, output:1 has only dl_src modified, output:2 has only dl_dst modified, output:3 has original packet. Similar to case1 actions= push_vlan(...), output:2, pop_vlan, push_vlan(...), output:3 can be changed to actions= clone(push_vlan(...), output:2),clone(push_vlan(...), output:3) without having to add pop_vlan. case 2: resubmit to another table without worrying packet being modified actions=clone(resubmit(1,2)), ... Signed-off-by: William Tu <u9012063@gmail.com> [blp@ovn.org revised this to omit the "sample" action] Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include')
-rw-r--r--include/openvswitch/ofp-actions.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/openvswitch/ofp-actions.h b/include/openvswitch/ofp-actions.h
index ecafbea4e..870e16f34 100644
--- a/include/openvswitch/ofp-actions.h
+++ b/include/openvswitch/ofp-actions.h
@@ -109,6 +109,7 @@
OFPACT(CT, ofpact_conntrack, ofpact, "ct") \
OFPACT(NAT, ofpact_nat, ofpact, "nat") \
OFPACT(OUTPUT_TRUNC, ofpact_output_trunc,ofpact, "output_trunc") \
+ OFPACT(CLONE, ofpact_nest, actions, "clone") \
\
/* Debugging actions. \
* \
@@ -532,9 +533,9 @@ struct ofpact_meter {
uint32_t meter_id;
};
-/* OFPACT_WRITE_ACTIONS.
+/* OFPACT_WRITE_ACTIONS, OFPACT_CLONE.
*
- * Used for OFPIT11_WRITE_ACTIONS. */
+ * Used for OFPIT11_WRITE_ACTIONS, NXAST_CLONE. */
struct ofpact_nest {
OFPACT_PADDED_MEMBERS(struct ofpact ofpact;);
struct ofpact actions[];