From 7c1b1a0d43cc20ed0ebc01cbcbcafb0ce6e3469c Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Wed, 8 Aug 2012 06:49:43 +0900 Subject: [PATCH] ofp-util: Allow encoding of Open Flow 1.1 and 1.2 Packet Out Messages Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- lib/ofp-util.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 910e63a14..463248255 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -3073,7 +3073,21 @@ ofputil_encode_packet_out(const struct ofputil_packet_out *po, } case OFP11_VERSION: - case OFP12_VERSION: + case OFP12_VERSION: { + struct ofp11_packet_out *opo; + size_t len; + + msg = ofpraw_alloc(OFPRAW_OFPT11_PACKET_OUT, ofp_version, size); + ofpbuf_put_zeros(msg, sizeof *opo); + len = ofpacts_put_openflow11_actions(po->ofpacts, po->ofpacts_len, msg); + + opo = msg->l3; + opo->buffer_id = htonl(po->buffer_id); + opo->in_port = ofputil_port_to_ofp11(po->in_port); + opo->actions_len = htons(len); + break; + } + default: NOT_REACHED(); } -- 2.43.0