+/* Creates an ofp_stats_request with the given 'type' and 'body_len' bytes of
+ * space allocated for the 'body' member. Returns the first byte of the 'body'
+ * member. */
+void *
+ofputil_make_stats_request(size_t body_len, uint16_t type,
+ struct ofpbuf **bufferp)
+{
+ struct ofp_stats_request *osr;
+ osr = make_openflow((offsetof(struct ofp_stats_request, body)
+ + body_len), OFPT_STATS_REQUEST, bufferp);
+ osr->type = htons(type);
+ osr->flags = htons(0);
+ return osr->body;
+}
+
+/* Creates a stats request message with Nicira as vendor and the given
+ * 'subtype', of total length 'openflow_len'. Returns the message. */
+void *
+ofputil_make_nxstats_request(size_t openflow_len, uint32_t subtype,
+ struct ofpbuf **bufferp)
+{
+ struct nicira_stats_msg *nsm;
+
+ nsm = make_openflow(openflow_len, OFPT_STATS_REQUEST, bufferp);
+ nsm->type = htons(OFPST_VENDOR);
+ nsm->flags = htons(0);
+ nsm->vendor = htonl(NX_VENDOR_ID);
+ nsm->subtype = htonl(subtype);
+ return nsm;
+}
+