+ ovs_assert(b->source != OFPBUF_DPDK);
+
+ if (b->source == OFPBUF_MALLOC
+ && (ofpbuf_headroom(b) || ofpbuf_tailroom(b))) {
+ ofpbuf_resize__(b, 0, 0);
+ }
+}
+
+/* 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 (ofpbuf_size(b) < length) {
+ ofpbuf_put_zeros(b, length - ofpbuf_size(b));
+ }
+}
+
+/* Shifts all of the data within the allocated space in 'b' by 'delta' bytes.
+ * For example, a 'delta' of 1 would cause each byte of data to move one byte
+ * forward (from address 'p' to 'p+1'), and a 'delta' of -1 would cause each
+ * byte to move one byte backward (from 'p' to 'p-1'). */
+void
+ofpbuf_shift(struct ofpbuf *b, int delta)
+{
+ ovs_assert(delta > 0 ? delta <= ofpbuf_tailroom(b)
+ : delta < 0 ? -delta <= ofpbuf_headroom(b)
+ : true);
+
+ if (delta != 0) {
+ char *dst = (char *) ofpbuf_data(b) + delta;
+ memmove(dst, ofpbuf_data(b), ofpbuf_size(b));
+ ofpbuf_set_data(b, dst);