Signed-off-by: Simon Horman <[email protected]>
---
 lib/ofp-util.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 7628417..84bee2d 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -1714,6 +1714,34 @@ ofputil_encode_flow_mod(const struct ofputil_flow_mod 
*fm,
                : fm->command);
 
     switch (protocol) {
+    case OFPUTIL_P_OF12: {
+        struct ofp11_flow_mod *ofm;
+        struct ofp11_instruction_actions *oia;
+        struct ofp11_match *om;
+
+        msg = ofpbuf_new(sizeof *ofm + NXM_TYPICAL_LEN + fm->ofpacts_len);
+        ofm = put_openflow(sizeof *ofm, OFPT10_FLOW_MOD, msg);
+        ofm->cookie = fm->new_cookie;
+        ofm->cookie_mask = fm->cookie_mask;
+        ofm->table_id = fm->table_id;
+        ofm->command = htons(command);
+        ofm->idle_timeout = htons(fm->idle_timeout);
+        ofm->hard_timeout = htons(fm->hard_timeout);
+        ofm->priority = htons(fm->cr.priority);
+        ofm->buffer_id = htonl(fm->buffer_id);
+        ofm->out_port = ofputil_port_to_ofp11(fm->out_port);
+        ofm->out_group = htonl(OFPG11_ANY);
+        ofm->flags = htons(fm->flags);
+        memset(ofm->pad, 0, sizeof ofm->pad);
+        om = ofpbuf_put_uninit(msg, sizeof *om);
+        oputil_of12_put_match(msg, &fm->cr, fm->cookie, fm->cookie_mask);
+        oia = ofpbuf_put_uninit(msg, sizeof *oia);
+        oia->type = OFPIT11_APPLY_ACTIONS;
+        oia->len = sizeof *oia + fm->ofpacts_len;
+        memset(oia->pad, 0, sizeof oia->pad);
+        break;
+    }
+
     case OFPUTIL_P_OF10:
     case OFPUTIL_P_OF10_TID: {
         struct ofp10_flow_mod *ofm;
-- 
1.7.10.2.484.gcd07cc5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to