From: Simon Horman Date: Tue, 7 Aug 2012 21:49:43 +0000 (+0900) Subject: ofp-util: Allow encoding of Open Flow 1.1 and 1.2 Packet Out Messages X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c1b1a0d43cc20ed0ebc01cbcbcafb0ce6e3469c;p=openvswitch 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 --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 910e63a1..46324825 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(); }