From: Jarno Rajahalme Date: Wed, 16 Oct 2013 23:16:03 +0000 (-0700) Subject: include/openflow: Move union ofp_action away from headers. X-Git-Tag: sliver-openvswitch-2.0.90-1~7^2~50 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e45e72f1de0e50c4f11e9a2351f5135c002dcce3;p=sliver-openvswitch.git 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 Signed-off-by: Ben Pfaff --- diff --git a/include/openflow/openflow-1.0.h b/include/openflow/openflow-1.0.h index ef0a3ce73..34d97c4c7 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 da7c64257..79b043332 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 d5f34d72d..937423eb7 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,