+ }
+ ds_destroy(&in);
+
+ return exit_code;
+}
+
+static int
+parse_actions(void)
+{
+ struct ds in;
+
+ ds_init(&in);
+ vlog_set_levels_from_string_assert("odp_util:console:dbg");
+ while (!ds_get_test_line(&in, stdin)) {
+ struct ofpbuf odp_actions;
+ struct ds out;
+ int error;
+
+ /* Convert string to OVS DP actions. */
+ ofpbuf_init(&odp_actions, 0);
+ error = odp_actions_from_string(ds_cstr(&in), NULL, &odp_actions);
+ if (error) {
+ printf("odp_actions_from_string: error\n");
+ goto next;
+ }
+
+ /* Convert odp_actions back to string. */
+ ds_init(&out);
+ format_odp_actions(&out, ofpbuf_data(&odp_actions), ofpbuf_size(&odp_actions));
+ puts(ds_cstr(&out));
+ ds_destroy(&out);
+
+ next:
+ ofpbuf_uninit(&odp_actions);
+ }
+ ds_destroy(&in);
+
+ return 0;
+}
+
+static int
+parse_filter(char *filter_parse)
+{
+ struct ds in;
+ struct flow flow_filter;
+ struct flow_wildcards wc_filter;
+ char *error, *filter = NULL;
+
+ vlog_set_levels_from_string_assert("odp_util:console:dbg");
+ if (filter_parse && !strncmp(filter_parse, "filter=", 7)) {
+ filter = strdup(filter_parse+7);
+ memset(&flow_filter, 0, sizeof(flow_filter));
+ memset(&wc_filter, 0, sizeof(wc_filter));
+
+ error = parse_ofp_exact_flow(&flow_filter, &wc_filter.masks, filter,
+ NULL);
+ if (error) {
+ ovs_fatal(0, "Failed to parse filter (%s)", error);
+ }
+ } else {
+ ovs_fatal(0, "No filter to parse.");
+ }
+
+ ds_init(&in);
+ while (!ds_get_test_line(&in, stdin)) {
+ struct ofpbuf odp_key;
+ struct ofpbuf odp_mask;
+ struct ds out;
+ int error;
+
+ /* Convert string to OVS DP key. */