summaryrefslogtreecommitdiff
path: root/lib9p/include
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/include')
-rw-r--r--lib9p/include/lib9p/9p.generated.h704
-rw-r--r--lib9p/include/lib9p/9p.h17
-rw-r--r--lib9p/include/lib9p/srv.h157
3 files changed, 522 insertions, 356 deletions
diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h
index 725e781..7e901a3 100644
--- a/lib9p/include/lib9p/9p.generated.h
+++ b/lib9p/include/lib9p/9p.generated.h
@@ -1,4 +1,4 @@
-/* Generated by `lib9p/idl.gen lib9p/idl/2002-9P2000.9p lib9p/idl/2003-9P2000.p9p.9p lib9p/idl/2005-9P2000.u.9p lib9p/idl/2010-9P2000.L.9p lib9p/idl/2012-9P2000.e.9p`. DO NOT EDIT! */
+/* Generated by `lib9p/proto.gen lib9p/idl/2002-9P2000.9p lib9p/idl/2003-9P2000.p9p.9p lib9p/idl/2005-9P2000.u.9p lib9p/idl/2010-9P2000.L.9p lib9p/idl/2012-9P2000.e.9p`. DO NOT EDIT! */
#ifndef _LIB9P_9P_H_
#error Do not include <lib9p/9p.generated.h> directly; include <lib9p/9p.h> instead
@@ -6,6 +6,7 @@
#include <stdint.h> /* for uint{n}_t types */
+#include <libfmt/fmt.h> /* for fmt_formatter */
#include <libhw/generic/net.h> /* for struct iovec */
/* config *********************************************************************/
@@ -60,6 +61,7 @@ enum lib9p_version {
#endif /* CONFIG_9P_ENABLE_9P2000_u */
LIB9P_VER_NUM,
};
+LO_IMPLEMENTATION_H(fmt_formatter, enum lib9p_version, lib9p_version);
/* enum msg_type **************************************************************/
@@ -153,386 +155,408 @@ enum lib9p_msg_type { /* uint8_t */
LIB9P_TYP_Rswrite = 155,
#endif /* CONFIG_9P_ENABLE_9P2000_e */
};
+LO_IMPLEMENTATION_H(fmt_formatter, enum lib9p_msg_type, lib9p_msg_type);
/* 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 ; max_iov = 1 ; max_copy = 2 */
typedef uint16_t lib9p_tag_t;
-#define LIB9P_TAG_NOTAG ((lib9p_tag_t)UINT16_C(~0))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_tag_t, lib9p_tag);
+#define LIB9P_TAG_NOTAG ((lib9p_tag_t)(UINT16_MAX))
/* size = 4 ; max_iov = 1 ; max_copy = 4 */
typedef uint32_t lib9p_fid_t;
-#define LIB9P_FID_NOFID ((lib9p_fid_t)UINT32_C(~0))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_fid_t, lib9p_fid);
+#define LIB9P_FID_NOFID ((lib9p_fid_t)(UINT32_MAX))
/* 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;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_s, 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 ; 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_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)) */
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_dm_t, lib9p_dm);
+/* bits */
+#define LIB9P_DM_DIR ((lib9p_dm_t)(UINT32_C(1)<<31))
+#define LIB9P_DM_APPEND ((lib9p_dm_t)(UINT32_C(1)<<30))
+#define LIB9P_DM_EXCL ((lib9p_dm_t)(UINT32_C(1)<<29))
+#define _LIB9P_DM_PLAN9_MOUNT ((lib9p_dm_t)(UINT32_C(1)<<28))
+#define LIB9P_DM_AUTH ((lib9p_dm_t)(UINT32_C(1)<<27))
+#define LIB9P_DM_TMP ((lib9p_dm_t)(UINT32_C(1)<<26))
+#define _LIB9P_DM_UNUSED_25 ((lib9p_dm_t)(UINT32_C(1)<<25))
+#define _LIB9P_DM_UNUSED_24 ((lib9p_dm_t)(UINT32_C(1)<<24))
#if CONFIG_9P_ENABLE_9P2000_u
-# define LIB9P_DM_DEVICE ((lib9p_dm_t)(1<<23))
+# define LIB9P_DM_DEVICE ((lib9p_dm_t)(UINT32_C(1)<<23))
#endif /* CONFIG_9P_ENABLE_9P2000_u */
-/* unused ((lib9p_dm_t)(1<<22)) */
+#define _LIB9P_DM_UNUSED_22 ((lib9p_dm_t)(UINT32_C(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_PIPE ((lib9p_dm_t)(UINT32_C(1)<<21))
+# define LIB9P_DM_SOCKET ((lib9p_dm_t)(UINT32_C(1)<<20))
+# define LIB9P_DM_SETUID ((lib9p_dm_t)(UINT32_C(1)<<19))
+# define LIB9P_DM_SETGID ((lib9p_dm_t)(UINT32_C(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))
+#define _LIB9P_DM_UNUSED_17 ((lib9p_dm_t)(UINT32_C(1)<<17))
+#define _LIB9P_DM_UNUSED_16 ((lib9p_dm_t)(UINT32_C(1)<<16))
+#define _LIB9P_DM_UNUSED_15 ((lib9p_dm_t)(UINT32_C(1)<<15))
+#define _LIB9P_DM_UNUSED_14 ((lib9p_dm_t)(UINT32_C(1)<<14))
+#define _LIB9P_DM_UNUSED_13 ((lib9p_dm_t)(UINT32_C(1)<<13))
+#define _LIB9P_DM_UNUSED_12 ((lib9p_dm_t)(UINT32_C(1)<<12))
+#define _LIB9P_DM_UNUSED_11 ((lib9p_dm_t)(UINT32_C(1)<<11))
+#define _LIB9P_DM_UNUSED_10 ((lib9p_dm_t)(UINT32_C(1)<<10))
+#define _LIB9P_DM_UNUSED_9 ((lib9p_dm_t)(UINT32_C(1)<<9))
+#define LIB9P_DM_OWNER_R ((lib9p_dm_t)(UINT32_C(1)<<8))
+#define LIB9P_DM_OWNER_W ((lib9p_dm_t)(UINT32_C(1)<<7))
+#define LIB9P_DM_OWNER_X ((lib9p_dm_t)(UINT32_C(1)<<6))
+#define LIB9P_DM_GROUP_R ((lib9p_dm_t)(UINT32_C(1)<<5))
+#define LIB9P_DM_GROUP_W ((lib9p_dm_t)(UINT32_C(1)<<4))
+#define LIB9P_DM_GROUP_X ((lib9p_dm_t)(UINT32_C(1)<<3))
+#define LIB9P_DM_OTHER_R ((lib9p_dm_t)(UINT32_C(1)<<2))
+#define LIB9P_DM_OTHER_W ((lib9p_dm_t)(UINT32_C(1)<<1))
+#define LIB9P_DM_OTHER_X ((lib9p_dm_t)(UINT32_C(1)<<0))
+/* masks */
+#define LIB9P_DM_PERM_MASK ((lib9p_dm_t)(0b000000000000000000000111111111))
#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_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))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_qt_t, lib9p_qt);
+/* bits */
+#define LIB9P_QT_DIR ((lib9p_qt_t)(UINT8_C(1)<<7))
+#define LIB9P_QT_APPEND ((lib9p_qt_t)(UINT8_C(1)<<6))
+#define LIB9P_QT_EXCL ((lib9p_qt_t)(UINT8_C(1)<<5))
+#define _LIB9P_QT_PLAN9_MOUNT ((lib9p_qt_t)(UINT8_C(1)<<4))
+#define LIB9P_QT_AUTH ((lib9p_qt_t)(UINT8_C(1)<<3))
+#define LIB9P_QT_TMP ((lib9p_qt_t)(UINT8_C(1)<<2))
#if CONFIG_9P_ENABLE_9P2000_u
-# define LIB9P_QT_SYMLINK ((lib9p_qt_t)(1<<1))
+# define LIB9P_QT_SYMLINK ((lib9p_qt_t)(UINT8_C(1)<<1))
#endif /* CONFIG_9P_ENABLE_9P2000_u */
-/* unused ((lib9p_qt_t)(1<<0)) */
-
-#define LIB9P_QT_FILE ((lib9p_qt_t)(0))
+#define _LIB9P_QT_UNUSED_0 ((lib9p_qt_t)(UINT8_C(1)<<0))
+/* aliases */
+#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
/* size = 4 ; max_iov = 1 ; max_copy = 4 */
typedef uint32_t lib9p_nuid_t;
-#define LIB9P_NUID_NONUID ((lib9p_nuid_t)UINT32_C(~0))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_nuid_t, lib9p_nuid);
+#define LIB9P_NUID_NONUID ((lib9p_nuid_t)(UINT32_MAX))
#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 ; 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))
-#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))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_o_t, lib9p_o);
+/* bits */
+#define _LIB9P_O_UNUSED_7 ((lib9p_o_t)(UINT8_C(1)<<7))
+#define LIB9P_O_RCLOSE ((lib9p_o_t)(UINT8_C(1)<<6))
+#define _LIB9P_O_RESERVED_CEXEC ((lib9p_o_t)(UINT8_C(1)<<5))
+#define LIB9P_O_TRUNC ((lib9p_o_t)(UINT8_C(1)<<4))
+#define _LIB9P_O_UNUSED_3 ((lib9p_o_t)(UINT8_C(1)<<3))
+#define _LIB9P_O_UNUSED_2 ((lib9p_o_t)(UINT8_C(1)<<2))
+/* number LIB9P_O_MODE_* ((lib9p_o_t)(UINT8_C(1)<<1)) */
+/* number LIB9P_O_MODE_* ((lib9p_o_t)(UINT8_C(1)<<0)) */
+/* masks */
#define LIB9P_O_FLAG_MASK ((lib9p_o_t)(0b11111100))
+/* number: MODE */
+#define LIB9P_O_MODE_READ ((lib9p_o_t)(0))
+#define LIB9P_O_MODE_WRITE ((lib9p_o_t)(1))
+#define LIB9P_O_MODE_RDWR ((lib9p_o_t)(2))
+#define LIB9P_O_MODE_EXEC ((lib9p_o_t)(3))
+#define LIB9P_O_MODE_MASK ((lib9p_o_t)(0b000011))
#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))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_errno_t, lib9p_errno);
+#define LIB9P_ERRNO_NOERROR ((lib9p_errno_t)(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))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_super_magic_t, lib9p_super_magic);
+#define LIB9P_SUPER_MAGIC_V9FS_MAGIC ((lib9p_super_magic_t)(16914839))
/* 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))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_lo_t, lib9p_lo);
+/* bits */
+#define _LIB9P_LO_UNUSED_31 ((lib9p_lo_t)(UINT32_C(1)<<31))
+#define _LIB9P_LO_UNUSED_30 ((lib9p_lo_t)(UINT32_C(1)<<30))
+#define _LIB9P_LO_UNUSED_29 ((lib9p_lo_t)(UINT32_C(1)<<29))
+#define _LIB9P_LO_UNUSED_28 ((lib9p_lo_t)(UINT32_C(1)<<28))
+#define _LIB9P_LO_UNUSED_27 ((lib9p_lo_t)(UINT32_C(1)<<27))
+#define _LIB9P_LO_UNUSED_26 ((lib9p_lo_t)(UINT32_C(1)<<26))
+#define _LIB9P_LO_UNUSED_25 ((lib9p_lo_t)(UINT32_C(1)<<25))
+#define _LIB9P_LO_UNUSED_24 ((lib9p_lo_t)(UINT32_C(1)<<24))
+#define _LIB9P_LO_UNUSED_23 ((lib9p_lo_t)(UINT32_C(1)<<23))
+#define _LIB9P_LO_UNUSED_22 ((lib9p_lo_t)(UINT32_C(1)<<22))
+#define _LIB9P_LO_UNUSED_21 ((lib9p_lo_t)(UINT32_C(1)<<21))
+#define LIB9P_LO_SYNC ((lib9p_lo_t)(UINT32_C(1)<<20))
+#define LIB9P_LO_CLOEXEC ((lib9p_lo_t)(UINT32_C(1)<<19))
+#define LIB9P_LO_NOATIME ((lib9p_lo_t)(UINT32_C(1)<<18))
+#define LIB9P_LO_NOFOLLOW ((lib9p_lo_t)(UINT32_C(1)<<17))
+#define LIB9P_LO_DIRECTORY ((lib9p_lo_t)(UINT32_C(1)<<16))
+#define LIB9P_LO_LARGEFILE ((lib9p_lo_t)(UINT32_C(1)<<15))
+#define LIB9P_LO_DIRECT ((lib9p_lo_t)(UINT32_C(1)<<14))
+#define LIB9P_LO_BSD_FASYNC ((lib9p_lo_t)(UINT32_C(1)<<13))
+#define LIB9P_LO_DSYNC ((lib9p_lo_t)(UINT32_C(1)<<12))
+#define LIB9P_LO_NONBLOCK ((lib9p_lo_t)(UINT32_C(1)<<11))
+#define LIB9P_LO_APPEND ((lib9p_lo_t)(UINT32_C(1)<<10))
+#define LIB9P_LO_TRUNC ((lib9p_lo_t)(UINT32_C(1)<<9))
+#define LIB9P_LO_NOCTTY ((lib9p_lo_t)(UINT32_C(1)<<8))
+#define LIB9P_LO_EXCL ((lib9p_lo_t)(UINT32_C(1)<<7))
+#define LIB9P_LO_CREATE ((lib9p_lo_t)(UINT32_C(1)<<6))
+#define _LIB9P_LO_UNUSED_5 ((lib9p_lo_t)(UINT32_C(1)<<5))
+#define _LIB9P_LO_UNUSED_4 ((lib9p_lo_t)(UINT32_C(1)<<4))
+#define _LIB9P_LO_UNUSED_3 ((lib9p_lo_t)(UINT32_C(1)<<3))
+#define _LIB9P_LO_UNUSED_2 ((lib9p_lo_t)(UINT32_C(1)<<2))
+/* number LIB9P_LO_MODE_* ((lib9p_lo_t)(UINT32_C(1)<<1)) */
+/* number LIB9P_LO_MODE_* ((lib9p_lo_t)(UINT32_C(1)<<0)) */
+/* masks */
+#define LIB9P_LO_FLAG_MASK ((lib9p_lo_t)(0b000000000111111111111111000000))
+/* number: MODE */
+#define LIB9P_LO_MODE_RDONLY ((lib9p_lo_t)(0))
+#define LIB9P_LO_MODE_WRONLY ((lib9p_lo_t)(1))
+#define LIB9P_LO_MODE_RDWR ((lib9p_lo_t)(2))
+#define LIB9P_LO_MODE_NOACCESS ((lib9p_lo_t)(3))
+#define LIB9P_LO_MODE_MASK ((lib9p_lo_t)(0b000000000000000000000000000011))
/* 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))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_dt_t, lib9p_dt);
+#define LIB9P_DT_UNKNOWN ((lib9p_dt_t)(0))
+#define LIB9P_DT_PIPE ((lib9p_dt_t)(1))
+#define LIB9P_DT_CHAR_DEV ((lib9p_dt_t)(2))
+#define LIB9P_DT_DIRECTORY ((lib9p_dt_t)(4))
+#define LIB9P_DT_BLOCK_DEV ((lib9p_dt_t)(6))
+#define LIB9P_DT_REGULAR ((lib9p_dt_t)(8))
+#define LIB9P_DT_SYMLINK ((lib9p_dt_t)(10))
+#define LIB9P_DT_SOCKET ((lib9p_dt_t)(12))
+#define _LIB9P_DT_WHITEOUT ((lib9p_dt_t)(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))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_mode_t, lib9p_mode);
+/* bits */
+#define _LIB9P_MODE_UNUSED_31 ((lib9p_mode_t)(UINT32_C(1)<<31))
+#define _LIB9P_MODE_UNUSED_30 ((lib9p_mode_t)(UINT32_C(1)<<30))
+#define _LIB9P_MODE_UNUSED_29 ((lib9p_mode_t)(UINT32_C(1)<<29))
+#define _LIB9P_MODE_UNUSED_28 ((lib9p_mode_t)(UINT32_C(1)<<28))
+#define _LIB9P_MODE_UNUSED_27 ((lib9p_mode_t)(UINT32_C(1)<<27))
+#define _LIB9P_MODE_UNUSED_26 ((lib9p_mode_t)(UINT32_C(1)<<26))
+#define _LIB9P_MODE_UNUSED_25 ((lib9p_mode_t)(UINT32_C(1)<<25))
+#define _LIB9P_MODE_UNUSED_24 ((lib9p_mode_t)(UINT32_C(1)<<24))
+#define _LIB9P_MODE_UNUSED_23 ((lib9p_mode_t)(UINT32_C(1)<<23))
+#define _LIB9P_MODE_UNUSED_22 ((lib9p_mode_t)(UINT32_C(1)<<22))
+#define _LIB9P_MODE_UNUSED_21 ((lib9p_mode_t)(UINT32_C(1)<<21))
+#define _LIB9P_MODE_UNUSED_20 ((lib9p_mode_t)(UINT32_C(1)<<20))
+#define _LIB9P_MODE_UNUSED_19 ((lib9p_mode_t)(UINT32_C(1)<<19))
+#define _LIB9P_MODE_UNUSED_18 ((lib9p_mode_t)(UINT32_C(1)<<18))
+#define _LIB9P_MODE_UNUSED_17 ((lib9p_mode_t)(UINT32_C(1)<<17))
+#define _LIB9P_MODE_UNUSED_16 ((lib9p_mode_t)(UINT32_C(1)<<16))
+/* number LIB9P_MODE_FMT_* ((lib9p_mode_t)(UINT32_C(1)<<15)) */
+/* number LIB9P_MODE_FMT_* ((lib9p_mode_t)(UINT32_C(1)<<14)) */
+/* number LIB9P_MODE_FMT_* ((lib9p_mode_t)(UINT32_C(1)<<13)) */
+/* number LIB9P_MODE_FMT_* ((lib9p_mode_t)(UINT32_C(1)<<12)) */
+#define LIB9P_MODE_PERM_SETGROUP ((lib9p_mode_t)(UINT32_C(1)<<11))
+#define LIB9P_MODE_PERM_SETUSER ((lib9p_mode_t)(UINT32_C(1)<<10))
+#define LIB9P_MODE_PERM_STICKY ((lib9p_mode_t)(UINT32_C(1)<<9))
+#define LIB9P_MODE_PERM_OWNER_R ((lib9p_mode_t)(UINT32_C(1)<<8))
+#define LIB9P_MODE_PERM_OWNER_W ((lib9p_mode_t)(UINT32_C(1)<<7))
+#define LIB9P_MODE_PERM_OWNER_X ((lib9p_mode_t)(UINT32_C(1)<<6))
+#define LIB9P_MODE_PERM_GROUP_R ((lib9p_mode_t)(UINT32_C(1)<<5))
+#define LIB9P_MODE_PERM_GROUP_W ((lib9p_mode_t)(UINT32_C(1)<<4))
+#define LIB9P_MODE_PERM_GROUP_X ((lib9p_mode_t)(UINT32_C(1)<<3))
+#define LIB9P_MODE_PERM_OTHER_R ((lib9p_mode_t)(UINT32_C(1)<<2))
+#define LIB9P_MODE_PERM_OTHER_W ((lib9p_mode_t)(UINT32_C(1)<<1))
+#define LIB9P_MODE_PERM_OTHER_X ((lib9p_mode_t)(UINT32_C(1)<<0))
+/* masks */
+#define LIB9P_MODE_PERM_MASK ((lib9p_mode_t)(0b000000000000000000111111111111))
+/* number: FMT */
+#define LIB9P_MODE_FMT_PIPE ((lib9p_mode_t)(LIB9P_DT_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_FMT_MASK ((lib9p_mode_t)(0b000000000000001111000000000000))
/* 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))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_b4_t, lib9p_b4);
+#define LIB9P_B4_FALSE ((lib9p_b4_t)(0))
+#define LIB9P_B4_TRUE ((lib9p_b4_t)(1))
/* size = 8 ; max_iov = 1 ; max_copy = 8 */
typedef uint64_t lib9p_getattr_t;
-
-/* unused ((lib9p_getattr_t)(1<<63)) */
-/* unused ((lib9p_getattr_t)(1<<62)) */
-/* unused ((lib9p_getattr_t)(1<<61)) */
-/* unused ((lib9p_getattr_t)(1<<60)) */
-/* unused ((lib9p_getattr_t)(1<<59)) */
-/* unused ((lib9p_getattr_t)(1<<58)) */
-/* unused ((lib9p_getattr_t)(1<<57)) */
-/* unused ((lib9p_getattr_t)(1<<56)) */
-/* unused ((lib9p_getattr_t)(1<<55)) */
-/* unused ((lib9p_getattr_t)(1<<54)) */
-/* unused ((lib9p_getattr_t)(1<<53)) */
-/* unused ((lib9p_getattr_t)(1<<52)) */
-/* unused ((lib9p_getattr_t)(1<<51)) */
-/* unused ((lib9p_getattr_t)(1<<50)) */
-/* unused ((lib9p_getattr_t)(1<<49)) */
-/* unused ((lib9p_getattr_t)(1<<48)) */
-/* unused ((lib9p_getattr_t)(1<<47)) */
-/* unused ((lib9p_getattr_t)(1<<46)) */
-/* unused ((lib9p_getattr_t)(1<<45)) */
-/* unused ((lib9p_getattr_t)(1<<44)) */
-/* unused ((lib9p_getattr_t)(1<<43)) */
-/* unused ((lib9p_getattr_t)(1<<42)) */
-/* unused ((lib9p_getattr_t)(1<<41)) */
-/* unused ((lib9p_getattr_t)(1<<40)) */
-/* unused ((lib9p_getattr_t)(1<<39)) */
-/* unused ((lib9p_getattr_t)(1<<38)) */
-/* unused ((lib9p_getattr_t)(1<<37)) */
-/* unused ((lib9p_getattr_t)(1<<36)) */
-/* unused ((lib9p_getattr_t)(1<<35)) */
-/* unused ((lib9p_getattr_t)(1<<34)) */
-/* unused ((lib9p_getattr_t)(1<<33)) */
-/* unused ((lib9p_getattr_t)(1<<32)) */
-/* unused ((lib9p_getattr_t)(1<<31)) */
-/* unused ((lib9p_getattr_t)(1<<30)) */
-/* unused ((lib9p_getattr_t)(1<<29)) */
-/* unused ((lib9p_getattr_t)(1<<28)) */
-/* unused ((lib9p_getattr_t)(1<<27)) */
-/* unused ((lib9p_getattr_t)(1<<26)) */
-/* unused ((lib9p_getattr_t)(1<<25)) */
-/* unused ((lib9p_getattr_t)(1<<24)) */
-/* unused ((lib9p_getattr_t)(1<<23)) */
-/* unused ((lib9p_getattr_t)(1<<22)) */
-/* unused ((lib9p_getattr_t)(1<<21)) */
-/* unused ((lib9p_getattr_t)(1<<20)) */
-/* unused ((lib9p_getattr_t)(1<<19)) */
-/* unused ((lib9p_getattr_t)(1<<18)) */
-/* unused ((lib9p_getattr_t)(1<<17)) */
-/* unused ((lib9p_getattr_t)(1<<16)) */
-/* unused ((lib9p_getattr_t)(1<<15)) */
-/* unused ((lib9p_getattr_t)(1<<14)) */
-#define LIB9P_GETATTR_DATA_VERSION ((lib9p_getattr_t)(1<<13))
-#define LIB9P_GETATTR_GEN ((lib9p_getattr_t)(1<<12))
-#define LIB9P_GETATTR_BTIME ((lib9p_getattr_t)(1<<11))
-#define LIB9P_GETATTR_BLOCKS ((lib9p_getattr_t)(1<<10))
-#define LIB9P_GETATTR_SIZE ((lib9p_getattr_t)(1<<9))
-#define LIB9P_GETATTR_INO ((lib9p_getattr_t)(1<<8))
-#define LIB9P_GETATTR_CTIME ((lib9p_getattr_t)(1<<7))
-#define LIB9P_GETATTR_MTIME ((lib9p_getattr_t)(1<<6))
-#define LIB9P_GETATTR_ATIME ((lib9p_getattr_t)(1<<5))
-#define LIB9P_GETATTR_RDEV ((lib9p_getattr_t)(1<<4))
-#define LIB9P_GETATTR_GID ((lib9p_getattr_t)(1<<3))
-#define LIB9P_GETATTR_UID ((lib9p_getattr_t)(1<<2))
-#define LIB9P_GETATTR_NLINK ((lib9p_getattr_t)(1<<1))
-#define LIB9P_GETATTR_MODE ((lib9p_getattr_t)(1<<0))
-
-#define LIB9P_GETATTR_BASIC ((lib9p_getattr_t)(0x000007ff))
-#define LIB9P_GETATTR_ALL ((lib9p_getattr_t)(0x00003fff))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_getattr_t, lib9p_getattr);
+/* bits */
+#define _LIB9P_GETATTR_UNUSED_63 ((lib9p_getattr_t)(UINT64_C(1)<<63))
+#define _LIB9P_GETATTR_UNUSED_62 ((lib9p_getattr_t)(UINT64_C(1)<<62))
+#define _LIB9P_GETATTR_UNUSED_61 ((lib9p_getattr_t)(UINT64_C(1)<<61))
+#define _LIB9P_GETATTR_UNUSED_60 ((lib9p_getattr_t)(UINT64_C(1)<<60))
+#define _LIB9P_GETATTR_UNUSED_59 ((lib9p_getattr_t)(UINT64_C(1)<<59))
+#define _LIB9P_GETATTR_UNUSED_58 ((lib9p_getattr_t)(UINT64_C(1)<<58))
+#define _LIB9P_GETATTR_UNUSED_57 ((lib9p_getattr_t)(UINT64_C(1)<<57))
+#define _LIB9P_GETATTR_UNUSED_56 ((lib9p_getattr_t)(UINT64_C(1)<<56))
+#define _LIB9P_GETATTR_UNUSED_55 ((lib9p_getattr_t)(UINT64_C(1)<<55))
+#define _LIB9P_GETATTR_UNUSED_54 ((lib9p_getattr_t)(UINT64_C(1)<<54))
+#define _LIB9P_GETATTR_UNUSED_53 ((lib9p_getattr_t)(UINT64_C(1)<<53))
+#define _LIB9P_GETATTR_UNUSED_52 ((lib9p_getattr_t)(UINT64_C(1)<<52))
+#define _LIB9P_GETATTR_UNUSED_51 ((lib9p_getattr_t)(UINT64_C(1)<<51))
+#define _LIB9P_GETATTR_UNUSED_50 ((lib9p_getattr_t)(UINT64_C(1)<<50))
+#define _LIB9P_GETATTR_UNUSED_49 ((lib9p_getattr_t)(UINT64_C(1)<<49))
+#define _LIB9P_GETATTR_UNUSED_48 ((lib9p_getattr_t)(UINT64_C(1)<<48))
+#define _LIB9P_GETATTR_UNUSED_47 ((lib9p_getattr_t)(UINT64_C(1)<<47))
+#define _LIB9P_GETATTR_UNUSED_46 ((lib9p_getattr_t)(UINT64_C(1)<<46))
+#define _LIB9P_GETATTR_UNUSED_45 ((lib9p_getattr_t)(UINT64_C(1)<<45))
+#define _LIB9P_GETATTR_UNUSED_44 ((lib9p_getattr_t)(UINT64_C(1)<<44))
+#define _LIB9P_GETATTR_UNUSED_43 ((lib9p_getattr_t)(UINT64_C(1)<<43))
+#define _LIB9P_GETATTR_UNUSED_42 ((lib9p_getattr_t)(UINT64_C(1)<<42))
+#define _LIB9P_GETATTR_UNUSED_41 ((lib9p_getattr_t)(UINT64_C(1)<<41))
+#define _LIB9P_GETATTR_UNUSED_40 ((lib9p_getattr_t)(UINT64_C(1)<<40))
+#define _LIB9P_GETATTR_UNUSED_39 ((lib9p_getattr_t)(UINT64_C(1)<<39))
+#define _LIB9P_GETATTR_UNUSED_38 ((lib9p_getattr_t)(UINT64_C(1)<<38))
+#define _LIB9P_GETATTR_UNUSED_37 ((lib9p_getattr_t)(UINT64_C(1)<<37))
+#define _LIB9P_GETATTR_UNUSED_36 ((lib9p_getattr_t)(UINT64_C(1)<<36))
+#define _LIB9P_GETATTR_UNUSED_35 ((lib9p_getattr_t)(UINT64_C(1)<<35))
+#define _LIB9P_GETATTR_UNUSED_34 ((lib9p_getattr_t)(UINT64_C(1)<<34))
+#define _LIB9P_GETATTR_UNUSED_33 ((lib9p_getattr_t)(UINT64_C(1)<<33))
+#define _LIB9P_GETATTR_UNUSED_32 ((lib9p_getattr_t)(UINT64_C(1)<<32))
+#define _LIB9P_GETATTR_UNUSED_31 ((lib9p_getattr_t)(UINT64_C(1)<<31))
+#define _LIB9P_GETATTR_UNUSED_30 ((lib9p_getattr_t)(UINT64_C(1)<<30))
+#define _LIB9P_GETATTR_UNUSED_29 ((lib9p_getattr_t)(UINT64_C(1)<<29))
+#define _LIB9P_GETATTR_UNUSED_28 ((lib9p_getattr_t)(UINT64_C(1)<<28))
+#define _LIB9P_GETATTR_UNUSED_27 ((lib9p_getattr_t)(UINT64_C(1)<<27))
+#define _LIB9P_GETATTR_UNUSED_26 ((lib9p_getattr_t)(UINT64_C(1)<<26))
+#define _LIB9P_GETATTR_UNUSED_25 ((lib9p_getattr_t)(UINT64_C(1)<<25))
+#define _LIB9P_GETATTR_UNUSED_24 ((lib9p_getattr_t)(UINT64_C(1)<<24))
+#define _LIB9P_GETATTR_UNUSED_23 ((lib9p_getattr_t)(UINT64_C(1)<<23))
+#define _LIB9P_GETATTR_UNUSED_22 ((lib9p_getattr_t)(UINT64_C(1)<<22))
+#define _LIB9P_GETATTR_UNUSED_21 ((lib9p_getattr_t)(UINT64_C(1)<<21))
+#define _LIB9P_GETATTR_UNUSED_20 ((lib9p_getattr_t)(UINT64_C(1)<<20))
+#define _LIB9P_GETATTR_UNUSED_19 ((lib9p_getattr_t)(UINT64_C(1)<<19))
+#define _LIB9P_GETATTR_UNUSED_18 ((lib9p_getattr_t)(UINT64_C(1)<<18))
+#define _LIB9P_GETATTR_UNUSED_17 ((lib9p_getattr_t)(UINT64_C(1)<<17))
+#define _LIB9P_GETATTR_UNUSED_16 ((lib9p_getattr_t)(UINT64_C(1)<<16))
+#define _LIB9P_GETATTR_UNUSED_15 ((lib9p_getattr_t)(UINT64_C(1)<<15))
+#define _LIB9P_GETATTR_UNUSED_14 ((lib9p_getattr_t)(UINT64_C(1)<<14))
+#define LIB9P_GETATTR_DATA_VERSION ((lib9p_getattr_t)(UINT64_C(1)<<13))
+#define LIB9P_GETATTR_GEN ((lib9p_getattr_t)(UINT64_C(1)<<12))
+#define LIB9P_GETATTR_BTIME ((lib9p_getattr_t)(UINT64_C(1)<<11))
+#define LIB9P_GETATTR_BLOCKS ((lib9p_getattr_t)(UINT64_C(1)<<10))
+#define LIB9P_GETATTR_SIZE ((lib9p_getattr_t)(UINT64_C(1)<<9))
+#define LIB9P_GETATTR_INO ((lib9p_getattr_t)(UINT64_C(1)<<8))
+#define LIB9P_GETATTR_CTIME ((lib9p_getattr_t)(UINT64_C(1)<<7))
+#define LIB9P_GETATTR_MTIME ((lib9p_getattr_t)(UINT64_C(1)<<6))
+#define LIB9P_GETATTR_ATIME ((lib9p_getattr_t)(UINT64_C(1)<<5))
+#define LIB9P_GETATTR_RDEV ((lib9p_getattr_t)(UINT64_C(1)<<4))
+#define LIB9P_GETATTR_GID ((lib9p_getattr_t)(UINT64_C(1)<<3))
+#define LIB9P_GETATTR_UID ((lib9p_getattr_t)(UINT64_C(1)<<2))
+#define LIB9P_GETATTR_NLINK ((lib9p_getattr_t)(UINT64_C(1)<<1))
+#define LIB9P_GETATTR_MODE ((lib9p_getattr_t)(UINT64_C(1)<<0))
+/* aliases */
+#define LIB9P_GETATTR_BASIC ((lib9p_getattr_t)(2047))
+#define LIB9P_GETATTR_ALL ((lib9p_getattr_t)(16383))
/* size = 4 ; max_iov = 1 ; max_copy = 4 */
typedef uint32_t lib9p_setattr_t;
-
-/* unused ((lib9p_setattr_t)(1<<31)) */
-/* unused ((lib9p_setattr_t)(1<<30)) */
-/* unused ((lib9p_setattr_t)(1<<29)) */
-/* unused ((lib9p_setattr_t)(1<<28)) */
-/* unused ((lib9p_setattr_t)(1<<27)) */
-/* unused ((lib9p_setattr_t)(1<<26)) */
-/* unused ((lib9p_setattr_t)(1<<25)) */
-/* unused ((lib9p_setattr_t)(1<<24)) */
-/* unused ((lib9p_setattr_t)(1<<23)) */
-/* unused ((lib9p_setattr_t)(1<<22)) */
-/* unused ((lib9p_setattr_t)(1<<21)) */
-/* unused ((lib9p_setattr_t)(1<<20)) */
-/* unused ((lib9p_setattr_t)(1<<19)) */
-/* unused ((lib9p_setattr_t)(1<<18)) */
-/* unused ((lib9p_setattr_t)(1<<17)) */
-/* unused ((lib9p_setattr_t)(1<<16)) */
-/* unused ((lib9p_setattr_t)(1<<15)) */
-/* unused ((lib9p_setattr_t)(1<<14)) */
-/* unused ((lib9p_setattr_t)(1<<13)) */
-/* unused ((lib9p_setattr_t)(1<<12)) */
-/* unused ((lib9p_setattr_t)(1<<11)) */
-/* unused ((lib9p_setattr_t)(1<<10)) */
-/* unused ((lib9p_setattr_t)(1<<9)) */
-#define LIB9P_SETATTR_MTIME_SET ((lib9p_setattr_t)(1<<8))
-#define LIB9P_SETATTR_ATIME_SET ((lib9p_setattr_t)(1<<7))
-#define LIB9P_SETATTR_CTIME ((lib9p_setattr_t)(1<<6))
-#define LIB9P_SETATTR_MTIME ((lib9p_setattr_t)(1<<5))
-#define LIB9P_SETATTR_ATIME ((lib9p_setattr_t)(1<<4))
-#define LIB9P_SETATTR_SIZE ((lib9p_setattr_t)(1<<3))
-#define LIB9P_SETATTR_GID ((lib9p_setattr_t)(1<<2))
-#define LIB9P_SETATTR_UID ((lib9p_setattr_t)(1<<1))
-#define LIB9P_SETATTR_MODE ((lib9p_setattr_t)(1<<0))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_setattr_t, lib9p_setattr);
+/* bits */
+#define _LIB9P_SETATTR_UNUSED_31 ((lib9p_setattr_t)(UINT32_C(1)<<31))
+#define _LIB9P_SETATTR_UNUSED_30 ((lib9p_setattr_t)(UINT32_C(1)<<30))
+#define _LIB9P_SETATTR_UNUSED_29 ((lib9p_setattr_t)(UINT32_C(1)<<29))
+#define _LIB9P_SETATTR_UNUSED_28 ((lib9p_setattr_t)(UINT32_C(1)<<28))
+#define _LIB9P_SETATTR_UNUSED_27 ((lib9p_setattr_t)(UINT32_C(1)<<27))
+#define _LIB9P_SETATTR_UNUSED_26 ((lib9p_setattr_t)(UINT32_C(1)<<26))
+#define _LIB9P_SETATTR_UNUSED_25 ((lib9p_setattr_t)(UINT32_C(1)<<25))
+#define _LIB9P_SETATTR_UNUSED_24 ((lib9p_setattr_t)(UINT32_C(1)<<24))
+#define _LIB9P_SETATTR_UNUSED_23 ((lib9p_setattr_t)(UINT32_C(1)<<23))
+#define _LIB9P_SETATTR_UNUSED_22 ((lib9p_setattr_t)(UINT32_C(1)<<22))
+#define _LIB9P_SETATTR_UNUSED_21 ((lib9p_setattr_t)(UINT32_C(1)<<21))
+#define _LIB9P_SETATTR_UNUSED_20 ((lib9p_setattr_t)(UINT32_C(1)<<20))
+#define _LIB9P_SETATTR_UNUSED_19 ((lib9p_setattr_t)(UINT32_C(1)<<19))
+#define _LIB9P_SETATTR_UNUSED_18 ((lib9p_setattr_t)(UINT32_C(1)<<18))
+#define _LIB9P_SETATTR_UNUSED_17 ((lib9p_setattr_t)(UINT32_C(1)<<17))
+#define _LIB9P_SETATTR_UNUSED_16 ((lib9p_setattr_t)(UINT32_C(1)<<16))
+#define _LIB9P_SETATTR_UNUSED_15 ((lib9p_setattr_t)(UINT32_C(1)<<15))
+#define _LIB9P_SETATTR_UNUSED_14 ((lib9p_setattr_t)(UINT32_C(1)<<14))
+#define _LIB9P_SETATTR_UNUSED_13 ((lib9p_setattr_t)(UINT32_C(1)<<13))
+#define _LIB9P_SETATTR_UNUSED_12 ((lib9p_setattr_t)(UINT32_C(1)<<12))
+#define _LIB9P_SETATTR_UNUSED_11 ((lib9p_setattr_t)(UINT32_C(1)<<11))
+#define _LIB9P_SETATTR_UNUSED_10 ((lib9p_setattr_t)(UINT32_C(1)<<10))
+#define _LIB9P_SETATTR_UNUSED_9 ((lib9p_setattr_t)(UINT32_C(1)<<9))
+#define LIB9P_SETATTR_MTIME_SET ((lib9p_setattr_t)(UINT32_C(1)<<8))
+#define LIB9P_SETATTR_ATIME_SET ((lib9p_setattr_t)(UINT32_C(1)<<7))
+#define LIB9P_SETATTR_CTIME ((lib9p_setattr_t)(UINT32_C(1)<<6))
+#define LIB9P_SETATTR_MTIME ((lib9p_setattr_t)(UINT32_C(1)<<5))
+#define LIB9P_SETATTR_ATIME ((lib9p_setattr_t)(UINT32_C(1)<<4))
+#define LIB9P_SETATTR_SIZE ((lib9p_setattr_t)(UINT32_C(1)<<3))
+#define LIB9P_SETATTR_GID ((lib9p_setattr_t)(UINT32_C(1)<<2))
+#define LIB9P_SETATTR_UID ((lib9p_setattr_t)(UINT32_C(1)<<1))
+#define LIB9P_SETATTR_MODE ((lib9p_setattr_t)(UINT32_C(1)<<0))
/* 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))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_lock_type_t, lib9p_lock_type);
+#define LIB9P_LOCK_TYPE_RDLCK ((lib9p_lock_type_t)(0))
+#define LIB9P_LOCK_TYPE_WRLCK ((lib9p_lock_type_t)(1))
+#define LIB9P_LOCK_TYPE_UNLCK ((lib9p_lock_type_t)(2))
/* size = 4 ; max_iov = 1 ; max_copy = 4 */
typedef uint32_t lib9p_lock_flags_t;
-
-/* unused ((lib9p_lock_flags_t)(1<<31)) */
-/* unused ((lib9p_lock_flags_t)(1<<30)) */
-/* unused ((lib9p_lock_flags_t)(1<<29)) */
-/* unused ((lib9p_lock_flags_t)(1<<28)) */
-/* unused ((lib9p_lock_flags_t)(1<<27)) */
-/* unused ((lib9p_lock_flags_t)(1<<26)) */
-/* unused ((lib9p_lock_flags_t)(1<<25)) */
-/* unused ((lib9p_lock_flags_t)(1<<24)) */
-/* unused ((lib9p_lock_flags_t)(1<<23)) */
-/* unused ((lib9p_lock_flags_t)(1<<22)) */
-/* unused ((lib9p_lock_flags_t)(1<<21)) */
-/* unused ((lib9p_lock_flags_t)(1<<20)) */
-/* unused ((lib9p_lock_flags_t)(1<<19)) */
-/* unused ((lib9p_lock_flags_t)(1<<18)) */
-/* unused ((lib9p_lock_flags_t)(1<<17)) */
-/* unused ((lib9p_lock_flags_t)(1<<16)) */
-/* unused ((lib9p_lock_flags_t)(1<<15)) */
-/* unused ((lib9p_lock_flags_t)(1<<14)) */
-/* unused ((lib9p_lock_flags_t)(1<<13)) */
-/* unused ((lib9p_lock_flags_t)(1<<12)) */
-/* unused ((lib9p_lock_flags_t)(1<<11)) */
-/* unused ((lib9p_lock_flags_t)(1<<10)) */
-/* unused ((lib9p_lock_flags_t)(1<<9)) */
-/* unused ((lib9p_lock_flags_t)(1<<8)) */
-/* unused ((lib9p_lock_flags_t)(1<<7)) */
-/* unused ((lib9p_lock_flags_t)(1<<6)) */
-/* unused ((lib9p_lock_flags_t)(1<<5)) */
-/* unused ((lib9p_lock_flags_t)(1<<4)) */
-/* unused ((lib9p_lock_flags_t)(1<<3)) */
-/* unused ((lib9p_lock_flags_t)(1<<2)) */
-#define LIB9P_LOCK_FLAGS_RECLAIM ((lib9p_lock_flags_t)(1<<1))
-#define LIB9P_LOCK_FLAGS_BLOCK ((lib9p_lock_flags_t)(1<<0))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_lock_flags_t, lib9p_lock_flags);
+/* bits */
+#define _LIB9P_LOCK_FLAGS_UNUSED_31 ((lib9p_lock_flags_t)(UINT32_C(1)<<31))
+#define _LIB9P_LOCK_FLAGS_UNUSED_30 ((lib9p_lock_flags_t)(UINT32_C(1)<<30))
+#define _LIB9P_LOCK_FLAGS_UNUSED_29 ((lib9p_lock_flags_t)(UINT32_C(1)<<29))
+#define _LIB9P_LOCK_FLAGS_UNUSED_28 ((lib9p_lock_flags_t)(UINT32_C(1)<<28))
+#define _LIB9P_LOCK_FLAGS_UNUSED_27 ((lib9p_lock_flags_t)(UINT32_C(1)<<27))
+#define _LIB9P_LOCK_FLAGS_UNUSED_26 ((lib9p_lock_flags_t)(UINT32_C(1)<<26))
+#define _LIB9P_LOCK_FLAGS_UNUSED_25 ((lib9p_lock_flags_t)(UINT32_C(1)<<25))
+#define _LIB9P_LOCK_FLAGS_UNUSED_24 ((lib9p_lock_flags_t)(UINT32_C(1)<<24))
+#define _LIB9P_LOCK_FLAGS_UNUSED_23 ((lib9p_lock_flags_t)(UINT32_C(1)<<23))
+#define _LIB9P_LOCK_FLAGS_UNUSED_22 ((lib9p_lock_flags_t)(UINT32_C(1)<<22))
+#define _LIB9P_LOCK_FLAGS_UNUSED_21 ((lib9p_lock_flags_t)(UINT32_C(1)<<21))
+#define _LIB9P_LOCK_FLAGS_UNUSED_20 ((lib9p_lock_flags_t)(UINT32_C(1)<<20))
+#define _LIB9P_LOCK_FLAGS_UNUSED_19 ((lib9p_lock_flags_t)(UINT32_C(1)<<19))
+#define _LIB9P_LOCK_FLAGS_UNUSED_18 ((lib9p_lock_flags_t)(UINT32_C(1)<<18))
+#define _LIB9P_LOCK_FLAGS_UNUSED_17 ((lib9p_lock_flags_t)(UINT32_C(1)<<17))
+#define _LIB9P_LOCK_FLAGS_UNUSED_16 ((lib9p_lock_flags_t)(UINT32_C(1)<<16))
+#define _LIB9P_LOCK_FLAGS_UNUSED_15 ((lib9p_lock_flags_t)(UINT32_C(1)<<15))
+#define _LIB9P_LOCK_FLAGS_UNUSED_14 ((lib9p_lock_flags_t)(UINT32_C(1)<<14))
+#define _LIB9P_LOCK_FLAGS_UNUSED_13 ((lib9p_lock_flags_t)(UINT32_C(1)<<13))
+#define _LIB9P_LOCK_FLAGS_UNUSED_12 ((lib9p_lock_flags_t)(UINT32_C(1)<<12))
+#define _LIB9P_LOCK_FLAGS_UNUSED_11 ((lib9p_lock_flags_t)(UINT32_C(1)<<11))
+#define _LIB9P_LOCK_FLAGS_UNUSED_10 ((lib9p_lock_flags_t)(UINT32_C(1)<<10))
+#define _LIB9P_LOCK_FLAGS_UNUSED_9 ((lib9p_lock_flags_t)(UINT32_C(1)<<9))
+#define _LIB9P_LOCK_FLAGS_UNUSED_8 ((lib9p_lock_flags_t)(UINT32_C(1)<<8))
+#define _LIB9P_LOCK_FLAGS_UNUSED_7 ((lib9p_lock_flags_t)(UINT32_C(1)<<7))
+#define _LIB9P_LOCK_FLAGS_UNUSED_6 ((lib9p_lock_flags_t)(UINT32_C(1)<<6))
+#define _LIB9P_LOCK_FLAGS_UNUSED_5 ((lib9p_lock_flags_t)(UINT32_C(1)<<5))
+#define _LIB9P_LOCK_FLAGS_UNUSED_4 ((lib9p_lock_flags_t)(UINT32_C(1)<<4))
+#define _LIB9P_LOCK_FLAGS_UNUSED_3 ((lib9p_lock_flags_t)(UINT32_C(1)<<3))
+#define _LIB9P_LOCK_FLAGS_UNUSED_2 ((lib9p_lock_flags_t)(UINT32_C(1)<<2))
+#define LIB9P_LOCK_FLAGS_RECLAIM ((lib9p_lock_flags_t)(UINT32_C(1)<<1))
+#define LIB9P_LOCK_FLAGS_BLOCK ((lib9p_lock_flags_t)(UINT32_C(1)<<0))
/* 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))
-#define LIB9P_LOCK_STATUS_ERROR ((lib9p_lock_status_t)UINT8_C(2))
-#define LIB9P_LOCK_STATUS_GRACE ((lib9p_lock_status_t)UINT8_C(3))
+LO_IMPLEMENTATION_H(fmt_formatter, lib9p_lock_status_t, lib9p_lock_status);
+#define LIB9P_LOCK_STATUS_SUCCESS ((lib9p_lock_status_t)(0))
+#define LIB9P_LOCK_STATUS_BLOCKED ((lib9p_lock_status_t)(1))
+#define LIB9P_LOCK_STATUS_ERROR ((lib9p_lock_status_t)(2))
+#define LIB9P_LOCK_STATUS_GRACE ((lib9p_lock_status_t)(3))
#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
@@ -541,11 +565,13 @@ struct lib9p_msg_Tflush {
lib9p_tag_t tag;
uint16_t oldtag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tflush, lib9p_msg_Tflush);
/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rflush {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rflush, lib9p_msg_Rflush);
/* min_size = 11 ; exp_size = 8,203 ; max_size = 2,147,483,658 ; max_iov = 2 ; max_copy = 11 */
struct lib9p_msg_Rread {
@@ -553,22 +579,26 @@ struct lib9p_msg_Rread {
uint32_t count;
[[gnu::nonstring]] char *data;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rread, lib9p_msg_Rread);
/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Rwrite {
lib9p_tag_t tag;
uint32_t count;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rwrite, lib9p_msg_Rwrite);
/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rclunk {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rclunk, lib9p_msg_Rclunk);
/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rremove {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rremove, lib9p_msg_Rremove);
#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
@@ -576,6 +606,7 @@ struct lib9p_msg_Rremove {
struct lib9p_msg_Rwstat {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rwstat, 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
@@ -583,22 +614,26 @@ struct lib9p_msg_Rwstat {
struct lib9p_msg_Rrename {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rrename, lib9p_msg_Rrename);
/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rsetattr {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rsetattr, lib9p_msg_Rsetattr);
/* size = 15 ; max_iov = 1 ; max_copy = 15 */
struct lib9p_msg_Rxattrwalk {
lib9p_tag_t tag;
uint64_t attr_size;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rxattrwalk, lib9p_msg_Rxattrwalk);
/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rxattrcreate {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rxattrcreate, lib9p_msg_Rxattrcreate);
/* 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 {
@@ -606,26 +641,31 @@ struct lib9p_msg_Rreaddir {
uint32_t count;
[[gnu::nonstring]] char *data;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rreaddir, lib9p_msg_Rreaddir);
/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rfsync {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rfsync, lib9p_msg_Rfsync);
/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rlink {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rlink, lib9p_msg_Rlink);
/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rrenameat {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rrenameat, lib9p_msg_Rrenameat);
/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Runlinkat {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Runlinkat, lib9p_msg_Runlinkat);
#endif /* CONFIG_9P_ENABLE_9P2000_L */
#if CONFIG_9P_ENABLE_9P2000_e
@@ -634,11 +674,13 @@ struct lib9p_msg_Tsession {
lib9p_tag_t tag;
uint64_t key;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tsession, lib9p_msg_Tsession);
/* size = 7 ; max_iov = 1 ; max_copy = 7 */
struct lib9p_msg_Rsession {
lib9p_tag_t tag;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rsession, lib9p_msg_Rsession);
/* 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 {
@@ -646,12 +688,14 @@ struct lib9p_msg_Rsread {
uint32_t count;
[[gnu::nonstring]] char *data;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rsread, lib9p_msg_Rsread);
/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Rswrite {
lib9p_tag_t tag;
uint32_t count;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rswrite, 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
@@ -662,6 +706,7 @@ struct lib9p_msg_Tread {
uint64_t offset;
uint32_t count;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tread, lib9p_msg_Tread);
/* min_size = 23 ; exp_size = 8,215 ; max_size = 2,147,483,670 ; max_iov = 2 ; max_copy = 23 */
struct lib9p_msg_Twrite {
@@ -671,18 +716,21 @@ struct lib9p_msg_Twrite {
uint32_t count;
[[gnu::nonstring]] char *data;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Twrite, lib9p_msg_Twrite);
/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Tclunk {
lib9p_tag_t tag;
lib9p_fid_t fid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tclunk, lib9p_msg_Tclunk);
/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Tremove {
lib9p_tag_t tag;
lib9p_fid_t fid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tremove, 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
@@ -691,6 +739,7 @@ struct lib9p_msg_Tstat {
lib9p_tag_t tag;
lib9p_fid_t fid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tstat, 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
@@ -699,12 +748,14 @@ struct lib9p_msg_Tstatfs {
lib9p_tag_t tag;
lib9p_fid_t fid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tstatfs, lib9p_msg_Tstatfs);
/* size = 11 ; max_iov = 1 ; max_copy = 11 */
struct lib9p_msg_Treadlink {
lib9p_tag_t tag;
lib9p_fid_t fid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Treadlink, lib9p_msg_Treadlink);
/* size = 23 ; max_iov = 1 ; max_copy = 23 */
struct lib9p_msg_Treaddir {
@@ -713,6 +764,7 @@ struct lib9p_msg_Treaddir {
uint64_t offset;
uint32_t count;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Treaddir, lib9p_msg_Treaddir);
#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
@@ -722,6 +774,7 @@ struct lib9p_msg_Tversion {
uint32_t max_msg_size;
struct lib9p_s version;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tversion, lib9p_msg_Tversion);
/* min_size = 13 ; exp_size = 40 ; max_size = 65,548 ; max_iov = 2 ; max_copy = 13 */
struct lib9p_msg_Rversion {
@@ -729,6 +782,7 @@ struct lib9p_msg_Rversion {
uint32_t max_msg_size;
struct lib9p_s version;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rversion, lib9p_msg_Rversion);
/* min_size = 17 ; exp_size = 481 ; max_size = 1,048,609 ; max_iov = 32 ; max_copy = 49 */
struct lib9p_msg_Twalk {
@@ -738,6 +792,7 @@ struct lib9p_msg_Twalk {
uint16_t nwname;
struct lib9p_s *wname;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Twalk, 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
@@ -748,12 +803,14 @@ struct lib9p_msg_Trename {
lib9p_fid_t dfid;
struct lib9p_s name;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Trename, lib9p_msg_Trename);
/* 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;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rreadlink, lib9p_msg_Rreadlink);
/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 2 ; max_copy = 17 */
struct lib9p_msg_Txattrwalk {
@@ -762,6 +819,7 @@ struct lib9p_msg_Txattrwalk {
lib9p_fid_t newfid;
struct lib9p_s name;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Txattrwalk, lib9p_msg_Txattrwalk);
/* min_size = 25 ; exp_size = 52 ; max_size = 65,560 ; max_iov = 3 ; max_copy = 25 */
struct lib9p_msg_Txattrcreate {
@@ -771,6 +829,7 @@ struct lib9p_msg_Txattrcreate {
uint64_t attr_size;
uint32_t flags;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Txattrcreate, lib9p_msg_Txattrcreate);
/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 2 ; max_copy = 17 */
struct lib9p_msg_Tlink {
@@ -779,6 +838,7 @@ struct lib9p_msg_Tlink {
lib9p_fid_t fid;
struct lib9p_s name;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tlink, lib9p_msg_Tlink);
/* min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 4 ; max_copy = 19 */
struct lib9p_msg_Trenameat {
@@ -788,6 +848,7 @@ struct lib9p_msg_Trenameat {
lib9p_fid_t newdirfid;
struct lib9p_s newname;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Trenameat, lib9p_msg_Trenameat);
/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 3 ; max_copy = 17 */
struct lib9p_msg_Tunlinkat {
@@ -796,6 +857,7 @@ struct lib9p_msg_Tunlinkat {
struct lib9p_s name;
uint32_t flags;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tunlinkat, lib9p_msg_Tunlinkat);
#endif /* CONFIG_9P_ENABLE_9P2000_L */
#if CONFIG_9P_ENABLE_9P2000_e
@@ -806,6 +868,7 @@ struct lib9p_msg_Tsread {
uint16_t nwname;
struct lib9p_s *wname;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tsread, lib9p_msg_Tsread);
/* 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 {
@@ -816,6 +879,7 @@ struct lib9p_msg_Tswrite {
uint32_t count;
[[gnu::nonstring]] char *data;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tswrite, 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
@@ -825,6 +889,7 @@ struct lib9p_qid {
uint32_t vers;
uint64_t path;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_qid, lib9p_qid);
/* 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 */
@@ -840,6 +905,7 @@ struct lib9p_msg_Tauth {
lib9p_nuid_t n_uid;
#endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tauth, lib9p_msg_Tauth);
/* 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 */
@@ -856,6 +922,7 @@ struct lib9p_msg_Tattach {
lib9p_nuid_t n_uid;
#endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tattach, 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
@@ -867,6 +934,7 @@ struct lib9p_msg_Tsymlink {
struct lib9p_s symtgt;
lib9p_nuid_t gid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tsymlink, lib9p_msg_Tsymlink);
#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
@@ -876,6 +944,7 @@ struct lib9p_msg_Topen {
lib9p_fid_t fid;
lib9p_o_t mode;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Topen, lib9p_msg_Topen);
/* min_size = 18 ; exp_size = 45 ; max_size = 65,553 ; max_iov = 3 ; max_copy = 18 */
struct lib9p_msg_Tcreate {
@@ -885,6 +954,7 @@ struct lib9p_msg_Tcreate {
lib9p_dm_t perm;
lib9p_o_t mode;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tcreate, 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
@@ -894,6 +964,7 @@ struct lib9p_msg_Topenfd {
lib9p_fid_t fid;
lib9p_o_t mode;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Topenfd, 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
@@ -909,6 +980,7 @@ struct lib9p_msg_Rerror {
lib9p_errno_t errno;
#endif /* CONFIG_9P_ENABLE_9P2000_u */
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rerror, lib9p_msg_Rerror);
#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
@@ -917,6 +989,7 @@ struct lib9p_msg_Rlerror {
lib9p_tag_t tag;
lib9p_errno_t ecode;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rlerror, lib9p_msg_Rlerror);
/* size = 67 ; max_iov = 1 ; max_copy = 67 */
struct lib9p_msg_Rstatfs {
@@ -931,6 +1004,7 @@ struct lib9p_msg_Rstatfs {
uint64_t fsid;
uint32_t namelen;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rstatfs, lib9p_msg_Rstatfs);
/* size = 15 ; max_iov = 1 ; max_copy = 15 */
struct lib9p_msg_Tlopen {
@@ -938,6 +1012,7 @@ struct lib9p_msg_Tlopen {
lib9p_fid_t fid;
lib9p_lo_t flags;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tlopen, lib9p_msg_Tlopen);
/* min_size = 25 ; exp_size = 52 ; max_size = 65,560 ; max_iov = 3 ; max_copy = 25 */
struct lib9p_msg_Tlcreate {
@@ -948,6 +1023,7 @@ struct lib9p_msg_Tlcreate {
lib9p_mode_t mode;
lib9p_nuid_t gid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tlcreate, lib9p_msg_Tlcreate);
/* min_size = 29 ; exp_size = 56 ; max_size = 65,564 ; max_iov = 3 ; max_copy = 29 */
struct lib9p_msg_Tmknod {
@@ -959,6 +1035,7 @@ struct lib9p_msg_Tmknod {
uint32_t minor;
lib9p_nuid_t gid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tmknod, lib9p_msg_Tmknod);
/* min_size = 21 ; exp_size = 48 ; max_size = 65,556 ; max_iov = 3 ; max_copy = 21 */
struct lib9p_msg_Tmkdir {
@@ -968,6 +1045,7 @@ struct lib9p_msg_Tmkdir {
lib9p_mode_t mode;
lib9p_nuid_t gid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tmkdir, lib9p_msg_Tmkdir);
/* size = 15 ; max_iov = 1 ; max_copy = 15 */
struct lib9p_msg_Tfsync {
@@ -975,6 +1053,7 @@ struct lib9p_msg_Tfsync {
lib9p_fid_t fid;
lib9p_b4_t datasync;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tfsync, lib9p_msg_Tfsync);
/* size = 19 ; max_iov = 1 ; max_copy = 19 */
struct lib9p_msg_Tgetattr {
@@ -982,6 +1061,7 @@ struct lib9p_msg_Tgetattr {
lib9p_fid_t fid;
lib9p_getattr_t request_mask;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tgetattr, lib9p_msg_Tgetattr);
/* size = 67 ; max_iov = 1 ; max_copy = 67 */
struct lib9p_msg_Tsetattr {
@@ -997,6 +1077,7 @@ struct lib9p_msg_Tsetattr {
uint64_t mtime_sec;
uint64_t mtime_nsec;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tsetattr, lib9p_msg_Tsetattr);
/* min_size = 34 ; exp_size = 61 ; max_size = 65,569 ; max_iov = 2 ; max_copy = 34 */
struct lib9p_msg_Tgetlock {
@@ -1008,6 +1089,7 @@ struct lib9p_msg_Tgetlock {
uint32_t proc_id;
struct lib9p_s client_id;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tgetlock, lib9p_msg_Tgetlock);
/* min_size = 30 ; exp_size = 57 ; max_size = 65,565 ; max_iov = 2 ; max_copy = 30 */
struct lib9p_msg_Rgetlock {
@@ -1018,6 +1100,7 @@ struct lib9p_msg_Rgetlock {
uint32_t proc_id;
struct lib9p_s client_id;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rgetlock, lib9p_msg_Rgetlock);
/* min_size = 38 ; exp_size = 65 ; max_size = 65,573 ; max_iov = 2 ; max_copy = 38 */
struct lib9p_msg_Tlock {
@@ -1030,12 +1113,14 @@ struct lib9p_msg_Tlock {
uint32_t proc_id;
struct lib9p_s client_id;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Tlock, lib9p_msg_Tlock);
/* size = 8 ; max_iov = 1 ; max_copy = 8 */
struct lib9p_msg_Rlock {
lib9p_tag_t tag;
lib9p_lock_status_t status;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rlock, 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
@@ -1062,6 +1147,7 @@ struct lib9p_stat {
lib9p_nuid_t file_last_modified_n_uid;
#endif /* CONFIG_9P_ENABLE_9P2000_u */
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_stat, 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
@@ -1070,12 +1156,14 @@ struct lib9p_msg_Rauth {
lib9p_tag_t tag;
struct lib9p_qid aqid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rauth, lib9p_msg_Rauth);
/* size = 20 ; max_iov = 1 ; max_copy = 20 */
struct lib9p_msg_Rattach {
lib9p_tag_t tag;
struct lib9p_qid qid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rattach, lib9p_msg_Rattach);
/* min_size = 9 ; exp_size = 217 ; max_size = 217 ; max_iov = 1 ; max_copy = 217 */
struct lib9p_msg_Rwalk {
@@ -1083,6 +1171,7 @@ struct lib9p_msg_Rwalk {
uint16_t nwqid;
struct lib9p_qid *wqid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rwalk, 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
@@ -1092,6 +1181,7 @@ struct lib9p_msg_Ropen {
struct lib9p_qid qid;
uint32_t iounit;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Ropen, lib9p_msg_Ropen);
/* size = 24 ; max_iov = 1 ; max_copy = 24 */
struct lib9p_msg_Rcreate {
@@ -1099,6 +1189,7 @@ struct lib9p_msg_Rcreate {
struct lib9p_qid qid;
uint32_t iounit;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rcreate, 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
@@ -1109,6 +1200,7 @@ struct lib9p_msg_Ropenfd {
uint32_t iounit;
uint32_t unixfd;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Ropenfd, lib9p_msg_Ropenfd);
#endif /* CONFIG_9P_ENABLE_9P2000_p9p */
#if CONFIG_9P_ENABLE_9P2000_L
@@ -1118,6 +1210,7 @@ struct lib9p_msg_Rlopen {
struct lib9p_qid qid;
uint32_t iounit;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rlopen, lib9p_msg_Rlopen);
/* size = 24 ; max_iov = 1 ; max_copy = 24 */
struct lib9p_msg_Rlcreate {
@@ -1125,18 +1218,21 @@ struct lib9p_msg_Rlcreate {
struct lib9p_qid qid;
uint32_t iounit;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rlcreate, lib9p_msg_Rlcreate);
/* size = 20 ; max_iov = 1 ; max_copy = 20 */
struct lib9p_msg_Rsymlink {
lib9p_tag_t tag;
struct lib9p_qid qid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rsymlink, lib9p_msg_Rsymlink);
/* size = 20 ; max_iov = 1 ; max_copy = 20 */
struct lib9p_msg_Rmknod {
lib9p_tag_t tag;
struct lib9p_qid qid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rmknod, lib9p_msg_Rmknod);
/* size = 160 ; max_iov = 1 ; max_copy = 160 */
struct lib9p_msg_Rgetattr {
@@ -1162,12 +1258,14 @@ struct lib9p_msg_Rgetattr {
uint64_t gen;
uint64_t data_version;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rgetattr, lib9p_msg_Rgetattr);
/* size = 20 ; max_iov = 1 ; max_copy = 20 */
struct lib9p_msg_Rmkdir {
lib9p_tag_t tag;
struct lib9p_qid qid;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rmkdir, 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
@@ -1179,6 +1277,7 @@ struct lib9p_msg_Rstat {
lib9p_tag_t tag;
struct lib9p_stat stat;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Rstat, lib9p_msg_Rstat);
/* 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 */
@@ -1189,6 +1288,7 @@ struct lib9p_msg_Twstat {
lib9p_fid_t fid;
struct lib9p_stat stat;
};
+LO_IMPLEMENTATION_H(fmt_formatter, struct lib9p_msg_Twstat, lib9p_msg_Twstat);
#endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */
/* containers *****************************************************************/
diff --git a/lib9p/include/lib9p/9p.h b/lib9p/include/lib9p/9p.h
index 35b7ef2..5919260 100644
--- a/lib9p/include/lib9p/9p.h
+++ b/lib9p/include/lib9p/9p.h
@@ -18,6 +18,7 @@
#ifndef CONFIG_9P_MAX_ERR_SIZE
#error config.h must define CONFIG_9P_MAX_ERR_SIZE
#endif
+static_assert(CONFIG_9P_MAX_ERR_SIZE <= UINT16_MAX);
/* constants ******************************************************************/
@@ -60,6 +61,12 @@ int lib9p_error(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *ms
/** Write a printf-style error into ctx, return -1. */
int lib9p_errorf(struct lib9p_ctx *ctx, lib9p_errno_t linux_errno, char const *fmt, ...) [[gnu::format(printf, 3, 4)]];
+/* misc utilities *************************************************************/
+
+uint32_t lib9p_version_min_msg_size(enum lib9p_version);
+
+lo_interface fmt_formatter lo_box_lib9p_msg_as_fmt_formatter(struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *body);
+
/* main T-message functions ***************************************************/
/**
@@ -159,7 +166,7 @@ static inline void lib9p_stat_assert(struct lib9p_stat stat) {
* @return whether there was an error
*/
bool lib9p_stat_validate(struct lib9p_ctx *ctx, uint32_t net_size, uint8_t *net_bytes,
- uint32_t *ret_net_size, ssize_t *ret_host_size);
+ uint32_t *ret_net_size, ssize_t *ret_host_size);
/**
* Unmarshal the 9P `net_bytes` into the C struct `ret_obj`.
@@ -170,12 +177,10 @@ bool lib9p_stat_validate(struct lib9p_ctx *ctx, uint32_t net_size, uint8_t *net_
* @param ctx : negotiated protocol parameters
* @param net_bytes : network-encoded stat structure
*
- * @return ret_obj : where to put the stat object itself
- * @return ret_extra : where to put strings for the stat object
- * @return consumed net_bytes
+ * @return ret : the stat object, must be at least lib9p_stat_validate()->ret_net_size bytes
*/
-uint32_t lib9p_stat_unmarshal(struct lib9p_ctx *ctx, uint8_t *net_bytes,
- struct lib9p_stat *ret_obj, void *ret_extra);
+void lib9p_stat_unmarshal(struct lib9p_ctx *ctx, uint8_t *net_bytes,
+ struct lib9p_stat *ret);
/**
* Marhsal a `struct lib9p_stat` structure into a byte-array.
diff --git a/lib9p/include/lib9p/srv.h b/lib9p/include/lib9p/srv.h
index 83aabc0..ec47142 100644
--- a/lib9p/include/lib9p/srv.h
+++ b/lib9p/include/lib9p/srv.h
@@ -19,16 +19,16 @@
/* context ********************************************************************/
-CR_CHAN_DECLARE(_lib9p_srv_flushch, bool)
+CR_CHAN_DECLARE(_lib9p_srv_flushch, bool);
struct lib9p_srv_ctx {
struct lib9p_ctx basectx;
uint32_t uid;
struct lib9p_s uname;
- BEGIN_PRIVATE(LIB9P_SRV_H)
+ BEGIN_PRIVATE(LIB9P_SRV_H);
_lib9p_srv_flushch_t _flushch;
- END_PRIVATE(LIB9P_SRV_H)
+ END_PRIVATE(LIB9P_SRV_H);
};
bool lib9p_srv_flush_requested(struct lib9p_srv_ctx *ctx);
@@ -37,57 +37,102 @@ int lib9p_srv_acknowledge_flush(struct lib9p_srv_ctx *ctx);
/* interface definitions ******************************************************/
-#define lib9p_srv_file_LO_IFACE \
- /* all - resource management */ \
- LO_FUNC(void , free ) /* must not error */ \
- LO_FUNC(struct lib9p_qid , qid ) /* must not error */ \
- LO_FUNC(uint32_t , chio , struct lib9p_srv_ctx *, \
- bool rd, bool wr, \
- bool trunc) \
- \
- /* all - syscalls */ \
- LO_FUNC(struct lib9p_stat , stat , struct lib9p_srv_ctx *) \
- LO_FUNC(void , wstat , struct lib9p_srv_ctx *, \
- struct lib9p_stat new) \
- LO_FUNC(void , remove , struct lib9p_srv_ctx *) \
- \
- /* directories - base */ \
- LO_FUNC(lo_interface lib9p_srv_file, dopen , struct lib9p_srv_ctx *, \
- struct lib9p_s childname) \
- LO_FUNC(lo_interface lib9p_srv_file, dcreate, struct lib9p_srv_ctx *, \
- struct lib9p_s childname, \
- lib9p_dm_t perm, \
- lib9p_o_t flags) \
- \
- /* directories - once opened */ \
- LO_FUNC(size_t /* <- obj cnt */ , dread , struct lib9p_srv_ctx *, \
- uint8_t *buf, \
- /* num bytes -> */ uint32_t byte_count, \
- /* starting at this object -> */ size_t obj_offset) \
- \
- /* non-directories - once opened */ \
- LO_FUNC(uint32_t , pread , struct lib9p_srv_ctx *, \
- void *buf, \
- uint32_t byte_count, \
- uint64_t byte_offset) \
- LO_FUNC(uint32_t , pwrite , struct lib9p_srv_ctx *, \
- void *buf, \
- uint32_t byte_count, \
+lo_interface lib9p_srv_fio;
+lo_interface lib9p_srv_dio;
+
+/* FIXME: I don't like that the pointers returned by stat() and
+ * pread() have to remain live after they return. Perhaps a
+ * `respond()`-callback? But that just reads as gross in C.
+ *
+ * FIXME: It would be nice if pread() could return more than 1 iovec.
+ */
+#define lib9p_srv_file_LO_IFACE \
+ /* resource management **********************************************/ \
+ \
+ /** \
+ * free() is be called when all FIDs associated with the file are \
+ * clunked. \
+ * \
+ * free() MUST NOT error. \
+ */ \
+ LO_FUNC(void , free ) \
+ \
+ /** \
+ * qid() is called frequently and returns the current QID of the file. \
+ * The .path field MUST never change, the .type field may change in \
+ * response to wstat() calls (but the QT_DIR bit MUST NOT change), and \
+ * the .vers field may change frequently in response to any number of \
+ * things (wstat(), write(), or non-9P events). \
+ * \
+ * qid() MUST NOT error. \
+ */ \
+ LO_FUNC(struct lib9p_qid , qid ) \
+ \
+ /* non-"opened" generic I/O *****************************************/ \
+ \
+ LO_FUNC(struct lib9p_stat , stat , struct lib9p_srv_ctx *) \
+ LO_FUNC(void , wstat , struct lib9p_srv_ctx *, \
+ struct lib9p_stat new) \
+ LO_FUNC(void , remove , struct lib9p_srv_ctx *) \
+ \
+ /* non-"opened" directory I/O ***************************************/ \
+ \
+ LO_FUNC(lo_interface lib9p_srv_file, dwalk , struct lib9p_srv_ctx *, \
+ struct lib9p_s childname) \
+ LO_FUNC(lo_interface lib9p_srv_file, dcreate, struct lib9p_srv_ctx *, \
+ struct lib9p_s childname, \
+ lib9p_dm_t perm, \
+ lib9p_o_t flags) \
+ \
+ /* open() for I/O ***************************************************/ \
+ \
+ LO_FUNC(lo_interface lib9p_srv_fio , fopen , struct lib9p_srv_ctx *, \
+ bool rd, bool wr, \
+ bool trunc) \
+ LO_FUNC(lo_interface lib9p_srv_dio , dopen , struct lib9p_srv_ctx *)
+LO_INTERFACE(lib9p_srv_file);
+
+#define lib9p_srv_fio_LO_IFACE \
+ LO_FUNC(struct lib9p_qid , qid ) \
+ LO_FUNC(void , iofree ) \
+ LO_FUNC(uint32_t , iounit ) \
+ LO_FUNC(void , pread , struct lib9p_srv_ctx *, \
+ uint32_t byte_count, \
+ uint64_t byte_offset, \
+ struct iovec *ret) \
+ LO_FUNC(uint32_t , pwrite , struct lib9p_srv_ctx *, \
+ void *buf, \
+ uint32_t byte_count, \
uint64_t byte_offset)
-LO_INTERFACE(lib9p_srv_file)
+LO_INTERFACE(lib9p_srv_fio);
+
+/* FIXME: The dio interface just feels clunky. I'm not in a rush to
+ * change it because util9p_static_dir is already implemented and I
+ * don't anticipate the sbc-harness needing another dio
+ * implementation. But if I wanted lib9p to be used outside of
+ * sbc-harness, this is one of the first things that I'd want to
+ * change.
+ */
+#define lib9p_srv_dio_LO_IFACE \
+ LO_FUNC(struct lib9p_qid , qid ) \
+ LO_FUNC(void , iofree ) \
+ LO_FUNC(size_t /* <- obj cnt */ , dread , struct lib9p_srv_ctx *, \
+ uint8_t *buf, \
+ /* num bytes -> */ uint32_t byte_count, \
+ /* starting at this object -> */ size_t obj_offset)
+LO_INTERFACE(lib9p_srv_dio);
#define LIB9P_SRV_NOTDIR(TYP, NAM) \
- static lo_interface lib9p_srv_file NAM##_dopen (TYP *, struct lib9p_srv_ctx *, struct lib9p_s) { assert_notreached("not a directory"); } \
+ static lo_interface lib9p_srv_file NAM##_dwalk (TYP *, struct lib9p_srv_ctx *, struct lib9p_s) { assert_notreached("not a directory"); } \
static lo_interface lib9p_srv_file NAM##_dcreate(TYP *, struct lib9p_srv_ctx *, struct lib9p_s, lib9p_dm_t, lib9p_o_t) { assert_notreached("not a directory"); } \
- static size_t NAM##_dread (TYP *, struct lib9p_srv_ctx *, uint8_t *, uint32_t, size_t) { assert_notreached("not a directory"); }
+ static lo_interface lib9p_srv_dio NAM##_dopen (TYP *, struct lib9p_srv_ctx *) { assert_notreached("not a directory"); }
#define LIB9P_SRV_NOTFILE(TYP, NAM) \
- static uint32_t NAM##_pread (TYP *, struct lib9p_srv_ctx *, void *, uint32_t, uint64_t) { assert_notreached("not a file"); } \
- static uint32_t NAM##_pwrite(TYP *, struct lib9p_srv_ctx *, void *, uint32_t, uint64_t) { assert_notreached("not a file"); }
+ static lo_interface lib9p_srv_fio NAM##_fopen (TYP *, struct lib9p_srv_ctx *, bool, bool, bool) { assert_notreached("not a file"); }
/* main server entrypoints ****************************************************/
-CR_RPC_DECLARE(_lib9p_srv_reqch, struct _lib9p_srv_req *, bool)
+CR_RPC_DECLARE(_lib9p_srv_reqch, struct _lib9p_srv_req *, bool);
struct lib9p_srv {
/* Things you provide */
@@ -95,24 +140,40 @@ struct lib9p_srv {
lo_interface lib9p_srv_file (*rootdir)(struct lib9p_srv_ctx *, struct lib9p_s treename);
/* For internal use */
- BEGIN_PRIVATE(LIB9P_SRV_H)
+ BEGIN_PRIVATE(LIB9P_SRV_H);
unsigned int readers;
unsigned int writers;
_lib9p_srv_reqch_t _reqch;
- END_PRIVATE(LIB9P_SRV_H)
+ END_PRIVATE(LIB9P_SRV_H);
};
/**
+ * In an infinite loop, accept a connection and read messages from it until
+ * close; dispatching requests to a pool of lib9p_srv_write_cr() coroutines
+ * with the same `srv`.
+ *
* Will just close the connection if a T-message has a size[4] <7.
*
+ * @param srv: The server configuration and state; has an associated pool of
+ * lib9p_srv_write_cr() coroutines.
+ * @param listener: The listener object to accept connections from.
+ *
* @errno LINUX_EMSGSIZE T-message has size[4] bigger than max_msg_size
* @errno LINUX_EDOM Tversion specified an impossibly small max_msg_size
* @errno LINUX_EOPNOTSUPP T-message has an R-message type, or an unrecognized T-message type
* @errno LINUX_EBADMSG T-message has wrong size[4] for its content, or has invalid UTF-8
* @errno LINUX_ERANGE R-message does not fit into max_msg_size
*/
-
[[noreturn]] void lib9p_srv_read_cr(struct lib9p_srv *srv, lo_interface net_stream_listener listener);
+
+/**
+ * Service requests to the `struct lib9p_srv *srv` argument that have been
+ * read by lib9p_srv_read_cr().
+ *
+ * @param struct lib9p_srv *srv: The server configuration and state; has an
+ * associated pool of lib9p_srv_read_cr()
+ * coroutines.
+ */
COROUTINE lib9p_srv_write_cr(void *_srv);
#endif /* _LIB9P_SRV_H_ */