lib/ofp-msgs.c
/* 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. */
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.
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
ofpmp_postappend(struct ovs_list *replies, size_t start_ofs)
{
    struct ofpbuf *msg = ofpbuf_from_list(ovs_list_back(replies));
    ovs_assert(start_ofs <= UINT16_MAX);
    if (msg->size > UINT16_MAX) {
        size_t len = msg->size - start_ofs;
        memcpy(ofpmp_append(replies, len),
               (const uint8_t *) msg->data + start_ofs, len);
        msg->size = start_ofs;
    }
}
void ofpmp_postappend ( struct ovs_list * replies , size_t start_ofs ) { struct ofpbuf * msg = ofpbuf_from_list ( ovs_list_back ( replies ) ) ; ovs_assert ( start_ofs <= UINT16_MAX ) ; if ( msg -> size > UINT16_MAX ) { size_t len = msg -> size - start_ofs ; memcpy ( ofpmp_append ( replies , len ) , ( const uint8_t * ) msg -> data + start_ofs , len ) ; msg -> size = start_ofs ; } }
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.
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 .