Signed-off-by: Isaku Yamahata <[email protected]>
---
v4
newly introduced
---
lib/ofp-parse.c | 36 ++++++++++++++++++++++++++++++++++--
lib/ofp-util.c | 1 +
2 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 65b3f0f..3cddc86 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -44,6 +44,8 @@ VLOG_DEFINE_THIS_MODULE(ofp_parse);
static void ofp_fatal(const char *flow, bool verbose, const char *format, ...)
NO_RETURN;
+static void str_to_ofpacts(const struct flow *flow,
+ char *str, struct ofpbuf *ofpacts);
static uint8_t
str_to_table_id(const char *str)
@@ -283,6 +285,8 @@ parse_named_action(enum ofputil_action_code code, const
struct flow *flow,
char *arg, struct ofpbuf *ofpacts)
{
struct ofpact_tunnel *tunnel;
+ struct ofpact_resubmit *resubmit;
+ struct ofpact_inst_actions *inst_actions;
uint16_t vid;
ovs_be32 ip;
uint8_t pcp;
@@ -435,13 +439,41 @@ parse_named_action(enum ofputil_action_code code, const
struct flow *flow,
parse_controller(ofpacts, arg);
break;
+ /* TODO:XXX instruction meter */
+
case OFPUTIL_OFPIT11_GOTO_TABLE:
+ resubmit = ofpact_put_RESUBMIT(ofpacts);
+ resubmit->ofpact.compat = OFPUTIL_OFPIT11_GOTO_TABLE;
+ resubmit->in_port = OFPP_IN_PORT;
+ resubmit->table_id = str_to_u32(arg);
+ if (resubmit->table_id == 255) {
+ ovs_fatal(0, "goto_table must have table_id < 255");
+ }
+ break;
+
case OFPUTIL_OFPIT11_WRITE_METADATA:
+ /* TODO:XXX */
+ NOT_REACHED();
+ break;
+
case OFPUTIL_OFPIT11_WRITE_ACTIONS:
+ inst_actions = ofpact_put_WRITE_ACTIONS(ofpacts);
+ ofpact_nest(ofpacts, &inst_actions->ofpact);
+ str_to_ofpacts(flow, arg, ofpacts);
+ inst_actions = ofpact_get_WRITE_ACTIONS(ofpact_unnest(ofpacts));
+ ofpact_update_len(ofpacts, &inst_actions->ofpact);
+ break;
+
case OFPUTIL_OFPIT11_APPLY_ACTIONS:
+ inst_actions = ofpact_put_APPLY_ACTIONS(ofpacts);
+ ofpact_nest(ofpacts, &inst_actions->ofpact);
+ str_to_ofpacts(flow, arg, ofpacts);
+ inst_actions = ofpact_get_APPLY_ACTIONS(ofpact_unnest(ofpacts));
+ ofpact_update_len(ofpacts, &inst_actions->ofpact);
+ break;
+
case OFPUTIL_OFPIT11_CLEAR_ACTIONS:
- /* TODO:XXX */
- NOT_REACHED();
+ ofpact_put_CLEAR_ACTIONS(ofpacts);
break;
}
}
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index d4154b3..f8a4cd3 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -3962,6 +3962,7 @@ ofputil_action_code_from_name(const char *name)
NULL,
#define OFPAT10_ACTION(ENUM, STRUCT, NAME) NAME,
#define OFPAT11_ACTION(ENUM, STRUCT, NAME) NAME,
+#define OFPIT11_ACTION(ENUM, STRUCT, NAME) NAME,
#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) NAME,
#include "ofp-util.def"
};
--
1.7.1.1
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev