summaryrefslogtreecommitdiff
path: root/lib9p
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-02 15:42:10 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-02 15:42:10 -0600
commit45b0b2d85fbc284453056c0768c7646df1de9b52 (patch)
tree69dd9326bddbc6c69cda8958d07a07c23b77fa01 /lib9p
parent79480e66113b7654d1ed89b940222b6eee84c8b0 (diff)
lib9p: doc comments
Diffstat (limited to 'lib9p')
-rw-r--r--lib9p/include/lib9p/9p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib9p/include/lib9p/9p.h b/lib9p/include/lib9p/9p.h
index 1c8f2e5..2712998 100644
--- a/lib9p/include/lib9p/9p.h
+++ b/lib9p/include/lib9p/9p.h
@@ -42,6 +42,7 @@ int lib9p_errorf(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *fmt, .
*
* @return required size, or -1 on error
*
+ * @errno LINUX_EOPNOTSUPP: message has unknown type
* @errno LINUX_EBADMSG: message is wrong size for content
* @errno LINUX_EBADMSG: message contains invalid UTF-8
* @errno LINUX_EBADMSG: message contains a bitfield with unknown bits
@@ -55,6 +56,9 @@ ssize_t lib9p_validate(struct lib9p_ctx *ctx, uint8_t *net_bytes);
* Emits an error (return 0, set ctx->err_num and ctx->err_msg) if a
* string contains invalid UTF-8 or a nul-byte.
*
+ * lib9p_unmarshal does no validation; you must run lib9p_validate()
+ * first.
+ *
* @param ctx : negotiated protocol parameters, where to record errors
* @param net_bytes : the complete message, starting with the "size[4]"
*
@@ -68,6 +72,9 @@ void lib9p_unmarshal(struct lib9p_ctx *ctx, uint8_t *net_bytes,
/**
* Marshal a `struct lib9p_msg_{typ}` structure into a byte-array.
*
+ * lib9p_marshal does no validation; it trusts that the programmer
+ * won't give it garbage input.
+ *
* @param ctx : negotiated protocol parameters, where to record errors
* @param typ : the message type
* @param tag : the message-ID tag