Signed-off-by: Isaku Yamahata <yamah...@valinux.co.jp>
---
 lib/ofp-actions.c |   15 +++++++++++++++
 lib/ofp-actions.h |    1 +
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index d7df9e6..6c78ac1 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -32,6 +32,7 @@
 VLOG_DEFINE_THIS_MODULE(ofp_actions);
 
 static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
+
 
 /* Converting OpenFlow 1.0 to ofpacts. */
 
@@ -1827,6 +1828,20 @@ ofpact_format(const struct ofpact *a, struct ds *s)
 
 /* Appends a string representing the 'ofpacts_len' bytes of ofpacts in
  * 'ofpacts' to 'string'. */
+bool
+ofpact_is_instruction(const struct ofpact *a)
+{
+    return
+        a->type == OFPACT_APPLY_ACTIONS ||
+        a->type == OFPACT_CLEAR_ACTIONS ||
+        a->type == OFPACT_WRITE_ACTIONS ||
+        (a->type == OFPACT_RESUBMIT &&
+         a->compat == OFPUTIL_OFPIT11_GOTO_TABLE);
+    /* TODO:XXX meter, write_metadata */
+}
+
+/* Appends a string representing the actions in 'ofpacts' (terminated by
+ * OFPACT_END) to 'string'. */
 void
 ofpacts_format(const struct ofpact *ofpacts, size_t ofpacts_len,
                struct ds *string)
diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h
index 0299b39..d50b93a 100644
--- a/lib/ofp-actions.h
+++ b/lib/ofp-actions.h
@@ -435,6 +435,7 @@ bool ofpacts_output_to_port(const struct ofpact[], size_t 
ofpacts_len,
                             uint16_t port);
 bool ofpacts_equal(const struct ofpact a[], size_t a_len,
                    const struct ofpact b[], size_t b_len);
+bool ofpact_is_instruction(const struct ofpact *a);
 
 /* Formatting ofpacts.
  *
-- 
1.7.1.1

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

Reply via email to