+/* Converts 'rule' to a string and returns the string. The caller must free
+ * the string (with free()). */
+char *
+cls_rule_to_string(const struct cls_rule *rule)
+{
+ struct ds s = DS_EMPTY_INITIALIZER;
+ ds_put_format(&s, "wildcards=%x priority=%u ",
+ rule->wc.wildcards, rule->priority);
+ flow_format(&s, &rule->flow);
+ return ds_cstr(&s);
+}
+