summaryrefslogtreecommitdiff
path: root/lib9p/include
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/include')
-rw-r--r--lib9p/include/lib9p/9p.generated.h283
-rw-r--r--lib9p/include/lib9p/9p.h4
2 files changed, 176 insertions, 111 deletions
diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h
index a5b719e..d34a0f6 100644
--- a/lib9p/include/lib9p/9p.generated.h
+++ b/lib9p/include/lib9p/9p.generated.h
@@ -6,6 +6,8 @@
#include <stdint.h> /* for uint{n}_t types */
+#include <libhw/generic/net.h> /* for struct iovec */
+
/* config *********************************************************************/
#include "config.h"
@@ -20,6 +22,13 @@
#ifndef CONFIG_9P_ENABLE_9P2000_e
#error config.h must define CONFIG_9P_ENABLE_9P2000_e
+#else
+ #if CONFIG_9P_ENABLE_9P2000_e
+ #ifndef(CONFIG_9P_MAX_9P2000_e_WELEM)
+ #error if CONFIG_9P_ENABLE_9P2000_e then config.h must define CONFIG_9P_MAX_9P2000_e_WELEM
+ #endif
+ static_assert(CONFIG_9P_MAX_9P2000_e_WELEM > 0);
+ #endif
#endif
#ifndef CONFIG_9P_ENABLE_9P2000_p9p
@@ -148,15 +157,15 @@ enum lib9p_msg_type { /* uint8_t */
/* payload types **************************************************************/
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 2 */
+/* size = 2 ; max_iov = 1 ; max_copy = 2 */
typedef uint16_t lib9p_tag_t;
#define LIB9P_TAG_NOTAG ((lib9p_tag_t)UINT16_C(~0))
-/* size = 4 */
+/* size = 4 ; max_iov = 1 ; max_copy = 4 */
typedef uint32_t lib9p_fid_t;
#define LIB9P_FID_NOFID ((lib9p_fid_t)UINT32_C(~0))
-/* min_size = 2 ; max_size = 65,537 */
+/* min_size = 2 ; exp_size = 29 ; max_size = 65,537 ; max_iov = 2 ; max_copy = 2 */
struct lib9p_s {
uint16_t len;
[[gnu::nonstring]] char *utf8;
@@ -164,7 +173,7 @@ struct lib9p_s {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 4 */
+/* size = 4 ; max_iov = 1 ; max_copy = 4 */
typedef uint32_t lib9p_dm_t;
#define LIB9P_DM_DIR ((lib9p_dm_t)(1<<31))
@@ -208,7 +217,7 @@ typedef uint32_t lib9p_dm_t;
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 1 */
+/* size = 1 ; max_iov = 1 ; max_copy = 1 */
typedef uint8_t lib9p_qt_t;
#define LIB9P_QT_DIR ((lib9p_qt_t)(1<<7))
@@ -226,13 +235,13 @@ typedef uint8_t lib9p_qt_t;
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u
-/* size = 4 */
+/* size = 4 ; max_iov = 1 ; max_copy = 4 */
typedef uint32_t lib9p_nuid_t;
#define LIB9P_NUID_NONUID ((lib9p_nuid_t)UINT32_C(~0))
#endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 1 */
+/* size = 1 ; max_iov = 1 ; max_copy = 1 */
typedef uint8_t lib9p_o_t;
/* unused ((lib9p_o_t)(1<<7)) */
@@ -253,7 +262,7 @@ typedef uint8_t lib9p_o_t;
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
-/* size = 8 */
+/* size = 8 ; max_iov = 1 ; max_copy = 8 */
typedef uint64_t lib9p_getattr_t;
/* unused ((lib9p_getattr_t)(1<<63)) */
@@ -324,7 +333,7 @@ typedef uint64_t lib9p_getattr_t;
#define LIB9P_GETATTR_BASIC ((lib9p_getattr_t)(0x000007ff))
#define LIB9P_GETATTR_ALL ((lib9p_getattr_t)(0x00003fff))
-/* size = 4 */
+/* size = 4 ; max_iov = 1 ; max_copy = 4 */
typedef uint32_t lib9p_setattr_t;
/* unused ((lib9p_setattr_t)(1<<31)) */
@@ -360,13 +369,13 @@ typedef uint32_t lib9p_setattr_t;
#define LIB9P_SETATTR_UID ((lib9p_setattr_t)(1<<1))
#define LIB9P_SETATTR_MODE ((lib9p_setattr_t)(1<<0))
-/* size = 1 */
+/* size = 1 ; max_iov = 1 ; max_copy = 1 */
typedef uint8_t lib9p_lock_type_t;
#define LIB9P_LOCK_TYPE_RDLCK ((lib9p_lock_type_t)UINT8_C(0))
#define LIB9P_LOCK_TYPE_WRLCK ((lib9p_lock_type_t)UINT8_C(1))
#define LIB9P_LOCK_TYPE_UNLCK ((lib9p_lock_type_t)UINT8_C(2))
-/* size = 4 */
+/* size = 4 ; max_iov = 1 ; max_copy = 4 */
typedef uint32_t lib9p_lock_flags_t;
/* unused ((lib9p_lock_flags_t)(1<<31)) */
@@ -402,7 +411,7 @@ typedef uint32_t lib9p_lock_flags_t;
#define LIB9P_LOCK_FLAGS_RECLAIM ((lib9p_lock_flags_t)(1<<1))
#define LIB9P_LOCK_FLAGS_BLOCK ((lib9p_lock_flags_t)(1<<0))
-/* size = 1 */
+/* size = 1 ; max_iov = 1 ; max_copy = 1 */
typedef uint8_t lib9p_lock_status_t;
#define LIB9P_LOCK_STATUS_SUCCESS ((lib9p_lock_status_t)UINT8_C(0))
#define LIB9P_LOCK_STATUS_BLOCKED ((lib9p_lock_status_t)UINT8_C(1))
@@ -411,56 +420,56 @@ typedef uint8_t lib9p_lock_status_t;
#endif /* CONFIG_9P_ENABLE_9P2000_L */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 9 */
+/* size = 9 ; max_iov = 1 ; max_copy = 9 */
struct lib9p_msg_Tflush {
lib9p_tag_t tag;
uint16_t oldtag;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rflush {
lib9p_tag_t tag;
};
-/* min_size = 11 ; max_size = 2,147,483,658 */
+/* min_size = 11 ; exp_size = 8,203 ; max_size = 2,147,483,658 ; max_iov = 2 ; max_copy = 11 */
struct lib9p_msg_Rread {
lib9p_tag_t tag;
uint32_t count;
[[gnu::nonstring]] char *data;
};
-/* size = 11 */
+/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Rwrite {
lib9p_tag_t tag;
uint32_t count;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rclunk {
lib9p_tag_t tag;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rremove {
lib9p_tag_t tag;
};
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rwstat {
lib9p_tag_t tag;
};
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
-/* size = 11 */
+/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Rlerror {
lib9p_tag_t tag;
uint32_t ecode;
};
-/* size = 67 */
+/* size = 67 ; max_iov = 1 ; max_copy = 67 */
struct lib9p_msg_Rstatfs {
lib9p_tag_t tag;
uint32_t type;
@@ -474,75 +483,75 @@ struct lib9p_msg_Rstatfs {
uint32_t namelen;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rrename {
lib9p_tag_t tag;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rsetattr {
lib9p_tag_t tag;
};
-/* size = 15 */
+/* size = 15 ; max_iov = 1 ; max_copy = 15 */
struct lib9p_msg_Rxattrwalk {
lib9p_tag_t tag;
uint64_t attr_size;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rxattrcreate {
lib9p_tag_t tag;
};
-/* min_size = 11 ; max_size = 4,294,967,306 (warning: >UINT32_MAX) */
+/* min_size = 11 ; exp_size = 8,203 ; max_size = 4,294,967,306 (warning: >UINT32_MAX) ; max_iov = 2 ; max_copy = 11 */
struct lib9p_msg_Rreaddir {
lib9p_tag_t tag;
uint32_t count;
[[gnu::nonstring]] char *data;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rfsync {
lib9p_tag_t tag;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rlink {
lib9p_tag_t tag;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rrenameat {
lib9p_tag_t tag;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Runlinkat {
lib9p_tag_t tag;
};
#endif /* CONFIG_9P_ENABLE_9P2000_L */
#if CONFIG_9P_ENABLE_9P2000_e
-/* size = 15 */
+/* size = 15 ; max_iov = 1 ; max_copy = 15 */
struct lib9p_msg_Tsession {
lib9p_tag_t tag;
uint64_t key;
};
-/* size = 7 */
+/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rsession {
lib9p_tag_t tag;
};
-/* min_size = 11 ; max_size = 4,294,967,306 (warning: >UINT32_MAX) */
+/* min_size = 11 ; exp_size = 8,203 ; max_size = 4,294,967,306 (warning: >UINT32_MAX) ; max_iov = 2 ; max_copy = 11 */
struct lib9p_msg_Rsread {
lib9p_tag_t tag;
uint32_t count;
[[gnu::nonstring]] char *data;
};
-/* size = 11 */
+/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Rswrite {
lib9p_tag_t tag;
uint32_t count;
@@ -550,7 +559,7 @@ struct lib9p_msg_Rswrite {
#endif /* CONFIG_9P_ENABLE_9P2000_e */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 23 */
+/* size = 23 ; max_iov = 1 ; max_copy = 23 */
struct lib9p_msg_Tread {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -558,7 +567,7 @@ struct lib9p_msg_Tread {
uint32_t count;
};
-/* min_size = 23 ; max_size = 2,147,483,670 */
+/* min_size = 23 ; exp_size = 8,215 ; max_size = 2,147,483,670 ; max_iov = 2 ; max_copy = 23 */
struct lib9p_msg_Twrite {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -567,13 +576,13 @@ struct lib9p_msg_Twrite {
[[gnu::nonstring]] char *data;
};
-/* size = 11 */
+/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Tclunk {
lib9p_tag_t tag;
lib9p_fid_t fid;
};
-/* size = 11 */
+/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Tremove {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -581,7 +590,7 @@ struct lib9p_msg_Tremove {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 11 */
+/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Tstat {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -589,26 +598,26 @@ struct lib9p_msg_Tstat {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
-/* size = 11 */
+/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Tstatfs {
lib9p_tag_t tag;
lib9p_fid_t fid;
};
-/* size = 15 */
+/* size = 15 ; max_iov = 1 ; max_copy = 15 */
struct lib9p_msg_Tlopen {
lib9p_tag_t tag;
lib9p_fid_t fid;
uint32_t flags;
};
-/* size = 11 */
+/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Treadlink {
lib9p_tag_t tag;
lib9p_fid_t fid;
};
-/* size = 23 */
+/* size = 23 ; max_iov = 1 ; max_copy = 23 */
struct lib9p_msg_Treaddir {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -616,7 +625,7 @@ struct lib9p_msg_Treaddir {
uint32_t count;
};
-/* size = 15 */
+/* size = 15 ; max_iov = 1 ; max_copy = 15 */
struct lib9p_msg_Tfsync {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -625,25 +634,25 @@ struct lib9p_msg_Tfsync {
#endif /* CONFIG_9P_ENABLE_9P2000_L */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* min_size = 13 ; max_size = 65,548 */
+/* min_size = 13 ; exp_size = 40 ; max_size = 65,548 ; max_iov = 2 ; max_copy = 13 */
struct lib9p_msg_Tversion {
lib9p_tag_t tag;
uint32_t max_msg_size;
struct lib9p_s version;
};
-/* min_size = 13 ; max_size = 65,548 */
+/* min_size = 13 ; exp_size = 40 ; max_size = 65,548 ; max_iov = 2 ; max_copy = 13 */
struct lib9p_msg_Rversion {
lib9p_tag_t tag;
uint32_t max_msg_size;
struct lib9p_s version;
};
-/* LIB9P_VER_9P2000 : min_size = 9 ; max_size = 65,544 */
-/* LIB9P_VER_9P2000_L : min_size = 9 ; max_size = 65,544 */
-/* LIB9P_VER_9P2000_e : min_size = 9 ; max_size = 65,544 */
-/* LIB9P_VER_9P2000_p9p: min_size = 9 ; max_size = 65,544 */
-/* LIB9P_VER_9P2000_u : min_size = 13 ; max_size = 65,548 */
+/* LIB9P_VER_9P2000 : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
+/* LIB9P_VER_9P2000_L : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
+/* LIB9P_VER_9P2000_e : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
+/* LIB9P_VER_9P2000_p9p: min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
+/* LIB9P_VER_9P2000_u : min_size = 13 ; exp_size = 40 ; max_size = 65,548 ; max_iov = 3 ; max_copy = 13 */
struct lib9p_msg_Rerror {
lib9p_tag_t tag;
struct lib9p_s ename;
@@ -652,7 +661,7 @@ struct lib9p_msg_Rerror {
#endif /* CONFIG_9P_ENABLE_9P2000_u */
};
-/* min_size = 17 ; max_size = 1,048,609 */
+/* min_size = 17 ; exp_size = 481 ; max_size = 1,048,609 ; max_iov = 32 ; max_copy = 49 */
struct lib9p_msg_Twalk {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -663,7 +672,7 @@ struct lib9p_msg_Twalk {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
-/* min_size = 17 ; max_size = 65,552 */
+/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 2 ; max_copy = 17 */
struct lib9p_msg_Trename {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -671,13 +680,13 @@ struct lib9p_msg_Trename {
struct lib9p_s name;
};
-/* min_size = 9 ; max_size = 65,544 */
+/* min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */
struct lib9p_msg_Rreadlink {
lib9p_tag_t tag;
struct lib9p_s target;
};
-/* min_size = 17 ; max_size = 65,552 */
+/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 2 ; max_copy = 17 */
struct lib9p_msg_Txattrwalk {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -685,7 +694,7 @@ struct lib9p_msg_Txattrwalk {
struct lib9p_s name;
};
-/* min_size = 25 ; max_size = 65,560 */
+/* min_size = 25 ; exp_size = 52 ; max_size = 65,560 ; max_iov = 3 ; max_copy = 25 */
struct lib9p_msg_Txattrcreate {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -694,7 +703,7 @@ struct lib9p_msg_Txattrcreate {
uint32_t flags;
};
-/* min_size = 34 ; max_size = 65,569 */
+/* min_size = 34 ; exp_size = 61 ; max_size = 65,569 ; max_iov = 2 ; max_copy = 34 */
struct lib9p_msg_Tgetlock {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -705,7 +714,7 @@ struct lib9p_msg_Tgetlock {
struct lib9p_s client_id;
};
-/* min_size = 30 ; max_size = 65,565 */
+/* min_size = 30 ; exp_size = 57 ; max_size = 65,565 ; max_iov = 2 ; max_copy = 30 */
struct lib9p_msg_Rgetlock {
lib9p_tag_t tag;
uint8_t type;
@@ -715,7 +724,7 @@ struct lib9p_msg_Rgetlock {
struct lib9p_s client_id;
};
-/* min_size = 17 ; max_size = 65,552 */
+/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 2 ; max_copy = 17 */
struct lib9p_msg_Tlink {
lib9p_tag_t tag;
lib9p_fid_t dfid;
@@ -723,7 +732,7 @@ struct lib9p_msg_Tlink {
struct lib9p_s name;
};
-/* min_size = 19 ; max_size = 131,089 */
+/* min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 4 ; max_copy = 19 */
struct lib9p_msg_Trenameat {
lib9p_tag_t tag;
lib9p_fid_t olddirfid;
@@ -732,7 +741,7 @@ struct lib9p_msg_Trenameat {
struct lib9p_s newname;
};
-/* min_size = 17 ; max_size = 65,552 */
+/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 3 ; max_copy = 17 */
struct lib9p_msg_Tunlinkat {
lib9p_tag_t tag;
lib9p_fid_t dirfd;
@@ -742,7 +751,7 @@ struct lib9p_msg_Tunlinkat {
#endif /* CONFIG_9P_ENABLE_9P2000_L */
#if CONFIG_9P_ENABLE_9P2000_e
-/* min_size = 13 ; max_size = 4,294,967,308 (warning: >UINT32_MAX) */
+/* min_size = 13 ; exp_size = 477 ; max_size = 4,294,967,308 (warning: >UINT32_MAX) ; max_iov = 0 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2) ; max_copy = 13 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2) */
struct lib9p_msg_Tsread {
lib9p_tag_t tag;
uint32_t fid;
@@ -750,7 +759,7 @@ struct lib9p_msg_Tsread {
struct lib9p_s *wname;
};
-/* min_size = 17 ; max_size = 8,589,934,607 (warning: >UINT32_MAX) */
+/* min_size = 17 ; exp_size = 8,673 ; max_size = 8,589,934,607 (warning: >UINT32_MAX) ; max_iov = 2 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2) ; max_copy = 17 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2) */
struct lib9p_msg_Tswrite {
lib9p_tag_t tag;
uint32_t fid;
@@ -762,18 +771,18 @@ struct lib9p_msg_Tswrite {
#endif /* CONFIG_9P_ENABLE_9P2000_e */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 13 */
+/* size = 13 ; max_iov = 1 ; max_copy = 13 */
struct lib9p_qid {
lib9p_qt_t type;
uint32_t vers;
uint64_t path;
};
-/* LIB9P_VER_9P2000 : min_size = 15 ; max_size = 131,085 */
-/* LIB9P_VER_9P2000_L : min_size = 19 ; max_size = 131,089 */
-/* LIB9P_VER_9P2000_e : min_size = 15 ; max_size = 131,085 */
-/* LIB9P_VER_9P2000_p9p: min_size = 15 ; max_size = 131,085 */
-/* LIB9P_VER_9P2000_u : min_size = 19 ; max_size = 131,089 */
+/* LIB9P_VER_9P2000 : min_size = 15 ; exp_size = 69 ; max_size = 131,085 ; max_iov = 4 ; max_copy = 15 */
+/* LIB9P_VER_9P2000_L : min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 5 ; max_copy = 19 */
+/* LIB9P_VER_9P2000_e : min_size = 15 ; exp_size = 69 ; max_size = 131,085 ; max_iov = 4 ; max_copy = 15 */
+/* LIB9P_VER_9P2000_p9p: min_size = 15 ; exp_size = 69 ; max_size = 131,085 ; max_iov = 4 ; max_copy = 15 */
+/* LIB9P_VER_9P2000_u : min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 5 ; max_copy = 19 */
struct lib9p_msg_Tauth {
lib9p_tag_t tag;
lib9p_fid_t afid;
@@ -784,11 +793,11 @@ struct lib9p_msg_Tauth {
#endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */
};
-/* LIB9P_VER_9P2000 : min_size = 19 ; max_size = 131,089 */
-/* LIB9P_VER_9P2000_L : min_size = 23 ; max_size = 131,093 */
-/* LIB9P_VER_9P2000_e : min_size = 19 ; max_size = 131,089 */
-/* LIB9P_VER_9P2000_p9p: min_size = 19 ; max_size = 131,089 */
-/* LIB9P_VER_9P2000_u : min_size = 23 ; max_size = 131,093 */
+/* LIB9P_VER_9P2000 : min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 4 ; max_copy = 19 */
+/* LIB9P_VER_9P2000_L : min_size = 23 ; exp_size = 77 ; max_size = 131,093 ; max_iov = 5 ; max_copy = 23 */
+/* LIB9P_VER_9P2000_e : min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 4 ; max_copy = 19 */
+/* LIB9P_VER_9P2000_p9p: min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 4 ; max_copy = 19 */
+/* LIB9P_VER_9P2000_u : min_size = 23 ; exp_size = 77 ; max_size = 131,093 ; max_iov = 5 ; max_copy = 23 */
struct lib9p_msg_Tattach {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -802,7 +811,7 @@ struct lib9p_msg_Tattach {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_L
-/* min_size = 25 ; max_size = 65,560 */
+/* min_size = 25 ; exp_size = 52 ; max_size = 65,560 ; max_iov = 3 ; max_copy = 25 */
struct lib9p_msg_Tlcreate {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -812,7 +821,7 @@ struct lib9p_msg_Tlcreate {
lib9p_nuid_t gid;
};
-/* min_size = 19 ; max_size = 131,089 */
+/* min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 5 ; max_copy = 19 */
struct lib9p_msg_Tsymlink {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -821,7 +830,7 @@ struct lib9p_msg_Tsymlink {
lib9p_nuid_t gid;
};
-/* min_size = 29 ; max_size = 65,564 */
+/* min_size = 29 ; exp_size = 56 ; max_size = 65,564 ; max_iov = 3 ; max_copy = 29 */
struct lib9p_msg_Tmknod {
lib9p_tag_t tag;
lib9p_fid_t dfid;
@@ -832,7 +841,7 @@ struct lib9p_msg_Tmknod {
lib9p_nuid_t gid;
};
-/* min_size = 21 ; max_size = 65,556 */
+/* min_size = 21 ; exp_size = 48 ; max_size = 65,556 ; max_iov = 3 ; max_copy = 21 */
struct lib9p_msg_Tmkdir {
lib9p_tag_t tag;
lib9p_fid_t dfid;
@@ -843,14 +852,14 @@ struct lib9p_msg_Tmkdir {
#endif /* CONFIG_9P_ENABLE_9P2000_L */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 12 */
+/* size = 12 ; max_iov = 1 ; max_copy = 12 */
struct lib9p_msg_Topen {
lib9p_tag_t tag;
lib9p_fid_t fid;
lib9p_o_t mode;
};
-/* min_size = 18 ; max_size = 65,553 */
+/* min_size = 18 ; exp_size = 45 ; max_size = 65,553 ; max_iov = 3 ; max_copy = 18 */
struct lib9p_msg_Tcreate {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -861,7 +870,7 @@ struct lib9p_msg_Tcreate {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_p9p
-/* size = 12 */
+/* size = 12 ; max_iov = 1 ; max_copy = 12 */
struct lib9p_msg_Topenfd {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -870,14 +879,14 @@ struct lib9p_msg_Topenfd {
#endif /* CONFIG_9P_ENABLE_9P2000_p9p */
#if CONFIG_9P_ENABLE_9P2000_L
-/* size = 19 */
+/* size = 19 ; max_iov = 1 ; max_copy = 19 */
struct lib9p_msg_Tgetattr {
lib9p_tag_t tag;
lib9p_fid_t fid;
lib9p_getattr_t request_mask;
};
-/* size = 67 */
+/* size = 67 ; max_iov = 1 ; max_copy = 67 */
struct lib9p_msg_Tsetattr {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -892,7 +901,7 @@ struct lib9p_msg_Tsetattr {
uint64_t mtime_nsec;
};
-/* min_size = 38 ; max_size = 65,573 */
+/* min_size = 38 ; exp_size = 65 ; max_size = 65,573 ; max_iov = 2 ; max_copy = 38 */
struct lib9p_msg_Tlock {
lib9p_tag_t tag;
lib9p_fid_t fid;
@@ -904,7 +913,7 @@ struct lib9p_msg_Tlock {
struct lib9p_s client_id;
};
-/* size = 8 */
+/* size = 8 ; max_iov = 1 ; max_copy = 8 */
struct lib9p_msg_Rlock {
lib9p_tag_t tag;
lib9p_lock_status_t status;
@@ -912,10 +921,10 @@ struct lib9p_msg_Rlock {
#endif /* CONFIG_9P_ENABLE_9P2000_L */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* LIB9P_VER_9P2000 : min_size = 49 ; max_size = 262,189 */
-/* LIB9P_VER_9P2000_e : min_size = 49 ; max_size = 262,189 */
-/* LIB9P_VER_9P2000_p9p: min_size = 49 ; max_size = 262,189 */
-/* LIB9P_VER_9P2000_u : min_size = 63 ; max_size = 327,738 */
+/* LIB9P_VER_9P2000 : min_size = 49 ; exp_size = 157 ; max_size = 262,189 ; max_iov = 8 ; max_copy = 49 */
+/* LIB9P_VER_9P2000_e : min_size = 49 ; exp_size = 157 ; max_size = 262,189 ; max_iov = 8 ; max_copy = 49 */
+/* LIB9P_VER_9P2000_p9p: min_size = 49 ; exp_size = 157 ; max_size = 262,189 ; max_iov = 8 ; max_copy = 49 */
+/* LIB9P_VER_9P2000_u : min_size = 63 ; exp_size = 198 ; max_size = 327,738 ; max_iov = 11 ; max_copy = 63 */
struct lib9p_stat {
uint16_t kern_type;
uint32_t kern_dev;
@@ -938,19 +947,19 @@ struct lib9p_stat {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 20 */
+/* size = 20 ; max_iov = 1 ; max_copy = 20 */
struct lib9p_msg_Rauth {
lib9p_tag_t tag;
struct lib9p_qid aqid;
};
-/* size = 20 */
+/* size = 20 ; max_iov = 1 ; max_copy = 20 */
struct lib9p_msg_Rattach {
lib9p_tag_t tag;
struct lib9p_qid qid;
};
-/* min_size = 9 ; max_size = 217 */
+/* min_size = 9 ; exp_size = 217 ; max_size = 217 ; max_iov = 1 ; max_copy = 217 */
struct lib9p_msg_Rwalk {
lib9p_tag_t tag;
uint16_t nwqid;
@@ -959,14 +968,14 @@ struct lib9p_msg_Rwalk {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* size = 24 */
+/* size = 24 ; max_iov = 1 ; max_copy = 24 */
struct lib9p_msg_Ropen {
lib9p_tag_t tag;
struct lib9p_qid qid;
uint32_t iounit;
};
-/* size = 24 */
+/* size = 24 ; max_iov = 1 ; max_copy = 24 */
struct lib9p_msg_Rcreate {
lib9p_tag_t tag;
struct lib9p_qid qid;
@@ -975,7 +984,7 @@ struct lib9p_msg_Rcreate {
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
#if CONFIG_9P_ENABLE_9P2000_p9p
-/* size = 28 */
+/* size = 28 ; max_iov = 1 ; max_copy = 28 */
struct lib9p_msg_Ropenfd {
lib9p_tag_t tag;
struct lib9p_qid qid;
@@ -985,33 +994,33 @@ struct lib9p_msg_Ropenfd {
#endif /* CONFIG_9P_ENABLE_9P2000_p9p */
#if CONFIG_9P_ENABLE_9P2000_L
-/* size = 24 */
+/* size = 24 ; max_iov = 1 ; max_copy = 24 */
struct lib9p_msg_Rlopen {
lib9p_tag_t tag;
struct lib9p_qid qid;
uint32_t iounit;
};
-/* size = 24 */
+/* size = 24 ; max_iov = 1 ; max_copy = 24 */
struct lib9p_msg_Rlcreate {
lib9p_tag_t tag;
struct lib9p_qid qid;
uint32_t iounit;
};
-/* size = 20 */
+/* size = 20 ; max_iov = 1 ; max_copy = 20 */
struct lib9p_msg_Rsymlink {
lib9p_tag_t tag;
struct lib9p_qid qid;
};
-/* size = 20 */
+/* size = 20 ; max_iov = 1 ; max_copy = 20 */
struct lib9p_msg_Rmknod {
lib9p_tag_t tag;
struct lib9p_qid qid;
};
-/* size = 160 */
+/* size = 160 ; max_iov = 1 ; max_copy = 160 */
struct lib9p_msg_Rgetattr {
lib9p_tag_t tag;
uint64_t valid;
@@ -1036,7 +1045,7 @@ struct lib9p_msg_Rgetattr {
uint64_t data_version;
};
-/* size = 20 */
+/* size = 20 ; max_iov = 1 ; max_copy = 20 */
struct lib9p_msg_Rmkdir {
lib9p_tag_t tag;
struct lib9p_qid qid;
@@ -1044,22 +1053,78 @@ struct lib9p_msg_Rmkdir {
#endif /* CONFIG_9P_ENABLE_9P2000_L */
#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
-/* LIB9P_VER_9P2000 : min_size = 58 ; max_size = 262,198 */
-/* LIB9P_VER_9P2000_e : min_size = 58 ; max_size = 262,198 */
-/* LIB9P_VER_9P2000_p9p: min_size = 58 ; max_size = 262,198 */
-/* LIB9P_VER_9P2000_u : min_size = 72 ; max_size = 327,747 */
+/* LIB9P_VER_9P2000 : min_size = 58 ; exp_size = 166 ; max_size = 262,198 ; max_iov = 8 ; max_copy = 58 */
+/* LIB9P_VER_9P2000_e : min_size = 58 ; exp_size = 166 ; max_size = 262,198 ; max_iov = 8 ; max_copy = 58 */
+/* LIB9P_VER_9P2000_p9p: min_size = 58 ; exp_size = 166 ; max_size = 262,198 ; max_iov = 8 ; max_copy = 58 */
+/* LIB9P_VER_9P2000_u : min_size = 72 ; exp_size = 207 ; max_size = 327,747 ; max_iov = 11 ; max_copy = 72 */
struct lib9p_msg_Rstat {
lib9p_tag_t tag;
struct lib9p_stat stat;
};
-/* LIB9P_VER_9P2000 : min_size = 62 ; max_size = 262,202 */
-/* LIB9P_VER_9P2000_e : min_size = 62 ; max_size = 262,202 */
-/* LIB9P_VER_9P2000_p9p: min_size = 62 ; max_size = 262,202 */
-/* LIB9P_VER_9P2000_u : min_size = 76 ; max_size = 327,751 */
+/* LIB9P_VER_9P2000 : min_size = 62 ; exp_size = 170 ; max_size = 262,202 ; max_iov = 8 ; max_copy = 62 */
+/* LIB9P_VER_9P2000_e : min_size = 62 ; exp_size = 170 ; max_size = 262,202 ; max_iov = 8 ; max_copy = 62 */
+/* LIB9P_VER_9P2000_p9p: min_size = 62 ; exp_size = 170 ; max_size = 262,202 ; max_iov = 8 ; max_copy = 62 */
+/* LIB9P_VER_9P2000_u : min_size = 76 ; exp_size = 211 ; max_size = 327,751 ; max_iov = 11 ; max_copy = 76 */
struct lib9p_msg_Twstat {
lib9p_tag_t tag;
lib9p_fid_t fid;
struct lib9p_stat stat;
};
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
+
+/* containers *****************************************************************/
+
+#define _LIB9P_MAX(a, b) ((a) > (b)) ? (a) : (b)
+
+#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
+ #if CONFIG_9P_ENABLE_9P2000_e
+ #define LIB9P_TMSG_MAX_IOV _LIB9P_MAX(32, 2 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2))
+ #else
+ #define LIB9P_TMSG_MAX_IOV 32
+ #endif
+#endif
+
+#if CONFIG_9P_ENABLE_9P2000_u
+ #if CONFIG_9P_ENABLE_9P2000_e
+ #define LIB9P_TMSG_MAX_COPY _LIB9P_MAX(76, 17 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2))
+ #else
+ #define LIB9P_TMSG_MAX_COPY 76
+ #endif
+#elif CONFIG_9P_ENABLE_9P2000_L
+ #if CONFIG_9P_ENABLE_9P2000_e
+ #define LIB9P_TMSG_MAX_COPY _LIB9P_MAX(67, 17 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2))
+ #else
+ #define LIB9P_TMSG_MAX_COPY 67
+ #endif
+#elif CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p
+ #if CONFIG_9P_ENABLE_9P2000_e
+ #define LIB9P_TMSG_MAX_COPY _LIB9P_MAX(62, 17 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2))
+ #else
+ #define LIB9P_TMSG_MAX_COPY 62
+ #endif
+#endif
+
+#if CONFIG_9P_ENABLE_9P2000_u
+ #define LIB9P_RMSG_MAX_IOV 11
+#elif CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p
+ #define LIB9P_RMSG_MAX_IOV 8
+#elif CONFIG_9P_ENABLE_9P2000_L
+ #define LIB9P_RMSG_MAX_IOV 2
+#endif
+
+#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u
+ #define LIB9P_RMSG_MAX_COPY 217
+#endif
+
+struct lib9p_Tmsg_send_buf {
+ size_t iov_cnt;
+ struct iovec iov[LIB9P_TMSG_MAX_IOV];
+ uint8_t copied[LIB9P_TMSG_MAX_COPY];
+};
+
+struct lib9p_Rmsg_send_buf {
+ size_t iov_cnt;
+ struct iovec iov[LIB9P_RMSG_MAX_IOV];
+ uint8_t copied[LIB9P_RMSG_MAX_COPY];
+};
diff --git a/lib9p/include/lib9p/9p.h b/lib9p/include/lib9p/9p.h
index d4764a2..68e007f 100644
--- a/lib9p/include/lib9p/9p.h
+++ b/lib9p/include/lib9p/9p.h
@@ -118,7 +118,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,
- uint8_t *ret_bytes);
+ struct lib9p_Tmsg_send_buf *ret);
/* main R-message functions ***************************************************/
@@ -128,7 +128,7 @@ 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,
- uint8_t *ret_bytes);
+ struct lib9p_Rmsg_send_buf *ret);
/* `struct lib9p_stat` helpers ************************************************/