+static inline void ofpbuf_set_data(struct ofpbuf *b, void *d)
+{
+ b->mbuf.pkt.data = d;
+}
+
+static inline void * ofpbuf_base(const struct ofpbuf *b)
+{
+ return b->mbuf.buf_addr;
+}
+
+static inline void ofpbuf_set_base(struct ofpbuf *b, void *d)
+{
+ b->mbuf.buf_addr = d;
+}
+
+static inline uint32_t ofpbuf_size(const struct ofpbuf *b)
+{
+ return b->mbuf.pkt.pkt_len;
+}
+
+static inline void ofpbuf_set_size(struct ofpbuf *b, uint32_t v)
+{
+ b->mbuf.pkt.data_len = v; /* Current seg length. */
+ b->mbuf.pkt.pkt_len = v; /* Total length of all segments linked to
+ * this segment. */
+}
+
+#else
+static inline void * ofpbuf_data(const struct ofpbuf *b)
+{
+ return b->data_;
+}
+
+static inline void ofpbuf_set_data(struct ofpbuf *b, void *d)
+{
+ b->data_ = d;
+}
+
+static inline void * ofpbuf_base(const struct ofpbuf *b)
+{
+ return b->base_;
+}
+
+static inline void ofpbuf_set_base(struct ofpbuf *b, void *d)
+{
+ b->base_ = d;
+}
+
+static inline uint32_t ofpbuf_size(const struct ofpbuf *b)
+{
+ return b->size_;
+}
+
+static inline void ofpbuf_set_size(struct ofpbuf *b, uint32_t v)
+{
+ b->size_ = v;
+}
+#endif
+