summaryrefslogtreecommitdiff
path: root/lib9p/internal.h
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-25 00:15:43 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-25 12:43:16 -0600
commitbb14e1f16b5d42934e55c7a53117cf50e1153188 (patch)
tree44f877740b0cd967dc313900ce45340eb58a59d6 /lib9p/internal.h
parentf17c709c6e35a0bea471a4e8ae7d2183b4a1f32d (diff)
lib9p: protogen: flatten the validate functions, same as (un)marshal
Diffstat (limited to 'lib9p/internal.h')
-rw-r--r--lib9p/internal.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib9p/internal.h b/lib9p/internal.h
index 801dc4c..4820f10 100644
--- a/lib9p/internal.h
+++ b/lib9p/internal.h
@@ -43,14 +43,8 @@ struct _validate_ctx {
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(). */
- size_t host_extra;
};
-typedef bool (*_validate_fn_t)(struct _validate_ctx *ctx);
+typedef ssize_t (*_validate_fn_t)(struct _validate_ctx *ctx);
struct _unmarshal_ctx {
/* input */
@@ -96,7 +90,7 @@ extern const struct _lib9p_recv_tentry _lib9p_table_Rmsg_recv[LIB9P_VER_NUM][0x8
extern const struct _lib9p_send_tentry _lib9p_table_Tmsg_send[LIB9P_VER_NUM][0x80];
extern const struct _lib9p_send_tentry _lib9p_table_Rmsg_send[LIB9P_VER_NUM][0x80];
-bool _lib9p_stat_validate(struct _validate_ctx *ctx);
+ssize_t _lib9p_stat_validate(struct _validate_ctx *ctx, uint32_t *ret_net_size);
void _lib9p_stat_unmarshal(struct _unmarshal_ctx *ctx, struct lib9p_stat *out);
bool _lib9p_stat_marshal(struct _marshal_ctx *ctx, struct lib9p_stat *val);