From: Ben Pfaff Date: Thu, 26 Jan 2012 21:17:12 +0000 (-0800) Subject: ofp-util: New function ofputil_encode_barrier_request(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efb80167f7ebf51456df2940e3b42376ecbceb61;p=openvswitch ofp-util: New function ofputil_encode_barrier_request(). This new function will acquire a new user in an upcoming commit. Signed-off-by: Ben Pfaff --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 6f8b033e..c377e3e4 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -2248,6 +2248,15 @@ make_echo_reply(const struct ofp_header *rq) return out; } +struct ofpbuf * +ofputil_encode_barrier_request(void) +{ + struct ofpbuf *msg; + + make_openflow(sizeof(struct ofp_header), OFPT_BARRIER_REQUEST, &msg); + return msg; +} + const char * ofputil_frag_handling_to_string(enum ofp_config_flags flags) { diff --git a/lib/ofp-util.h b/lib/ofp-util.h index e2b32ddc..0b6970a8 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -313,6 +313,8 @@ struct ofpbuf *make_packet_in(uint32_t buffer_id, uint16_t in_port, struct ofpbuf *make_echo_request(void); struct ofpbuf *make_echo_reply(const struct ofp_header *rq); +struct ofpbuf *ofputil_encode_barrier_request(void); + const char *ofputil_frag_handling_to_string(enum ofp_config_flags); bool ofputil_frag_handling_from_string(const char *, enum ofp_config_flags *); diff --git a/lib/vconn.c b/lib/vconn.c index 8e6374e7..5da50262 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -730,7 +730,7 @@ vconn_transact_noreply(struct vconn *vconn, struct ofpbuf *request, } /* Send barrier. */ - make_openflow(sizeof(struct ofp_header), OFPT_BARRIER_REQUEST, &barrier); + barrier = ofputil_encode_barrier_request(); barrier_xid = ((struct ofp_header *) barrier->data)->xid; error = vconn_send_block(vconn, barrier); if (error) {