Signed-off-by: Simon Horman <ho...@verge.net.au>

---

v3
* No change

v2
* Use ofputil_put_match()
---
 lib/ofp-util.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 95dbfed..6b29ad7 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -2340,6 +2340,23 @@ ofputil_encode_flow_removed(const struct 
ofputil_flow_removed *fr,
     struct ofpbuf *msg;
 
     switch (protocol) {
+    case OFPUTIL_P_OF12: {
+        struct ofp12_flow_removed *ofr;
+
+        ofr = make_openflow_xid(sizeof *ofr, OFPT_FLOW_REMOVED, 0, &msg);
+        ofr->cookie = fr->cookie;
+        ofr->priority = htons(fr->rule.priority);
+        ofr->reason = fr->reason;
+        ofr->table_id = 0;
+        ofr->duration_sec = htonl(fr->duration_sec);
+        ofr->duration_nsec = htonl(fr->duration_nsec);
+        ofr->idle_timeout = htons(fr->idle_timeout);
+        ofr->packet_count = htonll(fr->packet_count);
+        ofr->byte_count = htonll(fr->byte_count);
+        ofputil_put_match(msg, &fr->rule, 0, 0, protocol);
+        break;
+    }
+
     case OFPUTIL_P_OF10:
     case OFPUTIL_P_OF10_TID: {
         struct ofp_flow_removed *ofr;
-- 
1.7.10.2.484.gcd07cc5

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

Reply via email to