2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-17 14:28:02 +00:00

openflow: Make stats replies more like other OpenFlow messages.

This commit is contained in:
Ben Pfaff
2011-05-31 16:49:06 -07:00
parent 675baf0cdf
commit 63f2140a55
10 changed files with 271 additions and 229 deletions

View File

@@ -289,6 +289,16 @@ ofpbuf_trim(struct ofpbuf *b)
}
}
/* If 'b' is shorter than 'length' bytes, pads its tail out with zeros to that
* length. */
void
ofpbuf_padto(struct ofpbuf *b, size_t length)
{
if (b->size < length) {
ofpbuf_put_zeros(b, length - b->size);
}
}
/* Appends 'size' bytes of data to the tail end of 'b', reallocating and
* copying its data if necessary. Returns a pointer to the first byte of the
* new data, which is left uninitialized. */