[ovs-dev] [PATCH 11/19] ofp-util: Allow encoding of Open Flow 1.2 Flow Removed messages

Simon Horman horms at verge.net.au
Wed Jun 13 23:51:59 UTC 2012


Signed-off-by: Simon Horman <horms at verge.net.au>
---
 lib/ofp-util.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 4a4822c..332f2ca 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -2313,6 +2313,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);
+        oputil_of12_put_match(msg, &fr->rule, 0, 0);
+        break;
+    }
+
     case OFPUTIL_P_OF10:
     case OFPUTIL_P_OF10_TID: {
         struct ofp_flow_removed *ofr;
-- 
1.7.10.2.484.gcd07cc5




More information about the dev mailing list