+static bool
+ofp_is_stat_reply(enum ofp_version version, uint8_t type)
+{
+ switch (version) {
+ case OFP10_VERSION:
+ return type == OFPT10_STATS_REPLY;
+ case OFP11_VERSION:
+ case OFP12_VERSION:
+ case OFP13_VERSION:
+ case OFP14_VERSION:
+ return type == OFPT11_STATS_REPLY;
+ }
+
+ return false;
+}
+
+static bool
+ofp_is_stat(enum ofp_version version, uint8_t type)
+{
+ return (ofp_is_stat_request(version, type) ||
+ ofp_is_stat_reply(version, type));
+}
+
+static bool
+ofphdrs_is_stat(const struct ofphdrs *hdrs)
+{
+ return ofp_is_stat(hdrs->version, hdrs->type);
+}
+