This is preparation for OF12 support.
This patch introduces just a place holder. The real implementation will come
as a later patch.

Signed-off-by: Isaku Yamahata <yamah...@valinux.co.jp>
---
 lib/ofp-actions.c      |   22 ++++++++++++++++++++++
 lib/ofp-actions.h      |   10 ++++++++++
 ofproto/ofproto-dpif.c |    5 +++++
 3 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index b81f97d..fbaa5ff 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -892,6 +892,11 @@ ofpact_check__(const struct ofpact *a, const struct flow 
*flow, int max_ports)
     case OFPACT_SET_L4_DST_PORT:
         return 0;
 
+    case OFPACT_SET_FIELD:
+        /* TODO This will be implemented by the later patch */
+        NOT_REACHED();
+        break;
+
     case OFPACT_REG_MOVE:
         return nxm_reg_move_check(ofpact_get_REG_MOVE(a), flow);
 
@@ -1112,6 +1117,7 @@ ofpact_to_nxast(const struct ofpact *a, struct ofpbuf 
*out)
     case OFPACT_SET_IPV4_DSCP:
     case OFPACT_SET_L4_SRC_PORT:
     case OFPACT_SET_L4_DST_PORT:
+    case OFPACT_SET_FIELD:
         NOT_REACHED();
     }
 }
@@ -1204,6 +1210,11 @@ ofpact_to_openflow10(const struct ofpact *a, struct 
ofpbuf *out)
             = htons(ofpact_get_SET_L4_DST_PORT(a)->port);
         break;
 
+    case OFPACT_SET_FIELD:
+        /* TODO: this will be implemented by later patch */
+        NOT_REACHED();
+        break;
+
     case OFPACT_CONTROLLER:
     case OFPACT_OUTPUT_REG:
     case OFPACT_BUNDLE:
@@ -1314,6 +1325,11 @@ ofpact_to_openflow11(const struct ofpact *a, struct 
ofpbuf *out)
             = htons(ofpact_get_SET_L4_DST_PORT(a)->port);
         break;
 
+    case OFPACT_SET_FIELD:
+        /* TODO: this will be implemented by later patch */
+        NOT_REACHED();
+        break;
+
     case OFPACT_CONTROLLER:
     case OFPACT_OUTPUT_REG:
     case OFPACT_BUNDLE:
@@ -1403,6 +1419,7 @@ ofpact_outputs_to_port(const struct ofpact *ofpact, 
uint16_t port)
     case OFPACT_SET_IPV4_DSCP:
     case OFPACT_SET_L4_SRC_PORT:
     case OFPACT_SET_L4_DST_PORT:
+    case OFPACT_SET_FIELD:
     case OFPACT_REG_MOVE:
     case OFPACT_REG_LOAD:
     case OFPACT_DEC_TTL:
@@ -1590,6 +1607,11 @@ ofpact_format(const struct ofpact *a, struct ds *s)
         ds_put_format(s, "mod_tp_dst:%d", ofpact_get_SET_L4_DST_PORT(a)->port);
         break;
 
+    case OFPACT_SET_FIELD:
+        /* TODO: this will be implemented by later patch */
+        NOT_REACHED();
+        break;
+
     case OFPACT_REG_MOVE:
         nxm_format_reg_move(ofpact_get_REG_MOVE(a), s);
         break;
diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h
index 7cf1eb5..41d61ec 100644
--- a/lib/ofp-actions.h
+++ b/lib/ofp-actions.h
@@ -73,6 +73,7 @@
     DEFINE_OFPACT(REG_MOVE,        ofpact_reg_move,      ofpact)    \
     DEFINE_OFPACT(REG_LOAD,        ofpact_reg_load,      ofpact)    \
     DEFINE_OFPACT(DEC_TTL,         ofpact_null,          ofpact)    \
+    DEFINE_OFPACT(SET_FIELD,       ofpact_set_field,     ofpact)    \
                                                                     \
     /* Metadata. */                                                 \
     DEFINE_OFPACT(SET_TUNNEL,      ofpact_tunnel,        ofpact)    \
@@ -378,6 +379,15 @@ struct ofpact_note {
     uint8_t data[];
 };
 
+/* OFPACT_SET_FIELD
+ *
+ * used for OFPAT12_SET_FIELD */
+struct ofpact_set_field {
+    struct ofpact ofpact;
+    const struct mf_field *mf;
+    union mf_value value;
+};
+
 /* Converting OpenFlow to ofpacts. */
 enum ofperr ofpacts_pull_openflow10(struct ofpbuf *openflow,
                                     unsigned int actions_len,
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index f826c2e..8aa9f13 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -5445,6 +5445,11 @@ do_xlate_actions(const struct ofpact *ofpacts, struct 
action_xlate_ctx *ctx)
             ctx->flow.tp_dst = htons(ofpact_get_SET_L4_DST_PORT(a)->port);
             break;
 
+        case OFPACT_SET_FIELD:
+            /* TODO: this will be implemented by later patch */
+            NOT_REACHED();
+            break;
+
         case OFPACT_RESUBMIT:
             xlate_ofpact_resubmit(ctx, ofpact_get_RESUBMIT(a));
             break;
-- 
1.7.1.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to