2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

ofp-actions: Prepare to treat OF1.2 actions as OF1.1 actions.

The numbering of OpenFlow 1.0 actions overlaps with the numbering
of OpenFlow 1.1+ actions, so the two sets of actions have to be
distinguished for input and output.  But OpenFlow 1.1 and 1.2
actions are numbered to avoid this problem, so there is no need
to distinguish them in the same way.  Therefore, this commit
prepares to treat them together.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
Ben Pfaff
2012-09-25 10:23:38 -07:00
parent e78b61f6e5
commit e9536ecb50
4 changed files with 5 additions and 34 deletions

View File

@@ -283,7 +283,6 @@ ofpact_from_nxast(const union ofp_action *a, enum ofputil_action_code code,
case OFPUTIL_ACTION_INVALID:
#define OFPAT10_ACTION(ENUM, STRUCT, NAME) case OFPUTIL_##ENUM:
#define OFPAT11_ACTION(ENUM, STRUCT, NAME) case OFPUTIL_##ENUM:
#define OFPAT12_ACTION(ENUM, STRUCT, NAME) case OFPUTIL_##ENUM:
#include "ofp-util.def"
NOT_REACHED();
@@ -398,7 +397,6 @@ ofpact_from_openflow10(const union ofp_action *a, struct ofpbuf *out)
switch (code) {
case OFPUTIL_ACTION_INVALID:
#define OFPAT11_ACTION(ENUM, STRUCT, NAME) case OFPUTIL_##ENUM:
#define OFPAT12_ACTION(ENUM, STRUCT, NAME) case OFPUTIL_##ENUM:
#include "ofp-util.def"
NOT_REACHED();
@@ -661,7 +659,6 @@ ofpact_from_openflow11(const union ofp_action *a, struct ofpbuf *out)
switch (code) {
case OFPUTIL_ACTION_INVALID:
#define OFPAT10_ACTION(ENUM, STRUCT, NAME) case OFPUTIL_##ENUM:
#define OFPAT12_ACTION(ENUM, STRUCT, NAME) case OFPUTIL_##ENUM:
#include "ofp-util.def"
NOT_REACHED();
@@ -716,6 +713,10 @@ ofpact_from_openflow11(const union ofp_action *a, struct ofpbuf *out)
ofpact_put_SET_L4_DST_PORT(out)->port = ntohs(a->tp_port.tp_port);
break;
case OFPUTIL_OFPAT12_SET_FIELD:
/* Not yet implemented. */
break;
#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) case OFPUTIL_##ENUM:
#include "ofp-util.def"
return ofpact_from_nxast(a, code, out);