aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarno Rajahalme <jrajahalme@nicira.com>2013-10-16 16:16:03 -0700
committerBen Pfaff <blp@nicira.com>2013-10-17 11:47:52 -0700
commite45e72f1de0e50c4f11e9a2351f5135c002dcce3 (patch)
treefa1a8e3a5ad5b0529852444f18c76ac99324effe
parent5a0a5702555d22f9a4d86739455516723cd5ba08 (diff)
include/openflow: Move union ofp_action away from headers.
union ofp_action cannot remain in the OF 1.0 header as it is expanded to include actions from later versions. Also, it is not part of the protocol interface and will be easier to update where it is actually used. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--include/openflow/openflow-1.0.h13
-rw-r--r--lib/ofp-actions.c13
-rw-r--r--lib/ofp-util.h1
3 files changed, 14 insertions, 13 deletions
diff --git a/include/openflow/openflow-1.0.h b/include/openflow/openflow-1.0.h
index ef0a3ce7..34d97c4c 100644
--- a/include/openflow/openflow-1.0.h
+++ b/include/openflow/openflow-1.0.h
@@ -201,19 +201,6 @@ struct ofp10_action_enqueue {
};
OFP_ASSERT(sizeof(struct ofp10_action_enqueue) == 16);
-union ofp_action {
- ovs_be16 type;
- struct ofp_action_header header;
- struct ofp_action_vendor_header vendor;
- struct ofp10_action_output output10;
- struct ofp_action_vlan_vid vlan_vid;
- struct ofp_action_vlan_pcp vlan_pcp;
- struct ofp_action_nw_addr nw_addr;
- struct ofp_action_nw_tos nw_tos;
- struct ofp_action_tp_port tp_port;
-};
-OFP_ASSERT(sizeof(union ofp_action) == 8);
-
/* Send packet (controller -> datapath). */
struct ofp10_packet_out {
ovs_be32 buffer_id; /* ID assigned by datapath or UINT32_MAX. */
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index da7c6425..79b04333 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -35,6 +35,19 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
/* Converting OpenFlow 1.0 to ofpacts. */
+union ofp_action {
+ ovs_be16 type;
+ struct ofp_action_header header;
+ struct ofp_action_vendor_header vendor;
+ struct ofp10_action_output output10;
+ struct ofp_action_vlan_vid vlan_vid;
+ struct ofp_action_vlan_pcp vlan_pcp;
+ struct ofp_action_nw_addr nw_addr;
+ struct ofp_action_nw_tos nw_tos;
+ struct ofp_action_tp_port tp_port;
+};
+OFP_ASSERT(sizeof(union ofp_action) == 8);
+
static enum ofperr
output_from_openflow10(const struct ofp10_action_output *oao,
struct ofpbuf *out)
diff --git a/lib/ofp-util.h b/lib/ofp-util.h
index d5f34d72..937423eb 100644
--- a/lib/ofp-util.h
+++ b/lib/ofp-util.h
@@ -30,6 +30,7 @@
#include "type-props.h"
struct ofpbuf;
+union ofp_action;
/* Port numbers. */
enum ofperr ofputil_port_from_ofp11(ovs_be32 ofp11_port,