summaryrefslogtreecommitdiffstats
path: root/src/method_null.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-02-26 23:13:08 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-02-26 23:13:08 +0100
commit13306fc146b4839d511287f29df8572a80bf8914 (patch)
tree081330075fabb3a93b0c9c49b9f9f2317934381e /src/method_null.c
parent57a63fc9304e71ddd2cf434cc4c8789a1a3a3c88 (diff)
downloadfastd-13306fc146b4839d511287f29df8572a80bf8914.tar
fastd-13306fc146b4839d511287f29df8572a80bf8914.zip
Implement I/O for a fixed peer
Diffstat (limited to 'src/method_null.c')
-rw-r--r--src/method_null.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/method_null.c b/src/method_null.c
index fd41110..dea84d4 100644
--- a/src/method_null.c
+++ b/src/method_null.c
@@ -25,21 +25,31 @@
*/
#include "fastd.h"
+#include "task.h"
-static void null_init(const fastd_context *ctx) {
+static size_t null_max_packet_size(fastd_context *ctx) {
+ return fastd_max_packet_size(ctx);
}
-static void null_recv(const fastd_context *ctx, void *buffer, size_t len) {
+static void null_init(fastd_context *ctx, const fastd_peer *peer) {
+ struct iovec buffer = { .iov_base = NULL, .iov_len = 0 };
+ fastd_task_put_send(ctx, peer, buffer);
}
-static void null_send(const fastd_context *ctx, void *buffer, size_t len) {
+static void null_handle_recv(fastd_context *ctx, const fastd_peer *peer, struct iovec buffer) {
+ fastd_task_put_handle_recv(ctx, peer, buffer);
+}
+
+static void null_send(fastd_context *ctx, const fastd_peer *peer, struct iovec buffer) {
+ fastd_task_put_send(ctx, peer, buffer);
}
const fastd_method fastd_method_null = {
.name = "null",
+ .method_max_packet_size = null_max_packet_size,
.method_init = null_init,
- .method_recv = null_recv,
+ .method_handle_recv = null_handle_recv,
.method_send = null_send,
};