From: Ben Pfaff Date: Thu, 5 Jul 2012 18:11:42 +0000 (-0700) Subject: ofp-util: Add comment to ofputil_postappend_stats_reply(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d20cb04d9479e91dbb075ab92a82fdf867ce366;p=openvswitch ofp-util: Add comment to ofputil_postappend_stats_reply(). It seemed like it could use one. Signed-off-by: Ben Pfaff --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index d9a77f1e..99f92a8c 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -3392,6 +3392,16 @@ ofputil_append_stats_reply(size_t len, struct list *replies) return ofpbuf_put_uninit(ofputil_reserve_stats_reply(len, replies), len); } +/* Sometimes, when composing stats replies, it's difficult to predict how long + * an individual reply chunk will be before actually encoding it into the reply + * buffer. This function allows easy handling of this case: just encode the + * reply, then use this function to break the message into two pieces if it + * exceeds the OpenFlow message limit. + * + * In detail, if the final stats message in 'replies' is too long for OpenFlow, + * this function breaks it into two separate stats replies, the first one with + * the first 'start_ofs' bytes, the second one containing the bytes from that + * offset onward. */ void ofputil_postappend_stats_reply(size_t start_ofs, struct list *replies) {