+ const struct ofputil_flow_stats_request *, enum nx_flow_format);
+
+/* Flow stats reply, independent of flow format. */
+struct ofputil_flow_stats {
+ struct cls_rule rule;
+ ovs_be64 cookie;
+ uint8_t table_id;
+ uint32_t duration_sec;
+ uint32_t duration_nsec;
+ uint16_t idle_timeout;
+ uint16_t hard_timeout;
+ int idle_age; /* Seconds since last packet, -1 if unknown. */
+ int hard_age; /* Seconds since last change, -1 if unknown. */
+ uint64_t packet_count; /* Packet count, UINT64_MAX if unknown. */
+ uint64_t byte_count; /* Byte count, UINT64_MAX if unknown. */
+ union ofp_action *actions;
+ size_t n_actions;
+};
+
+int ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *,
+ struct ofpbuf *msg,
+ bool flow_age_extension);
+void ofputil_append_flow_stats_reply(const struct ofputil_flow_stats *,
+ struct list *replies);
+
+/* Aggregate stats reply, independent of flow format. */
+struct ofputil_aggregate_stats {
+ uint64_t packet_count; /* Packet count, UINT64_MAX if unknown. */
+ uint64_t byte_count; /* Byte count, UINT64_MAX if unknown. */
+ uint32_t flow_count;
+};
+
+struct ofpbuf *ofputil_encode_aggregate_stats_reply(
+ const struct ofputil_aggregate_stats *stats,
+ const struct ofp_stats_msg *request);
+
+/* Flow removed message, independent of flow format. */
+struct ofputil_flow_removed {
+ struct cls_rule rule;
+ ovs_be64 cookie;
+ uint8_t reason; /* One of OFPRR_*. */
+ uint32_t duration_sec;
+ uint32_t duration_nsec;
+ uint16_t idle_timeout;
+ uint64_t packet_count; /* Packet count, UINT64_MAX if unknown. */
+ uint64_t byte_count; /* Byte count, UINT64_MAX if unknown. */
+};
+
+enum ofperr ofputil_decode_flow_removed(struct ofputil_flow_removed *,
+ const struct ofp_header *);
+struct ofpbuf *ofputil_encode_flow_removed(const struct ofputil_flow_removed *,
+ enum nx_flow_format);
+
+/* Abstract packet-in message. */
+struct ofputil_packet_in {
+ const void *packet;
+ size_t packet_len;
+
+ enum ofp_packet_in_reason reason; /* One of OFPRR_*. */
+ uint8_t table_id;
+ ovs_be64 cookie;
+
+ uint32_t buffer_id;
+ int send_len;
+ uint16_t total_len; /* Full length of frame. */
+
+ struct flow_metadata fmd; /* Metadata at creation time. */
+};
+
+int ofputil_decode_packet_in(struct ofputil_packet_in *,
+ const struct ofp_header *);
+struct ofpbuf *ofputil_encode_packet_in(const struct ofputil_packet_in *,
+ enum nx_packet_in_format);
+int ofputil_decode_packet_in(struct ofputil_packet_in *pi,
+ const struct ofp_header *oh);