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

---

v3
* No change

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

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index b6c7062..dcd19a1 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -1981,6 +1981,24 @@ ofputil_encode_flow_stats_request(const struct 
ofputil_flow_stats_request *fsr,
     struct ofpbuf *msg;
 
     switch (protocol) {
+    case OFPUTIL_P_OF12: {
+        struct ofp11_flow_stats_request *ofsr;
+        int type;
+
+        type = fsr->aggregate ? OFPST_AGGREGATE : OFPST_FLOW;
+        ofsr = ofputil_make_stats_request(sizeof *ofsr, type, 0, &msg);
+        ofsr->table_id = fsr->table_id;
+        memset(ofsr->pad, 0, sizeof ofsr->pad);
+        ofsr->out_port = ofputil_port_to_ofp11(fsr->out_port);
+        ofsr->out_group = htonl(OFPG11_ANY);
+        memset(ofsr->pad2, 0, sizeof ofsr->pad2);
+        ofsr->cookie = fsr->cookie;
+        ofsr->cookie_mask = fsr->cookie_mask;
+        ofputil_put_match(msg, &fsr->match, fsr->cookie, fsr->cookie_mask,
+                          protocol);
+        break;
+    }
+
     case OFPUTIL_P_OF10:
     case OFPUTIL_P_OF10_TID: {
         struct ofp10_flow_stats_request *ofsr;
-- 
1.7.10.2.484.gcd07cc5

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

Reply via email to