lib/ofp-msgs.c
/* Prepares to append up to 'len' bytes to the series of statistics replies in
 * 'replies', which should have been initialized with ofpmp_init(), if
 * necessary adding a new reply to the list.
 *
 * Returns an ofpbuf with at least 'len' bytes of tailroom.  The 'len' bytes
 * have not actually been allocated, so the caller must do so with
 * e.g. ofpbuf_put_uninit(). */
Prepares to append up to 'len' bytes to the series of statistics replies in
'replies', which should have been initialized with ofpmp_init(), if
necessary adding a new reply to the list.

Returns an ofpbuf with at least 'len' bytes of tailroom.  The 'len' bytes
have not actually been allocated, so the caller must do so with
e.g.
Prepares to append up to ' len ' bytes to the series of statistics replies in ' replies ' which should have been initialized with ofpmp_init () if necessary adding a new reply to the list . Returns an ofpbuf with at least ' len ' bytes of tailroom . The ' len ' bytes have not actually been allocated so the caller must do so with e . g .
struct ofpbuf *
ofpmp_reserve(struct ovs_list *replies, size_t len)
{
    struct ofpbuf *msg = ofpbuf_from_list(ovs_list_back(replies));
    if (msg->size + len <= UINT16_MAX) {
        ofpbuf_prealloc_tailroom(msg, len);
        return msg;
    } else {
        unsigned int hdrs_len;
        struct ofpbuf *next;
        struct ofphdrs hdrs;
        ofphdrs_decode_assert(&hdrs, msg->data, msg->size);
        hdrs_len = ofphdrs_len(&hdrs);
        next = ofpbuf_new(MAX(1024, hdrs_len + len));
        ofpbuf_put(next, msg->data, hdrs_len);
        next->header = next->data;
        next->msg = ofpbuf_tail(next);
        ovs_list_push_back(replies, &next->list_node);
        *ofpmp_flags__(msg->data) |= htons(OFPSF_REPLY_MORE);
        return next;
    }
}
struct ofpbuf * ofpmp_reserve ( struct ovs_list * replies , size_t len ) { struct ofpbuf * msg = ofpbuf_from_list ( ovs_list_back ( replies ) ) ; if ( msg -> size + len <= UINT16_MAX ) { ofpbuf_prealloc_tailroom ( msg , len ) ; return msg ; } else { unsigned int hdrs_len ; struct ofpbuf * next ; struct ofphdrs hdrs ; ofphdrs_decode_assert ( & hdrs , msg -> data , msg -> size ) ; hdrs_len = ofphdrs_len ( & hdrs ) ; next = ofpbuf_new ( MAX ( 1024 , hdrs_len + len ) ) ; ofpbuf_put ( next , msg -> data , hdrs_len ) ; next -> header = next -> data ; next -> msg = ofpbuf_tail ( next ) ; ovs_list_push_back ( replies , & next -> list_node ) ; * ofpmp_flags__ ( msg -> data ) |= htons ( OFPSF_REPLY_MORE ) ; return next ; } }
Prepares to append up to 'len' bytes to the series of statistics replies in
 'replies', which should have been initialized with ofpmp_init(), if
 necessary adding a new reply to the list.
Prepares to append up to ' len ' bytes to the series of statistics replies in ' replies ' which should have been initialized with ofpmp_init () if necessary adding a new reply to the list .