summaryrefslogtreecommitdiff
path: root/lib9p/include
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/include')
-rw-r--r--lib9p/include/lib9p/9p.generated.h55
-rw-r--r--lib9p/include/lib9p/9p.h8
2 files changed, 59 insertions, 4 deletions
diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h
index a6dc13c..db43d82 100644
--- a/lib9p/include/lib9p/9p.generated.h
+++ b/lib9p/include/lib9p/9p.generated.h
@@ -397,3 +397,58 @@ struct lib9p_msg_Rswrite {
uint32_t count;
};
#endif /* CONFIG_9P_ENABLE_9P2000_e */
+
+/* container types ************************************************************/
+
+struct lib9p_Tmsg {
+ enum lib9p_msg_type typ;
+ union {
+#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u
+ struct lib9p_msg_Tversion Tversion;
+ struct lib9p_msg_Tauth Tauth;
+ struct lib9p_msg_Tattach Tattach;
+ struct lib9p_msg_Tflush Tflush;
+ struct lib9p_msg_Twalk Twalk;
+ struct lib9p_msg_Topen Topen;
+ struct lib9p_msg_Tcreate Tcreate;
+ struct lib9p_msg_Tread Tread;
+ struct lib9p_msg_Twrite Twrite;
+ struct lib9p_msg_Tclunk Tclunk;
+ struct lib9p_msg_Tremove Tremove;
+ struct lib9p_msg_Tstat Tstat;
+ struct lib9p_msg_Twstat Twstat;
+#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */
+#if CONFIG_9P_ENABLE_9P2000_e
+ struct lib9p_msg_Tsession Tsession;
+ struct lib9p_msg_Tsread Tsread;
+ struct lib9p_msg_Tswrite Tswrite;
+#endif /* CONFIG_9P_ENABLE_9P2000_e */
+ } body;
+};
+
+struct lib9p_Rmsg {
+ enum lib9p_msg_type typ;
+ union {
+#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u
+ struct lib9p_msg_Rversion Rversion;
+ struct lib9p_msg_Rauth Rauth;
+ struct lib9p_msg_Rattach Rattach;
+ struct lib9p_msg_Rerror Rerror;
+ struct lib9p_msg_Rflush Rflush;
+ struct lib9p_msg_Rwalk Rwalk;
+ struct lib9p_msg_Ropen Ropen;
+ struct lib9p_msg_Rcreate Rcreate;
+ struct lib9p_msg_Rread Rread;
+ struct lib9p_msg_Rwrite Rwrite;
+ struct lib9p_msg_Rclunk Rclunk;
+ struct lib9p_msg_Rremove Rremove;
+ struct lib9p_msg_Rstat Rstat;
+ struct lib9p_msg_Rwstat Rwstat;
+#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */
+#if CONFIG_9P_ENABLE_9P2000_e
+ struct lib9p_msg_Rsession Rsession;
+ struct lib9p_msg_Rsread Rsread;
+ struct lib9p_msg_Rswrite Rswrite;
+#endif /* CONFIG_9P_ENABLE_9P2000_e */
+ } body;
+};
diff --git a/lib9p/include/lib9p/9p.h b/lib9p/include/lib9p/9p.h
index 72a8292..adb7553 100644
--- a/lib9p/include/lib9p/9p.h
+++ b/lib9p/include/lib9p/9p.h
@@ -93,7 +93,7 @@ ssize_t lib9p_Tmsg_validate(struct lib9p_ctx *ctx, uint8_t *net_bytes);
* @return ret_body : the message body, must be at least lib9p_Tmsg_validate() bytes
*/
void lib9p_Tmsg_unmarshal(struct lib9p_ctx *ctx, uint8_t *net_bytes,
- enum lib9p_msg_type *ret_typ, void *ret_body);
+ struct lib9p_Tmsg *ret);
/**
* Marshal a `struct lib9p_msg_{typ}` structure into a byte-array.
@@ -113,7 +113,7 @@ void lib9p_Tmsg_unmarshal(struct lib9p_ctx *ctx, uint8_t *net_bytes,
*
* @errno LINUX_ERANGE: reply does not fit in ctx->max_msg_size
*/
-bool lib9p_Tmsg_marshal(struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *body,
+bool lib9p_Tmsg_marshal(struct lib9p_ctx *ctx, struct lib9p_Tmsg *msg,
uint8_t *ret_bytes);
/* main R-message functions ***************************************************/
@@ -122,8 +122,8 @@ bool lib9p_Tmsg_marshal(struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *bo
ssize_t lib9p_Rmsg_validate(struct lib9p_ctx *ctx, uint8_t *net_bytes);
void lib9p_Rmsg_unmarshal(struct lib9p_ctx *ctx, uint8_t *net_bytes,
- enum lib9p_msg_type *ret_typ, void *ret_body);
-bool lib9p_Rmsg_marshal(struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *body,
+ struct lib9p_Rmsg *ret);
+bool lib9p_Rmsg_marshal(struct lib9p_ctx *ctx, struct lib9p_Rmsg *msg,
uint8_t *ret_bytes);