summaryrefslogtreecommitdiff
path: root/lib/stream-provider.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-01-06 14:26:48 -0800
committerBen Pfaff <blp@nicira.com>2010-01-06 14:26:48 -0800
commit539e96f62300e4afab00e5906a28e3b89301d62e (patch)
treed91d559866c7a32d48613d2cae3a8b52c56bdb36 /lib/stream-provider.h
parente0668bd1d448d6f17c20b9c7ba91344180809061 (diff)
downloadopenvswitch-539e96f62300e4afab00e5906a28e3b89301d62e.tar.gz
stream: Add stream_run(), stream_run_wait() functions.
SSL, which will be added in an upcoming commit, requires some background processing, which is best done in a "run" function in our architecture. This commit adds stream_run() and stream_run_wait() and calls to them from the places where they will be required.
Diffstat (limited to 'lib/stream-provider.h')
-rw-r--r--lib/stream-provider.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/stream-provider.h b/lib/stream-provider.h
index 6beaab75e..872da3c7d 100644
--- a/lib/stream-provider.h
+++ b/lib/stream-provider.h
@@ -109,6 +109,18 @@ struct stream_class {
* accepted for transmission, it should return -EAGAIN immediately. */
ssize_t (*send)(struct stream *stream, const void *buffer, size_t n);
+ /* Allows 'stream' to perform maintenance activities, such as flushing
+ * output buffers.
+ *
+ * May be null if 'stream' doesn't have anything to do here. */
+ void (*run)(struct stream *stream);
+
+ /* Arranges for the poll loop to wake up when 'stream' needs to perform
+ * maintenance activities.
+ *
+ * May be null if 'stream' doesn't have anything to do here. */
+ void (*run_wait)(struct stream *stream);
+
/* Arranges for the poll loop to wake up when 'stream' is ready to take an
* action of the given 'type'. */
void (*wait)(struct stream *stream, enum stream_wait_type type);