- int (*iterator)(struct sw_table *, struct swt_iterator *);
- void (*iterator_next)(struct swt_iterator *);
- void (*iterator_destroy)(struct swt_iterator *);
+ /* Iterates through the flow entries in 'table', passing each one
+ * matches 'key' to 'callback'. The callback function should return 0
+ * to continue iteration or a nonzero error code to stop. The iterator
+ * function returns either 0 if the table iteration completed or the
+ * value returned by the callback function otherwise.
+ *
+ * The iteration starts at 'position', which may be initialized to
+ * all-zero-bits to iterate from the beginning of the table. If the
+ * iteration terminates due to an error from the callback function,
+ * 'position' is updated to a value that can be passed back to the
+ * iterator function to continue iteration later from the same position
+ * that caused the error (assuming that that flow entry has not been
+ * deleted in the meantime). */
+ int (*iterate)(struct sw_table *table,
+ const struct sw_flow_key *key,
+ struct sw_table_position *position,
+ int (*callback)(struct sw_flow *flow, void *private),
+ void *private);