summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe
diff options
context:
space:
mode:
authorMichael Brown2007-01-30 13:17:03 +0100
committerMichael Brown2007-01-30 13:17:03 +0100
commit2f7eac16467abd7f5a354ceea42af8502c0d5f21 (patch)
treefcfadd24a21247a45f5c0e55a6ed19a6120006e3 /src/include/gpxe
parentDefinition of a (hopefully) generic stream API (diff)
downloadipxe-2f7eac16467abd7f5a354ceea42af8502c0d5f21.tar.gz
ipxe-2f7eac16467abd7f5a354ceea42af8502c0d5f21.tar.xz
ipxe-2f7eac16467abd7f5a354ceea42af8502c0d5f21.zip
Low-overhead filter streams
Diffstat (limited to 'src/include/gpxe')
-rw-r--r--src/include/gpxe/filter.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/include/gpxe/filter.h b/src/include/gpxe/filter.h
new file mode 100644
index 000000000..585bbe15d
--- /dev/null
+++ b/src/include/gpxe/filter.h
@@ -0,0 +1,44 @@
+#ifndef _GPXE_FILTER_H
+#define _GPXE_FILTER_H
+
+/** @file
+ *
+ * Filter streams
+ */
+
+#include <gpxe/stream.h>
+
+/** A filter stream */
+struct filter_stream {
+ /** Upstream
+ *
+ * This is the end pointing towards the top-level application
+ * (e.g. HTTP).
+ */
+ struct stream_connection upstream;
+ /** Downstream
+ *
+ * This is the end pointing towards the bottom-level
+ * connection (e.g. TCP).
+ */
+ struct stream_application downstream;
+};
+
+extern void filter_connected ( struct stream_application *app );
+extern void filter_closed ( struct stream_application *app, int rc );
+extern void filter_senddata ( struct stream_application *app,
+ void *data, size_t len );
+extern void filter_acked ( struct stream_application *app, size_t len );
+extern void filter_newdata ( struct stream_application *app,
+ void *data, size_t len );
+
+extern int filter_bind ( struct stream_connection *conn,
+ struct sockaddr *local );
+extern int filter_connect ( struct stream_connection *conn,
+ struct sockaddr *peer );
+extern void filter_close ( struct stream_connection *conn );
+extern int filter_send ( struct stream_connection *conn,
+ void *data, size_t len );
+extern int filter_kick ( struct stream_connection *conn );
+
+#endif /* _GPXE_FILTER_H */