summaryrefslogtreecommitdiff
path: root/lib/ofp-actions.h
diff options
context:
space:
mode:
authorJarno Rajahalme <jrajahalme@nicira.com>2013-10-24 13:19:25 -0700
committerBen Pfaff <blp@nicira.com>2013-11-01 14:07:40 -0700
commitca287d2062b348b2081e0d44ffcca38e071185c8 (patch)
treee868aacbadad716d4d17d6579650ac73c1ba480b /lib/ofp-actions.h
parent255842d95365dbe1737bcc39b0daf47ce7f84c0d (diff)
downloadopenvswitch-ca287d2062b348b2081e0d44ffcca38e071185c8.tar.gz
OF 1.1 set vlan vid/pcp compatibility.
OpenFlow 1.1 set vlan actions only modify existing vlan headers, while OF 1.0 actions push a new vlan header if one does not exist already. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/ofp-actions.h')
-rw-r--r--lib/ofp-actions.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h
index e097468ba..7be4e92ff 100644
--- a/lib/ofp-actions.h
+++ b/lib/ofp-actions.h
@@ -257,18 +257,32 @@ struct ofpact_bundle {
/* OFPACT_SET_VLAN_VID.
*
- * Used for OFPAT10_SET_VLAN_VID. */
+ * We keep track if vlan was present at action validation time to avoid a
+ * PUSH_VLAN when translating to OpenFlow 1.1+.
+ *
+ * We also keep the originating OFPUTIL action code in ofpact.compat.
+ *
+ * Used for OFPAT10_SET_VLAN_VID and OFPAT11_SET_VLAN_VID. */
struct ofpact_vlan_vid {
struct ofpact ofpact;
uint16_t vlan_vid; /* VLAN VID in low 12 bits, 0 in other bits. */
+ bool push_vlan_if_needed; /* OF 1.0 semantics if true. */
+ bool flow_has_vlan; /* VLAN present at action validation time? */
};
/* OFPACT_SET_VLAN_PCP.
*
- * Used for OFPAT10_SET_VLAN_PCP. */
+ * We keep track if vlan was present at action validation time to avoid a
+ * PUSH_VLAN when translating to OpenFlow 1.1+.
+ *
+ * We also keep the originating OFPUTIL action code in ofpact.compat.
+ *
+ * Used for OFPAT10_SET_VLAN_PCP and OFPAT11_SET_VLAN_PCP. */
struct ofpact_vlan_pcp {
struct ofpact ofpact;
uint8_t vlan_pcp; /* VLAN PCP in low 3 bits, 0 in other bits. */
+ bool push_vlan_if_needed; /* OF 1.0 semantics if true. */
+ bool flow_has_vlan; /* VLAN present at action validation time? */
};
/* OFPACT_SET_ETH_SRC, OFPACT_SET_ETH_DST.
@@ -563,7 +577,7 @@ enum ofperr ofpacts_pull_openflow11_instructions(struct ofpbuf *openflow,
enum ofp_version version,
unsigned int instructions_len,
struct ofpbuf *ofpacts);
-enum ofperr ofpacts_check(const struct ofpact[], size_t ofpacts_len,
+enum ofperr ofpacts_check(struct ofpact[], size_t ofpacts_len,
struct flow *, ofp_port_t max_ports,
uint8_t table_id, bool enforce_consistency);
enum ofperr ofpacts_verify(const struct ofpact ofpacts[], size_t ofpacts_len);