lib/ofp-msgs.c
/* Allocates and returns a new ofpbuf that contains an OpenFlow header that is
 * a stats reply to the stats request in 'request', using the same OpenFlow
 * version and transaction ID as 'request'.  The ofpbuf has enough tailroom for
 * the stats reply's minimum body length, plus 'extra_tailroom' additional
 * bytes.
 *
 * 'request' must be a stats request, that is, an OFPRAW_OFPST* or OFPRAW_NXST*
 * value.  Every stats request has a corresponding reply, so the (raw, version)
 * pairing pitfalls of the other ofpraw_alloc_*() functions don't apply here.
 *
 * In the returned ofpbuf, 'header' points to the beginning of the
 * OpenFlow header and 'msg' points just after it, to where the
 * message's body will start.  The caller must actually allocate the
 * body into the space reserved for it, e.g. with ofpbuf_put_uninit().
 *
 * The caller owns the returned ofpbuf and must free it when it is no longer
 * needed, e.g. with ofpbuf_delete(). */
Allocates and returns a new ofpbuf that contains an OpenFlow header that is
a stats reply to the stats request in 'request', using the same OpenFlow
version and transaction ID as 'request'.  The ofpbuf has enough tailroom for
the stats reply's minimum body length, plus 'extra_tailroom' additional
bytes.

'request' must be a stats request, that is, an OFPRAW_OFPST* or OFPRAW_NXST
value.  Every stats request has a corresponding reply, so the (raw, version)
pairing pitfalls of the other ofpraw_alloc_*() functions don't apply here.



The caller owns the returned ofpbuf and must free it when it is no longer
needed, e.g.
Allocates and returns a new ofpbuf that contains an OpenFlow header that is a stats reply to the stats request in ' request ' using the same OpenFlow version and transaction ID as ' request ' . The ofpbuf has enough tailroom for the stats reply ' s minimum body length plus ' extra_tailroom ' additional bytes . ' request ' must be a stats request that is an OFPRAW_OFPST * or OFPRAW_NXST value . Every stats request has a corresponding reply so the ( raw version ) pairing pitfalls of the other ofpraw_alloc_ * () functions don ' t apply here . The caller owns the returned ofpbuf and must free it when it is no longer needed e . g .
struct ofpbuf *
ofpraw_alloc_stats_reply(const struct ofp_header *request,
                         size_t extra_tailroom)
{
    enum ofpraw request_raw;
    enum ofpraw reply_raw;
    ovs_assert(!ofpraw_decode_partial(&request_raw, request,
                                      ntohs(request->length)));
    reply_raw = ofpraw_stats_request_to_reply(request_raw, request->version);
    ovs_assert(reply_raw);
    return ofpraw_alloc_reply(reply_raw, request, extra_tailroom);
}
struct ofpbuf * ofpraw_alloc_stats_reply ( const struct ofp_header * request , size_t extra_tailroom ) { enum ofpraw request_raw ; enum ofpraw reply_raw ; ovs_assert ( ! ofpraw_decode_partial ( & request_raw , request , ntohs ( request -> length ) ) ) ; reply_raw = ofpraw_stats_request_to_reply ( request_raw , request -> version ) ; ovs_assert ( reply_raw ) ; return ofpraw_alloc_reply ( reply_raw , request , extra_tailroom ) ; }
Allocates and returns a new ofpbuf that contains an OpenFlow header that is
 a stats reply to the stats request in 'request', using the same OpenFlow
 version and transaction ID as 'request'.
Allocates and returns a new ofpbuf that contains an OpenFlow header that is a stats reply to the stats request in ' request ' using the same OpenFlow version and transaction ID as ' request ' .