lib/ofpbuf.c
/* Trims the size of 'b' to fit its actual content, reducing its headroom and
 * tailroom to 0, if any.
 *
 * Buffers not obtained from malloc() are not resized, since that wouldn't save
 * any memory.
 *
 * Caller needs to updates 'b->header' and 'b->msg' so that they point to the
 * same locations in the data.  (If they pointed into the tailroom or headroom
 * then they become invalid.)
 *
 */
Trims the size of 'b' to fit its actual content, reducing its headroom and
tailroom to 0, if any.

Buffers not obtained from malloc() are not resized, since that wouldn't save
any memory.

Caller needs to updates 'b->header' and 'b->msg' so that they point to the
same locations in the data.  (If they pointed into the tailroom or headroom
then they become invalid.)
Trims the size of ' b ' to fit its actual content reducing its headroom and tailroom to 0 if any . Buffers not obtained from malloc () are not resized since that wouldn ' t save any memory . Caller needs to updates ' b - > header ' and ' b - > msg ' so that they point to the same locations in the data . ( If they pointed into the tailroom or headroom then they become invalid . )
void
ofpbuf_trim(struct ofpbuf *b)
{
    if (b->source == OFPBUF_MALLOC
        && (ofpbuf_headroom(b) || ofpbuf_tailroom(b))) {
        ofpbuf_resize__(b, 0, 0);
    }
}
void ofpbuf_trim ( struct ofpbuf * b ) { if ( b -> source == OFPBUF_MALLOC && ( ofpbuf_headroom ( b ) || ofpbuf_tailroom ( b ) ) ) { ofpbuf_resize__ ( b , 0 , 0 ) ; } }
Trims the size of 'b' to fit its actual content, reducing its headroom and
 tailroom to 0, if any.
Trims the size of ' b ' to fit its actual content reducing its headroom and tailroom to 0 if any .