diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-02 13:12:16 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-02 13:19:04 -0600 |
commit | fa7f6a5176a386f8847810f34538d5c0e56f0fb1 (patch) | |
tree | ebcab0fd2b7936a53c77ad7c6614f548b0436103 /lib9p/internal.h | |
parent | 50cfe77ace4caa424352a163f90bbf7a684b60d6 (diff) |
lib9p: Rename checksize to validate
Diffstat (limited to 'lib9p/internal.h')
-rw-r--r-- | lib9p/internal.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib9p/internal.h b/lib9p/internal.h index d1da014..d1c36cf 100644 --- a/lib9p/internal.h +++ b/lib9p/internal.h @@ -17,7 +17,8 @@ #define USE_CONFIG_COROUTINE #include "config.h" static_assert(CONFIG_9P_MAX_ERR_SIZE <= UINT16_MAX); -static_assert(CONFIG_9P_MAX_MSG_SIZE <= SSIZE_MAX); +static_assert(CONFIG_9P_MAX_MSG_SIZE <= CONFIG_9P_MAX_HOSTMSG_SIZE); +static_assert(CONFIG_9P_MAX_HOSTMSG_SIZE <= SSIZE_MAX); static_assert(CONFIG_9P_MAX_ERR_SIZE + CONFIG_9P_MAX_MSG_SIZE + 2*CONFIG_9P_MAX_HOSTMSG_SIZE < CONFIG_COROUTINE_DEFAULT_STACK_SIZE); /* C language *****************************************************************/ @@ -43,7 +44,7 @@ struct lib9p_ctx { /* vtables ********************************************************************/ -struct _checksize_ctx { +struct _validate_ctx { struct lib9p_ctx *ctx; uint32_t net_size; uint8_t *net_bytes; @@ -53,7 +54,7 @@ struct _checksize_ctx { * "extra" beyond sizeof(). */ size_t host_extra; }; -typedef bool (*_checksize_fn_t)(struct _checksize_ctx *ctx); +typedef bool (*_validate_fn_t)(struct _validate_ctx *ctx); struct _unmarshal_ctx { struct lib9p_ctx *ctx; @@ -74,8 +75,8 @@ struct _marshal_ctx { typedef bool (*_marshal_fn_t)(struct _marshal_ctx *ctx, void *host_val); struct _vtable_msg { - size_t unmarshal_basesize; - _checksize_fn_t unmarshal_extrasize; + size_t basesize; + _validate_fn_t validate; _unmarshal_fn_t unmarshal; _marshal_fn_t marshal; }; |