+/* An initializer for a struct ofpbuf whose data starts at DATA and continues
+ * for SIZE bytes. This is appropriate for an ofpbuf that will be used to
+ * inspect existing data, without moving it around or reallocating it, and
+ * generally without modifying it at all. This is the initializer form of
+ * ofpbuf_use_const().
+ */
+static inline struct ofpbuf
+ofpbuf_const_initializer(const void *data, size_t size)
+{
+ return (struct ofpbuf) {
+ .base = CONST_CAST(void *, data),
+ .data = CONST_CAST(void *, data),
+ .size = size,
+ .allocated = size,
+ .header = NULL,
+ .msg = NULL,
+ .list_node = OVS_LIST_POISON,
+ .source = OFPBUF_STACK,
+ };
+}
+