+int
+ofperr_get_vendor(enum ofperr error, enum ofp_version version)
+{
+ const struct ofperr_domain *domain = ofperr_domain_from_version(version);
+ return domain ? ofperr_get_triplet__(error, domain)->vendor : -1;
+}
+
+/* Returns the value that would go into an OFPT_ERROR message's 'type' for
+ * encoding 'error' in 'domain'. Returns -1 if 'error' is not encodable in
+ * 'version' or 'version' is unknown.
+ *
+ * 'error' must be a valid OFPERR_* code, as checked by ofperr_is_valid(). */
+int
+ofperr_get_type(enum ofperr error, enum ofp_version version)
+{
+ const struct ofperr_domain *domain = ofperr_domain_from_version(version);
+ return domain ? ofperr_get_triplet__(error, domain)->type : -1;
+}
+
+/* Returns the value that would go into an OFPT_ERROR message's 'code' for
+ * encoding 'error' in 'domain'. Returns -1 if 'error' is not encodable in
+ * 'version', 'version' is unknown or if 'error' represents a category
+ * rather than a specific error.
+ *
+ *
+ * 'error' must be a valid OFPERR_* code, as checked by ofperr_is_valid(). */
+int
+ofperr_get_code(enum ofperr error, enum ofp_version version)
+{
+ const struct ofperr_domain *domain = ofperr_domain_from_version(version);
+ return domain ? ofperr_get_triplet__(error, domain)->code : -1;
+}
+
+/* Tries to decode 'oh', which should be an OpenFlow OFPT_ERROR message.