- * page) into 'mm' for sending the specified meter_mod 'command' to a switch.
- */
-void
-parse_ofp_meter_mod_str(struct ofputil_meter_mod *mm, const char *str_,
- int command, bool verbose)
+ * page) into 'fm' for sending the specified flow_mod 'command' to a switch.
+ *
+ * To parse syntax for an OFPT_FLOW_MOD (or NXT_FLOW_MOD), use an OFPFC_*
+ * constant for 'command'. To parse syntax for an OFPST_FLOW or
+ * OFPST_AGGREGATE (or NXST_FLOW or NXST_AGGREGATE), use -1 for 'command'.
+ *
+ * Returns NULL if successful, otherwise a malloc()'d string describing the
+ * error. The caller is responsible for freeing the returned string. */
+char * WARN_UNUSED_RESULT
+parse_ofp_str(struct ofputil_flow_mod *fm, int command, const char *str_)
+{
+ char *string = xstrdup(str_);
+ char *error;
+
+ error = parse_ofp_str__(fm, command, string);
+ if (error) {
+ fm->ofpacts = NULL;
+ fm->ofpacts_len = 0;
+ }
+
+ free(string);
+ return error;
+}
+
+static char * WARN_UNUSED_RESULT
+parse_ofp_meter_mod_str__(struct ofputil_meter_mod *mm, char *string,
+ struct ofpbuf *bands, int command)