- dpif_flow_dump_start(&dump, dpif);
- while (dpif_flow_dump_next(&dump, &key, &key_len,
- &mask, &mask_len,
- &actions, &actions_len, &stats)) {
+ error = dpif_flow_dump_start(&flow_dump, dpif);
+ if (error) {
+ goto exit;
+ }
+ dpif_flow_dump_state_init(dpif, &state);
+ while (dpif_flow_dump_next(&flow_dump, state, &key, &key_len,
+ &mask, &mask_len, &actions, &actions_len,
+ &stats)) {
+ if (filter) {
+ struct flow flow;
+ struct flow_wildcards wc;
+ struct match match, match_filter;
+ struct minimatch minimatch;
+
+ odp_flow_key_to_flow(key, key_len, &flow);
+ odp_flow_key_to_mask(mask, mask_len, &wc.masks, &flow);
+ match_init(&match, &flow, &wc);
+
+ match_init(&match_filter, &flow_filter, &wc);
+ match_init(&match_filter, &match_filter.flow, &wc_filter);
+ minimatch_init(&minimatch, &match_filter);
+
+ if (!minimatch_matches_flow(&minimatch, &match.flow)) {
+ minimatch_destroy(&minimatch);
+ continue;
+ }
+ minimatch_destroy(&minimatch);
+ }