diff options
Diffstat (limited to 'lib9p/include')
-rw-r--r-- | lib9p/include/lib9p/9p.generated.h | 436 | ||||
-rw-r--r-- | lib9p/include/lib9p/9p.h | 17 |
2 files changed, 285 insertions, 168 deletions
diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h index a1c9958..725e781 100644 --- a/lib9p/include/lib9p/9p.generated.h +++ b/lib9p/include/lib9p/9p.generated.h @@ -176,62 +176,62 @@ struct lib9p_s { /* size = 4 ; max_iov = 1 ; max_copy = 4 */ typedef uint32_t lib9p_dm_t; -#define LIB9P_DM_DIR ((lib9p_dm_t)(1<<31)) -#define LIB9P_DM_APPEND ((lib9p_dm_t)(1<<30)) -#define LIB9P_DM_EXCL ((lib9p_dm_t)(1<<29)) -#define _LIB9P_DM_PLAN9_MOUNT ((lib9p_dm_t)(1<<28)) -#define LIB9P_DM_AUTH ((lib9p_dm_t)(1<<27)) -#define LIB9P_DM_TMP ((lib9p_dm_t)(1<<26)) -/* unused ((lib9p_dm_t)(1<<25)) */ -/* unused ((lib9p_dm_t)(1<<24)) */ +#define LIB9P_DM_DIR ((lib9p_dm_t)(1<<31)) +#define LIB9P_DM_APPEND ((lib9p_dm_t)(1<<30)) +#define LIB9P_DM_EXCL ((lib9p_dm_t)(1<<29)) +#define _LIB9P_DM_RESERVED_PLAN9_MOUNT ((lib9p_dm_t)(1<<28)) +#define LIB9P_DM_AUTH ((lib9p_dm_t)(1<<27)) +#define LIB9P_DM_TMP ((lib9p_dm_t)(1<<26)) +/* unused ((lib9p_dm_t)(1<<25)) */ +/* unused ((lib9p_dm_t)(1<<24)) */ #if CONFIG_9P_ENABLE_9P2000_u -# define LIB9P_DM_DEVICE ((lib9p_dm_t)(1<<23)) +# define LIB9P_DM_DEVICE ((lib9p_dm_t)(1<<23)) #endif /* CONFIG_9P_ENABLE_9P2000_u */ -/* unused ((lib9p_dm_t)(1<<22)) */ +/* unused ((lib9p_dm_t)(1<<22)) */ #if CONFIG_9P_ENABLE_9P2000_u -# define LIB9P_DM_NAMEDPIPE ((lib9p_dm_t)(1<<21)) -# define LIB9P_DM_SOCKET ((lib9p_dm_t)(1<<20)) -# define LIB9P_DM_SETUID ((lib9p_dm_t)(1<<19)) -# define LIB9P_DM_SETGID ((lib9p_dm_t)(1<<18)) +# define LIB9P_DM_NAMEDPIPE ((lib9p_dm_t)(1<<21)) +# define LIB9P_DM_SOCKET ((lib9p_dm_t)(1<<20)) +# define LIB9P_DM_SETUID ((lib9p_dm_t)(1<<19)) +# define LIB9P_DM_SETGID ((lib9p_dm_t)(1<<18)) #endif /* CONFIG_9P_ENABLE_9P2000_u */ -/* unused ((lib9p_dm_t)(1<<17)) */ -/* unused ((lib9p_dm_t)(1<<16)) */ -/* unused ((lib9p_dm_t)(1<<15)) */ -/* unused ((lib9p_dm_t)(1<<14)) */ -/* unused ((lib9p_dm_t)(1<<13)) */ -/* unused ((lib9p_dm_t)(1<<12)) */ -/* unused ((lib9p_dm_t)(1<<11)) */ -/* unused ((lib9p_dm_t)(1<<10)) */ -/* unused ((lib9p_dm_t)(1<<9)) */ -#define LIB9P_DM_OWNER_R ((lib9p_dm_t)(1<<8)) -#define LIB9P_DM_OWNER_W ((lib9p_dm_t)(1<<7)) -#define LIB9P_DM_OWNER_X ((lib9p_dm_t)(1<<6)) -#define LIB9P_DM_GROUP_R ((lib9p_dm_t)(1<<5)) -#define LIB9P_DM_GROUP_W ((lib9p_dm_t)(1<<4)) -#define LIB9P_DM_GROUP_X ((lib9p_dm_t)(1<<3)) -#define LIB9P_DM_OTHER_R ((lib9p_dm_t)(1<<2)) -#define LIB9P_DM_OTHER_W ((lib9p_dm_t)(1<<1)) -#define LIB9P_DM_OTHER_X ((lib9p_dm_t)(1<<0)) - -#define LIB9P_DM_PERM_MASK ((lib9p_dm_t)(0777)) +/* unused ((lib9p_dm_t)(1<<17)) */ +/* unused ((lib9p_dm_t)(1<<16)) */ +/* unused ((lib9p_dm_t)(1<<15)) */ +/* unused ((lib9p_dm_t)(1<<14)) */ +/* unused ((lib9p_dm_t)(1<<13)) */ +/* unused ((lib9p_dm_t)(1<<12)) */ +/* unused ((lib9p_dm_t)(1<<11)) */ +/* unused ((lib9p_dm_t)(1<<10)) */ +/* unused ((lib9p_dm_t)(1<<9)) */ +#define LIB9P_DM_OWNER_R ((lib9p_dm_t)(1<<8)) +#define LIB9P_DM_OWNER_W ((lib9p_dm_t)(1<<7)) +#define LIB9P_DM_OWNER_X ((lib9p_dm_t)(1<<6)) +#define LIB9P_DM_GROUP_R ((lib9p_dm_t)(1<<5)) +#define LIB9P_DM_GROUP_W ((lib9p_dm_t)(1<<4)) +#define LIB9P_DM_GROUP_X ((lib9p_dm_t)(1<<3)) +#define LIB9P_DM_OTHER_R ((lib9p_dm_t)(1<<2)) +#define LIB9P_DM_OTHER_W ((lib9p_dm_t)(1<<1)) +#define LIB9P_DM_OTHER_X ((lib9p_dm_t)(1<<0)) + +#define LIB9P_DM_PERM_MASK ((lib9p_dm_t)(0777)) #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 ; max_iov = 1 ; max_copy = 1 */ typedef uint8_t lib9p_qt_t; -#define LIB9P_QT_DIR ((lib9p_qt_t)(1<<7)) -#define LIB9P_QT_APPEND ((lib9p_qt_t)(1<<6)) -#define LIB9P_QT_EXCL ((lib9p_qt_t)(1<<5)) -#define _LIB9P_QT_PLAN9_MOUNT ((lib9p_qt_t)(1<<4)) -#define LIB9P_QT_AUTH ((lib9p_qt_t)(1<<3)) -#define LIB9P_QT_TMP ((lib9p_qt_t)(1<<2)) +#define LIB9P_QT_DIR ((lib9p_qt_t)(1<<7)) +#define LIB9P_QT_APPEND ((lib9p_qt_t)(1<<6)) +#define LIB9P_QT_EXCL ((lib9p_qt_t)(1<<5)) +#define _LIB9P_QT_RESERVED_PLAN9_MOUNT ((lib9p_qt_t)(1<<4)) +#define LIB9P_QT_AUTH ((lib9p_qt_t)(1<<3)) +#define LIB9P_QT_TMP ((lib9p_qt_t)(1<<2)) #if CONFIG_9P_ENABLE_9P2000_u -# define LIB9P_QT_SYMLINK ((lib9p_qt_t)(1<<1)) +# define LIB9P_QT_SYMLINK ((lib9p_qt_t)(1<<1)) #endif /* CONFIG_9P_ENABLE_9P2000_u */ -/* unused ((lib9p_qt_t)(1<<0)) */ +/* unused ((lib9p_qt_t)(1<<0)) */ -#define LIB9P_QT_FILE ((lib9p_qt_t)(0)) +#define LIB9P_QT_FILE ((lib9p_qt_t)(0)) #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 @@ -244,24 +244,140 @@ typedef uint32_t lib9p_nuid_t; /* size = 1 ; max_iov = 1 ; max_copy = 1 */ typedef uint8_t lib9p_o_t; -/* unused ((lib9p_o_t)(1<<7)) */ -#define LIB9P_O_RCLOSE ((lib9p_o_t)(1<<6)) -/* unused ((lib9p_o_t)(1<<5)) */ -#define LIB9P_O_TRUNC ((lib9p_o_t)(1<<4)) -/* unused ((lib9p_o_t)(1<<3)) */ -/* unused ((lib9p_o_t)(1<<2)) */ -#define LIB9P_O_mode_1 ((lib9p_o_t)(1<<1)) -#define LIB9P_O_mode_0 ((lib9p_o_t)(1<<0)) - -#define LIB9P_O_READ ((lib9p_o_t)(0)) -#define LIB9P_O_WRITE ((lib9p_o_t)(1)) -#define LIB9P_O_RDWR ((lib9p_o_t)(2)) -#define LIB9P_O_EXEC ((lib9p_o_t)(3)) -#define LIB9P_O_MODE_MASK ((lib9p_o_t)(0b00000011)) -#define LIB9P_O_FLAG_MASK ((lib9p_o_t)(0b11111100)) +/* unused ((lib9p_o_t)(1<<7)) */ +#define LIB9P_O_RCLOSE ((lib9p_o_t)(1<<6)) +#define _LIB9P_O_RESERVED_CEXEC ((lib9p_o_t)(1<<5)) +#define LIB9P_O_TRUNC ((lib9p_o_t)(1<<4)) +/* unused ((lib9p_o_t)(1<<3)) */ +/* unused ((lib9p_o_t)(1<<2)) */ +#define _LIB9P_O_mode_1 ((lib9p_o_t)(1<<1)) +#define _LIB9P_O_mode_0 ((lib9p_o_t)(1<<0)) + +#define LIB9P_O_READ ((lib9p_o_t)(0)) +#define LIB9P_O_WRITE ((lib9p_o_t)(1)) +#define LIB9P_O_RDWR ((lib9p_o_t)(2)) +#define LIB9P_O_EXEC ((lib9p_o_t)(3)) +#define LIB9P_O_MODE_MASK ((lib9p_o_t)(0b00000011)) +#define LIB9P_O_FLAG_MASK ((lib9p_o_t)(0b11111100)) #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 || CONFIG_9P_ENABLE_9P2000_u +/* size = 4 ; max_iov = 1 ; max_copy = 4 */ +typedef uint32_t lib9p_errno_t; +#define LIB9P_ERRNO_NOERROR ((lib9p_errno_t)UINT32_C(0)) + +#endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L +/* size = 4 ; max_iov = 1 ; max_copy = 4 */ +typedef uint32_t lib9p_super_magic_t; +#define LIB9P_SUPER_MAGIC_V9FS_MAGIC ((lib9p_super_magic_t)UINT32_C(0x01021997)) + +/* size = 4 ; max_iov = 1 ; max_copy = 4 */ +typedef uint32_t lib9p_lo_t; + +/* unused ((lib9p_lo_t)(1<<31)) */ +/* unused ((lib9p_lo_t)(1<<30)) */ +/* unused ((lib9p_lo_t)(1<<29)) */ +/* unused ((lib9p_lo_t)(1<<28)) */ +/* unused ((lib9p_lo_t)(1<<27)) */ +/* unused ((lib9p_lo_t)(1<<26)) */ +/* unused ((lib9p_lo_t)(1<<25)) */ +/* unused ((lib9p_lo_t)(1<<24)) */ +/* unused ((lib9p_lo_t)(1<<23)) */ +/* unused ((lib9p_lo_t)(1<<22)) */ +/* unused ((lib9p_lo_t)(1<<21)) */ +#define LIB9P_LO_SYNC ((lib9p_lo_t)(1<<20)) +#define LIB9P_LO_CLOEXEC ((lib9p_lo_t)(1<<19)) +#define LIB9P_LO_NOATIME ((lib9p_lo_t)(1<<18)) +#define LIB9P_LO_NOFOLLOW ((lib9p_lo_t)(1<<17)) +#define LIB9P_LO_DIRECTORY ((lib9p_lo_t)(1<<16)) +#define LIB9P_LO_LARGEFILE ((lib9p_lo_t)(1<<15)) +#define LIB9P_LO_DIRECT ((lib9p_lo_t)(1<<14)) +#define LIB9P_LO_BSD_FASYNC ((lib9p_lo_t)(1<<13)) +#define LIB9P_LO_DSYNC ((lib9p_lo_t)(1<<12)) +#define LIB9P_LO_NONBLOCK ((lib9p_lo_t)(1<<11)) +#define LIB9P_LO_APPEND ((lib9p_lo_t)(1<<10)) +#define LIB9P_LO_TRUNC ((lib9p_lo_t)(1<<9)) +#define LIB9P_LO_NOCTTY ((lib9p_lo_t)(1<<8)) +#define LIB9P_LO_EXCL ((lib9p_lo_t)(1<<7)) +#define LIB9P_LO_CREATE ((lib9p_lo_t)(1<<6)) +/* unused ((lib9p_lo_t)(1<<5)) */ +/* unused ((lib9p_lo_t)(1<<4)) */ +/* unused ((lib9p_lo_t)(1<<3)) */ +/* unused ((lib9p_lo_t)(1<<2)) */ +#define _LIB9P_LO_mode_1 ((lib9p_lo_t)(1<<1)) +#define _LIB9P_LO_mode_0 ((lib9p_lo_t)(1<<0)) + +#define LIB9P_LO_RDONLY ((lib9p_lo_t)(0)) +#define LIB9P_LO_WRONLY ((lib9p_lo_t)(1)) +#define LIB9P_LO_RDWR ((lib9p_lo_t)(2)) +#define LIB9P_LO_NOACCESS ((lib9p_lo_t)(3)) +#define LIB9P_LO_MODE_MASK ((lib9p_lo_t)(0b000000000000000000011)) +#define LIB9P_LO_FLAG_MASK ((lib9p_lo_t)(0b111111111111111000000)) + +/* size = 1 ; max_iov = 1 ; max_copy = 1 */ +typedef uint8_t lib9p_dt_t; +#define LIB9P_DT_UNKNOWN ((lib9p_dt_t)UINT8_C(0)) +#define LIB9P_DT_NAMED_PIPE ((lib9p_dt_t)UINT8_C(1)) +#define LIB9P_DT_CHAR_DEV ((lib9p_dt_t)UINT8_C(2)) +#define LIB9P_DT_DIRECTORY ((lib9p_dt_t)UINT8_C(4)) +#define LIB9P_DT_BLOCK_DEV ((lib9p_dt_t)UINT8_C(6)) +#define LIB9P_DT_REGULAR ((lib9p_dt_t)UINT8_C(8)) +#define LIB9P_DT_SYMLINK ((lib9p_dt_t)UINT8_C(10)) +#define LIB9P_DT_SOCKET ((lib9p_dt_t)UINT8_C(12)) +#define LIB9P_DT_WHITEOUT ((lib9p_dt_t)UINT8_C(14)) + +/* size = 4 ; max_iov = 1 ; max_copy = 4 */ +typedef uint32_t lib9p_mode_t; + +/* unused ((lib9p_mode_t)(1<<31)) */ +/* unused ((lib9p_mode_t)(1<<30)) */ +/* unused ((lib9p_mode_t)(1<<29)) */ +/* unused ((lib9p_mode_t)(1<<28)) */ +/* unused ((lib9p_mode_t)(1<<27)) */ +/* unused ((lib9p_mode_t)(1<<26)) */ +/* unused ((lib9p_mode_t)(1<<25)) */ +/* unused ((lib9p_mode_t)(1<<24)) */ +/* unused ((lib9p_mode_t)(1<<23)) */ +/* unused ((lib9p_mode_t)(1<<22)) */ +/* unused ((lib9p_mode_t)(1<<21)) */ +/* unused ((lib9p_mode_t)(1<<20)) */ +/* unused ((lib9p_mode_t)(1<<19)) */ +/* unused ((lib9p_mode_t)(1<<18)) */ +/* unused ((lib9p_mode_t)(1<<17)) */ +/* unused ((lib9p_mode_t)(1<<16)) */ +#define _LIB9P_MODE_fmt_3 ((lib9p_mode_t)(1<<15)) +#define _LIB9P_MODE_fmt_2 ((lib9p_mode_t)(1<<14)) +#define _LIB9P_MODE_fmt_1 ((lib9p_mode_t)(1<<13)) +#define _LIB9P_MODE_fmt_0 ((lib9p_mode_t)(1<<12)) +#define LIB9P_MODE_PERM_SETGROUP ((lib9p_mode_t)(1<<11)) +#define LIB9P_MODE_PERM_SETUSER ((lib9p_mode_t)(1<<10)) +#define LIB9P_MODE_PERM_STICKY ((lib9p_mode_t)(1<<9)) +#define LIB9P_MODE_PERM_OWNER_R ((lib9p_mode_t)(1<<8)) +#define LIB9P_MODE_PERM_OWNER_W ((lib9p_mode_t)(1<<7)) +#define LIB9P_MODE_PERM_OWNER_X ((lib9p_mode_t)(1<<6)) +#define LIB9P_MODE_PERM_GROUP_R ((lib9p_mode_t)(1<<5)) +#define LIB9P_MODE_PERM_GROUP_W ((lib9p_mode_t)(1<<4)) +#define LIB9P_MODE_PERM_GROUP_X ((lib9p_mode_t)(1<<3)) +#define LIB9P_MODE_PERM_OTHER_R ((lib9p_mode_t)(1<<2)) +#define LIB9P_MODE_PERM_OTHER_W ((lib9p_mode_t)(1<<1)) +#define LIB9P_MODE_PERM_OTHER_X ((lib9p_mode_t)(1<<0)) + +#define LIB9P_MODE_FMT_NAMED_PIPE ((lib9p_mode_t)(LIB9P_DT_NAMED_PIPE<<12)) +#define LIB9P_MODE_FMT_CHAR_DEV ((lib9p_mode_t)(LIB9P_DT_CHAR_DEV<<12)) +#define LIB9P_MODE_FMT_DIRECTORY ((lib9p_mode_t)(LIB9P_DT_DIRECTORY<<12)) +#define LIB9P_MODE_FMT_BLOCK_DEV ((lib9p_mode_t)(LIB9P_DT_BLOCK_DEV<<12)) +#define LIB9P_MODE_FMT_REGULAR ((lib9p_mode_t)(LIB9P_DT_REGULAR<<12)) +#define LIB9P_MODE_FMT_SYMLINK ((lib9p_mode_t)(LIB9P_DT_SYMLINK<<12)) +#define LIB9P_MODE_FMT_SOCKET ((lib9p_mode_t)(LIB9P_DT_SOCKET<<12)) +#define LIB9P_MODE_PERM_MASK ((lib9p_mode_t)(0000777)) +#define LIB9P_MODE_FMT_MASK ((lib9p_mode_t)(0170000)) + +/* size = 4 ; max_iov = 1 ; max_copy = 4 */ +typedef uint32_t lib9p_b4_t; +#define LIB9P_B4_FALSE ((lib9p_b4_t)UINT32_C(0)) +#define LIB9P_B4_TRUE ((lib9p_b4_t)UINT32_C(1)) + /* size = 8 ; max_iov = 1 ; max_copy = 8 */ typedef uint64_t lib9p_getattr_t; @@ -463,26 +579,6 @@ struct lib9p_msg_Rwstat { #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 ; max_iov = 1 ; max_copy = 11 */ -struct lib9p_msg_Rlerror { - lib9p_tag_t tag; - uint32_t ecode; -}; - -/* size = 67 ; max_iov = 1 ; max_copy = 67 */ -struct lib9p_msg_Rstatfs { - lib9p_tag_t tag; - uint32_t type; - uint32_t bsize; - uint64_t blocks; - uint64_t bfree; - uint64_t bavail; - uint64_t files; - uint64_t ffree; - uint64_t fsid; - uint32_t namelen; -}; - /* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rrename { lib9p_tag_t tag; @@ -604,13 +700,6 @@ struct lib9p_msg_Tstatfs { lib9p_fid_t fid; }; -/* 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 ; max_iov = 1 ; max_copy = 11 */ struct lib9p_msg_Treadlink { lib9p_tag_t tag; @@ -625,13 +714,6 @@ struct lib9p_msg_Treaddir { uint32_t count; }; -/* size = 15 ; max_iov = 1 ; max_copy = 15 */ -struct lib9p_msg_Tfsync { - lib9p_tag_t tag; - lib9p_fid_t fid; - uint32_t datasync; -}; - #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 ; exp_size = 40 ; max_size = 65,548 ; max_iov = 2 ; max_copy = 13 */ @@ -648,19 +730,6 @@ struct lib9p_msg_Rversion { struct lib9p_s version; }; -/* 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; -#if CONFIG_9P_ENABLE_9P2000_u - uint32_t errno; -#endif /* CONFIG_9P_ENABLE_9P2000_u */ -}; - /* 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; @@ -703,27 +772,6 @@ struct lib9p_msg_Txattrcreate { uint32_t flags; }; -/* 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; - uint8_t type; - uint64_t start; - uint64_t length; - uint32_t proc_id; - struct lib9p_s client_id; -}; - -/* 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; - uint64_t start; - uint64_t length; - uint32_t proc_id; - struct lib9p_s client_id; -}; - /* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 2 ; max_copy = 17 */ struct lib9p_msg_Tlink { lib9p_tag_t tag; @@ -811,16 +859,6 @@ 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 ; 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; - struct lib9p_s name; - uint32_t flags; - uint32_t mode; - lib9p_nuid_t gid; -}; - /* min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 5 ; max_copy = 19 */ struct lib9p_msg_Tsymlink { lib9p_tag_t tag; @@ -830,26 +868,6 @@ struct lib9p_msg_Tsymlink { lib9p_nuid_t gid; }; -/* 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; - struct lib9p_s name; - uint32_t mode; - uint32_t major; - uint32_t minor; - lib9p_nuid_t gid; -}; - -/* 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; - struct lib9p_s name; - uint32_t mode; - lib9p_nuid_t gid; -}; - #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 ; max_iov = 1 ; max_copy = 12 */ @@ -878,7 +896,86 @@ struct lib9p_msg_Topenfd { }; #endif /* CONFIG_9P_ENABLE_9P2000_p9p */ +#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 +/* 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; +#if CONFIG_9P_ENABLE_9P2000_u + lib9p_errno_t errno; +#endif /* CONFIG_9P_ENABLE_9P2000_u */ +}; + +#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 +/* size = 11 ; max_iov = 1 ; max_copy = 11 */ +struct lib9p_msg_Rlerror { + lib9p_tag_t tag; + lib9p_errno_t ecode; +}; + +/* size = 67 ; max_iov = 1 ; max_copy = 67 */ +struct lib9p_msg_Rstatfs { + lib9p_tag_t tag; + lib9p_super_magic_t type; + uint32_t bsize; + uint64_t blocks; + uint64_t bfree; + uint64_t bavail; + uint64_t files; + uint64_t ffree; + uint64_t fsid; + uint32_t namelen; +}; + +/* size = 15 ; max_iov = 1 ; max_copy = 15 */ +struct lib9p_msg_Tlopen { + lib9p_tag_t tag; + lib9p_fid_t fid; + lib9p_lo_t flags; +}; + +/* 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; + struct lib9p_s name; + lib9p_lo_t flags; + lib9p_mode_t mode; + lib9p_nuid_t gid; +}; + +/* 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; + struct lib9p_s name; + lib9p_mode_t mode; + uint32_t major; + uint32_t minor; + lib9p_nuid_t gid; +}; + +/* 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; + struct lib9p_s name; + lib9p_mode_t mode; + lib9p_nuid_t gid; +}; + +/* size = 15 ; max_iov = 1 ; max_copy = 15 */ +struct lib9p_msg_Tfsync { + lib9p_tag_t tag; + lib9p_fid_t fid; + lib9p_b4_t datasync; +}; + /* size = 19 ; max_iov = 1 ; max_copy = 19 */ struct lib9p_msg_Tgetattr { lib9p_tag_t tag; @@ -891,7 +988,7 @@ struct lib9p_msg_Tsetattr { lib9p_tag_t tag; lib9p_fid_t fid; lib9p_setattr_t valid; - uint32_t mode; + lib9p_mode_t mode; lib9p_nuid_t uid; lib9p_nuid_t gid; uint64_t filesize; @@ -901,6 +998,27 @@ struct lib9p_msg_Tsetattr { uint64_t mtime_nsec; }; +/* 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; + lib9p_lock_type_t type; + uint64_t start; + uint64_t length; + uint32_t proc_id; + struct lib9p_s client_id; +}; + +/* min_size = 30 ; exp_size = 57 ; max_size = 65,565 ; max_iov = 2 ; max_copy = 30 */ +struct lib9p_msg_Rgetlock { + lib9p_tag_t tag; + lib9p_lock_type_t type; + uint64_t start; + uint64_t length; + uint32_t proc_id; + struct lib9p_s client_id; +}; + /* min_size = 38 ; exp_size = 65 ; max_size = 65,573 ; max_iov = 2 ; max_copy = 38 */ struct lib9p_msg_Tlock { lib9p_tag_t tag; @@ -1023,9 +1141,9 @@ struct lib9p_msg_Rmknod { /* size = 160 ; max_iov = 1 ; max_copy = 160 */ struct lib9p_msg_Rgetattr { lib9p_tag_t tag; - uint64_t valid; + lib9p_getattr_t valid; struct lib9p_qid qid; - uint32_t mode; + lib9p_mode_t mode; lib9p_nuid_t uid; lib9p_nuid_t gid; uint64_t nlink; diff --git a/lib9p/include/lib9p/9p.h b/lib9p/include/lib9p/9p.h index 44b5410..35b7ef2 100644 --- a/lib9p/include/lib9p/9p.h +++ b/lib9p/include/lib9p/9p.h @@ -46,7 +46,7 @@ struct lib9p_ctx { /* state */ #ifdef CONFIG_9P_ENABLE_9P2000_u - uint32_t err_num; + lib9p_errno_t err_num; #endif [[gnu::nonstring]] char err_msg[CONFIG_9P_MAX_ERR_SIZE]; }; @@ -56,9 +56,9 @@ void lib9p_ctx_clear_error(struct lib9p_ctx *ctx); bool lib9p_ctx_has_error(struct lib9p_ctx *ctx); /** Write an static error into ctx, return -1. */ -int lib9p_error(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *msg); +int lib9p_error(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *msg); /** Write a printf-style error into ctx, return -1. */ -int lib9p_errorf(struct lib9p_ctx *ctx, uint32_t linux_errno, char const *fmt, ...) [[gnu::format(printf, 3, 4)]]; +int lib9p_errorf(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *fmt, ...) [[gnu::format(printf, 3, 4)]]; /* main T-message functions ***************************************************/ @@ -139,12 +139,11 @@ bool lib9p_Rmsg_marshal(struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *bo /** Assert that a `struct lib9p_stat` object looks valid. */ static inline void lib9p_stat_assert(struct lib9p_stat stat) { - assert( ((bool)(stat.file_mode & LIB9P_DM_DIR )) == ((bool)(stat.file_qid.type & LIB9P_QT_DIR )) ); - assert( ((bool)(stat.file_mode & LIB9P_DM_APPEND )) == ((bool)(stat.file_qid.type & LIB9P_QT_APPEND )) ); - assert( ((bool)(stat.file_mode & LIB9P_DM_EXCL )) == ((bool)(stat.file_qid.type & LIB9P_QT_EXCL )) ); - assert( ((bool)(stat.file_mode & _LIB9P_DM_PLAN9_MOUNT)) == ((bool)(stat.file_qid.type & _LIB9P_QT_PLAN9_MOUNT)) ); - assert( ((bool)(stat.file_mode & LIB9P_DM_AUTH )) == ((bool)(stat.file_qid.type & LIB9P_QT_AUTH )) ); - assert( ((bool)(stat.file_mode & LIB9P_DM_TMP )) == ((bool)(stat.file_qid.type & LIB9P_QT_TMP )) ); + assert( ((bool)(stat.file_mode & LIB9P_DM_DIR )) == ((bool)(stat.file_qid.type & LIB9P_QT_DIR )) ); + assert( ((bool)(stat.file_mode & LIB9P_DM_APPEND)) == ((bool)(stat.file_qid.type & LIB9P_QT_APPEND)) ); + assert( ((bool)(stat.file_mode & LIB9P_DM_EXCL )) == ((bool)(stat.file_qid.type & LIB9P_QT_EXCL )) ); + assert( ((bool)(stat.file_mode & LIB9P_DM_AUTH )) == ((bool)(stat.file_qid.type & LIB9P_QT_AUTH )) ); + assert( ((bool)(stat.file_mode & LIB9P_DM_TMP )) == ((bool)(stat.file_qid.type & LIB9P_QT_TMP )) ); assert( (stat.file_size == 0) || !(stat.file_mode & LIB9P_DM_DIR) ); } |