summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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