From 8e6147292ea38b865cd0341e9c7c9827c9b611b5 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Wed, 13 Sep 2017 18:30:23 +0200 Subject: [PATCH] MINOR: mux: add more methods to mux_ops We'll need to support reading/writing from both sides, with buffers and pipes, as well as retrieving/updating flags. --- include/types/connection.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/types/connection.h b/include/types/connection.h index 9561406eb..66ec1b6b1 100644 --- a/include/types/connection.h +++ b/include/types/connection.h @@ -266,7 +266,17 @@ struct mux_ops { void (*recv)(struct connection *conn); /* mux-layer recv callback */ void (*send)(struct connection *conn); /* mux-layer send callback */ int (*wake)(struct connection *conn); /* mux-layer callback to report activity, mandatory */ + void (*update_poll)(struct conn_stream *cs); /* commit cs flags to mux/conn */ + int (*rcv_buf)(struct conn_stream *cs, struct buffer *buf, int count); /* Called from the upper layer to get data */ + int (*snd_buf)(struct conn_stream *cs, struct buffer *buf, int flags); /* Called from the upper layer to send data */ + int (*rcv_pipe)(struct conn_stream *cs, struct pipe *pipe, unsigned int count); /* recv-to-pipe callback */ + int (*snd_pipe)(struct conn_stream *cs, struct pipe *pipe); /* send-to-pipe callback */ + void (*shutr)(struct conn_stream *cs, int clean); /* shutr function */ + void (*shutw)(struct conn_stream *cs, int clean); /* shutw function */ + void (*release)(struct connection *conn); /* release all resources allocated by the mux */ + struct conn_stream *(*attach)(struct connection *); /* Create and attach a conn_stream to an outgoing connection */ + void (*detach)(struct conn_stream *); /* Detach a conn_stream from an outgoing connection, when the request is done */ char name[8]; /* mux layer name, zero-terminated */ };