return error;
}
+static bool
+dpif_linux_flow_dump_next_may_destroy_keys(void *state_)
+{
+ struct dpif_linux_flow_state *state = state_;
+
+ return state->buffer.size ? false : true;
+}
+
static int
dpif_linux_flow_dump_done(const struct dpif *dpif OVS_UNUSED, void *iter_)
{
dpif_linux_flow_dump_state_init,
dpif_linux_flow_dump_start,
dpif_linux_flow_dump_next,
+ dpif_linux_flow_dump_next_may_destroy_keys,
dpif_linux_flow_dump_done,
dpif_linux_flow_dump_state_uninit,
dpif_linux_execute,
dpif_netdev_flow_dump_state_init,
dpif_netdev_flow_dump_start,
dpif_netdev_flow_dump_next,
+ NULL,
dpif_netdev_flow_dump_done,
dpif_netdev_flow_dump_state_uninit,
dpif_netdev_execute,
const struct nlattr **actions, size_t *actions_len,
const struct dpif_flow_stats **stats);
+ /* Determines whether the next call to 'flow_dump_next' with 'state' will
+ * modify or free the keys that it previously returned. 'state' must have
+ * been initialized by a call to 'flow_dump_state_init' for 'dpif'.
+ *
+ * 'dpif' guarantees that data returned by flow_dump_next() will remain
+ * accessible and unchanging until the next call. This function provides a
+ * way for callers to determine whether that guarantee extends beyond the
+ * next call.
+ *
+ * Returns true if the next call to flow_dump_next() is expected to be
+ * destructive to previously returned keys for 'state', false otherwise. */
+ bool (*flow_dump_next_may_destroy_keys)(void *state);
+
/* Releases resources from 'dpif' for 'iter', which was initialized by a
* successful call to the 'flow_dump_start' function for 'dpif'. Callers
* must ensure that this function is called once within a given iteration,
return !error;
}
+/* Determines whether the next call to 'dpif_flow_dump_next' for 'dump' and
+ * 'state' will modify or free the keys that it previously returned. 'state'
+ * must have been initialized by a call to 'dpif_flow_dump_state_init' for
+ * 'dump'.
+ *
+ * 'dpif' guarantees that data returned by flow_dump_next() will remain
+ * accessible and unchanging until the next call. This function provides a way
+ * for callers to determine whether that guarantee extends beyond the next
+ * call.
+ *
+ * Returns true if the next call to flow_dump_next() is expected to be
+ * destructive to previously returned keys for 'state', false otherwise. */
+bool
+dpif_flow_dump_next_may_destroy_keys(struct dpif_flow_dump *dump, void *state)
+{
+ const struct dpif *dpif = dump->dpif;
+ return (dpif->dpif_class->flow_dump_next_may_destroy_keys
+ ? dpif->dpif_class->flow_dump_next_may_destroy_keys(state)
+ : true);
+}
+
/* Completes flow table dump operation 'dump', which must have been initialized
* with a successful call to dpif_flow_dump_start(). Returns 0 if the dump
* operation was error-free, otherwise a positive errno value describing the
const struct nlattr **mask, size_t *mask_len,
const struct nlattr **actions, size_t *actions_len,
const struct dpif_flow_stats **);
+bool dpif_flow_dump_next_may_destroy_keys(struct dpif_flow_dump *dump,
+ void *state);
int dpif_flow_dump_done(struct dpif_flow_dump *);
void dpif_flow_dump_state_uninit(const struct dpif *, void *state);
\f