summaryrefslogtreecommitdiff
path: root/lib9p/internal.h
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-02-10 10:16:52 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-02-11 16:55:04 -0700
commita0f5064ed0f3ee42a0b303e111bd89641a926676 (patch)
tree8f0bc8097d2f190f15575a75170715ca5f136c66 /lib9p/internal.h
parent64d17cced4136bb4f72bd1ba23a9b4ca4fc34451 (diff)
lib9p: Add comments clarifying why I split the `subctx`s the way I did
Diffstat (limited to 'lib9p/internal.h')
-rw-r--r--lib9p/internal.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib9p/internal.h b/lib9p/internal.h
index d939d46..a648532 100644
--- a/lib9p/internal.h
+++ b/lib9p/internal.h
@@ -39,10 +39,12 @@ static_assert(CONFIG_9P_MAX_HOSTMSG_SIZE <= SSIZE_MAX);
/* specialized contexts *******************************************************/
struct _validate_ctx {
+ /* input */
struct lib9p_ctx *ctx;
uint32_t net_size;
uint8_t *net_bytes;
+ /* output */
uint32_t net_offset;
/* Increment `host_extra` to pre-allocate space that is
* "extra" beyond sizeof(). */
@@ -51,9 +53,11 @@ struct _validate_ctx {
typedef bool (*_validate_fn_t)(struct _validate_ctx *ctx);
struct _unmarshal_ctx {
+ /* input */
struct lib9p_ctx *ctx;
uint8_t *net_bytes;
+ /* output */
uint32_t net_offset;
/* `extra` points to the beginning of unallocated space. */
void *extra;
@@ -61,8 +65,10 @@ struct _unmarshal_ctx {
typedef void (*_unmarshal_fn_t)(struct _unmarshal_ctx *ctx, void *out);
struct _marshal_ctx {
+ /* input */
struct lib9p_ctx *ctx;
+ /* output */
uint8_t *net_bytes;
uint32_t net_offset;
};