diff options
Diffstat (limited to '')
-rw-r--r-- | src/mds-server/queued_interception.h | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/src/mds-server/queued_interception.h b/src/mds-server/queued_interception.h index 6f08a8a..ddab418 100644 --- a/src/mds-server/queued_interception.h +++ b/src/mds-server/queued_interception.h @@ -32,7 +32,7 @@ typedef struct queued_interception /** * The intercepting client */ - client_t* client; + struct client* client; /** * The interception priority @@ -44,8 +44,48 @@ typedef struct queued_interception */ int modifying; + /** + * The file descriptor of the intercepting client's socket (used for unmarshalling) + */ + int socket_fd; + } queued_interception_t; +/** + * Calculate the buffer size need to marshal a queued interception + * + * @param this The client information + * @return The number of bytes to allocate to the output buffer + */ +size_t queued_interception_marshal_size(void) __attribute__((const)); + +/** + * Marshals a queued interception + * + * @param this The queued interception + * @param data Output buffer for the marshalled data + * @return The number of bytes that have been written (everything will be written) + */ +size_t queued_interception_marshal(const queued_interception_t* restrict this, char* restrict data); + +/** + * Unmarshals a queued interception + * + * @param this Memory slot in which to store the new queued interception + * @param data In buffer with the marshalled data + * @return Zero on error, errno will be set accordingly, otherwise the number of read bytes. + */ +size_t queued_interception_unmarshal(queued_interception_t* restrict this, char* restrict data); + +/** + * Pretend to unmarshal a queued interception + * + * @param data In buffer with the marshalled data + * @return The number of read bytes + */ +size_t queued_interception_unmarshal_skip(void) __attribute__((const)); + + #endif |