diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-09 11:05:26 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-09 11:05:26 -0600 |
commit | cb8893dd08b7b359f45ef225acd2f6e103d38bba (patch) | |
tree | 1ae67dac842ee044ec1bd838ac9457f06c66b804 /lib9p/include | |
parent | bed78039f9bf086d35a3ae5efc8e6701c50ed006 (diff) |
wip
Diffstat (limited to 'lib9p/include')
-rw-r--r-- | lib9p/include/lib9p/9p.generated.h | 284 |
1 files changed, 175 insertions, 109 deletions
diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h index 6d44472..2fb7a3e 100644 --- a/lib9p/include/lib9p/9p.generated.h +++ b/lib9p/include/lib9p/9p.generated.h @@ -1,4 +1,4 @@ -/* Generated by `./lib9p/9p.gen lib9p/9P2000.txt lib9p/9P2000.u.txt lib9p/9P2000.e.txt`. DO NOT EDIT! */ +/* Generated by `./lib9p/idl.gen lib9p/idl/01-9P2000.9p lib9p/idl/02-9P2000.e.9p lib9p/idl/02-9P2000.u.9p`. DO NOT EDIT! */ #ifndef _LIB9P_9P_H_ # error Do not include <lib9p/9p.generated.h> directly; include <lib9p/9p.h> instead @@ -10,9 +10,15 @@ enum lib9p_version { LIB9P_VER_unknown = 0, /* "unknown" */ +#if defined(CONFIG_9P_ENABLE_9P2000) LIB9P_VER_9P2000, /* "9P2000" */ +#endif /* defined(CONFIG_9P_ENABLE_9P2000) */ +#if defined(CONFIG_9P_ENABLE_9P2000_e) LIB9P_VER_9P2000_e, /* "9P2000.e" */ +#endif /* defined(CONFIG_9P_ENABLE_9P2000_e) */ +#if defined(CONFIG_9P_ENABLE_9P2000_u) LIB9P_VER_9P2000_u, /* "9P2000.u" */ +#endif /* defined(CONFIG_9P_ENABLE_9P2000_u) */ LIB9P_VER_NUM, }; @@ -20,71 +26,10 @@ const char *lib9p_version_str(enum lib9p_version); /* non-message types **********************************************************/ -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)) -#define _LIB9P_DM_UNUSED_25 ((lib9p_dm_t)(1<<25)) -#define _LIB9P_DM_UNUSED_24 ((lib9p_dm_t)(1<<24)) -#define LIB9P_DM_DEVICE ((lib9p_dm_t)(1<<23)) /* 9P2000.u */ -#define _LIB9P_DM_UNUSED_22 ((lib9p_dm_t)(1<<22)) -#define LIB9P_DM_NAMEDPIPE ((lib9p_dm_t)(1<<21)) /* 9P2000.u */ -#define LIB9P_DM_SOCKET ((lib9p_dm_t)(1<<20)) /* 9P2000.u */ -#define LIB9P_DM_SETUID ((lib9p_dm_t)(1<<19)) /* 9P2000.u */ -#define LIB9P_DM_SETGID ((lib9p_dm_t)(1<<18)) /* 9P2000.u */ -#define _LIB9P_DM_UNUSED_17 ((lib9p_dm_t)(1<<17)) -#define _LIB9P_DM_UNUSED_16 ((lib9p_dm_t)(1<<16)) -#define _LIB9P_DM_UNUSED_15 ((lib9p_dm_t)(1<<15)) -#define _LIB9P_DM_UNUSED_14 ((lib9p_dm_t)(1<<14)) -#define _LIB9P_DM_UNUSED_13 ((lib9p_dm_t)(1<<13)) -#define _LIB9P_DM_UNUSED_12 ((lib9p_dm_t)(1<<12)) -#define _LIB9P_DM_UNUSED_11 ((lib9p_dm_t)(1<<11)) -#define _LIB9P_DM_UNUSED_10 ((lib9p_dm_t)(1<<10)) -#define _LIB9P_DM_UNUSED_9 ((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 ((lib9p_dm_t)(0777)) - -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_SYMLINK ((lib9p_qt_t)(1<<1)) /* 9P2000.u */ -#define _LIB9P_QT_UNUSED_0 ((lib9p_qt_t)(1<<0)) - -#define LIB9P_QT_FILE ((lib9p_qt_t)(0)) - -typedef uint8_t lib9p_o_t; - -#define _LIB9P_O_UNUSED_7 ((lib9p_o_t)(1<<7)) -#define LIB9P_O_RCLOSE ((lib9p_o_t)(1<<6)) -#define _LIB9P_O_UNUSED_5 ((lib9p_o_t)(1<<5)) -#define LIB9P_O_TRUNC ((lib9p_o_t)(1<<4)) -#define _LIB9P_O_UNUSED_3 ((lib9p_o_t)(1<<3)) -#define _LIB9P_O_UNUSED_2 ((lib9p_o_t)(1<<2)) -#define LIB9P_O_rwx_1 ((lib9p_o_t)(1<<1)) -#define LIB9P_O_rwx_0 ((lib9p_o_t)(1<<0)) +#if defined(CONFIG_9P_ENABLE_9P2000) || defined(CONFIG_9P_ENABLE_9P2000_e) || defined(CONFIG_9P_ENABLE_9P2000_u) +typedef uint16_t lib9p_tag_t; -#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)) +typedef uint32_t lib9p_fid_t; struct lib9p_d { uint32_t len; @@ -96,6 +41,62 @@ struct lib9p_s { char *utf8; }; +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)) */ +#if defined(CONFIG_9P_ENABLE_9P2000_u) +# define LIB9P_DM_DEVICE ((lib9p_dm_t)(1<<23)) +#endif /* defined(CONFIG_9P_ENABLE_9P2000_u) */ +/* unused ((lib9p_dm_t)(1<<22)) */ +#if defined(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)) +#endif /* defined(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 ((lib9p_dm_t)(0777)) + +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)) +#if defined(CONFIG_9P_ENABLE_9P2000_u) +# define LIB9P_QT_SYMLINK ((lib9p_qt_t)(1<<1)) +#endif /* defined(CONFIG_9P_ENABLE_9P2000_u) */ +/* unused ((lib9p_qt_t)(1<<0)) */ + +#define LIB9P_QT_FILE ((lib9p_qt_t)(0)) + struct lib9p_qid { lib9p_qt_t type; uint32_t vers; @@ -114,15 +115,35 @@ struct lib9p_stat { struct lib9p_s file_owner_uid; struct lib9p_s file_owner_gid; struct lib9p_s file_last_modified_uid; - struct lib9p_s file_extension; /* 9P2000.u */ - uint32_t file_owner_n_uid; /* 9P2000.u */ - uint32_t file_owner_n_gid; /* 9P2000.u */ - uint32_t file_last_modified_n_uid; /* 9P2000.u */ +#if defined(CONFIG_9P_ENABLE_9P2000_u) + struct lib9p_s file_extension; + uint32_t file_owner_n_uid; + uint32_t file_owner_n_gid; + uint32_t file_last_modified_n_uid; +#endif /* defined(CONFIG_9P_ENABLE_9P2000_u) */ }; +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_rwx_1 ((lib9p_o_t)(1<<1)) +#define LIB9P_O_rwx_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)) +#endif /* defined(CONFIG_9P_ENABLE_9P2000) || defined(CONFIG_9P_ENABLE_9P2000_e) || defined(CONFIG_9P_ENABLE_9P2000_u) */ + /* messages *******************************************************************/ enum lib9p_msg_type { /* uint8_t */ +#if defined(CONFIG_9P_ENABLE_9P2000) || defined(CONFIG_9P_ENABLE_9P2000_e) || defined(CONFIG_9P_ENABLE_9P2000_u) LIB9P_TYP_Tversion = 100, LIB9P_TYP_Rversion = 101, LIB9P_TYP_Tauth = 102, @@ -150,170 +171,215 @@ enum lib9p_msg_type { /* uint8_t */ LIB9P_TYP_Rstat = 125, LIB9P_TYP_Twstat = 126, LIB9P_TYP_Rwstat = 127, - LIB9P_TYP_Tsession = 150, /* 9P2000.e */ - LIB9P_TYP_Rsession = 151, /* 9P2000.e */ - LIB9P_TYP_Tsread = 152, /* 9P2000.e */ - LIB9P_TYP_Rsread = 153, /* 9P2000.e */ - LIB9P_TYP_Tswrite = 154, /* 9P2000.e */ - LIB9P_TYP_Rswrite = 155, /* 9P2000.e */ +#endif /* defined(CONFIG_9P_ENABLE_9P2000) || defined(CONFIG_9P_ENABLE_9P2000_e) || defined(CONFIG_9P_ENABLE_9P2000_u) */ +#if defined(CONFIG_9P_ENABLE_9P2000_e) + LIB9P_TYP_Tsession = 150, + LIB9P_TYP_Rsession = 151, + LIB9P_TYP_Tsread = 152, + LIB9P_TYP_Rsread = 153, + LIB9P_TYP_Tswrite = 154, + LIB9P_TYP_Rswrite = 155, +#endif /* defined(CONFIG_9P_ENABLE_9P2000_e) */ }; const char *lib9p_msg_type_str(enum lib9p_msg_type); +#if defined(CONFIG_9P_ENABLE_9P2000) || defined(CONFIG_9P_ENABLE_9P2000_e) || defined(CONFIG_9P_ENABLE_9P2000_u) struct lib9p_msg_Tversion { + lib9p_tag_t tag; uint32_t max_msg_size; struct lib9p_s version; }; struct lib9p_msg_Rversion { + lib9p_tag_t tag; uint32_t max_msg_size; struct lib9p_s version; }; struct lib9p_msg_Tauth { - uint32_t afid; + lib9p_tag_t tag; + lib9p_fid_t afid; struct lib9p_s uname; struct lib9p_s aname; - uint32_t n_uname; /* 9P2000.u */ +#if defined(CONFIG_9P_ENABLE_9P2000_u) + uint32_t n_uname; +#endif /* defined(CONFIG_9P_ENABLE_9P2000_u) */ }; struct lib9p_msg_Rauth { + lib9p_tag_t tag; struct lib9p_qid aqid; }; struct lib9p_msg_Tattach { - uint32_t fid; - uint32_t afid; + lib9p_tag_t tag; + lib9p_fid_t fid; + lib9p_fid_t afid; struct lib9p_s uname; struct lib9p_s aname; - uint32_t n_uname; /* 9P2000.u */ +#if defined(CONFIG_9P_ENABLE_9P2000_u) + uint32_t n_uname; +#endif /* defined(CONFIG_9P_ENABLE_9P2000_u) */ }; struct lib9p_msg_Rattach { + lib9p_tag_t tag; struct lib9p_qid qid; }; struct lib9p_msg_Rerror { + lib9p_tag_t tag; struct lib9p_s ename; - uint32_t errno; /* 9P2000.u */ +#if defined(CONFIG_9P_ENABLE_9P2000_u) + uint32_t errno; +#endif /* defined(CONFIG_9P_ENABLE_9P2000_u) */ }; struct lib9p_msg_Tflush { - uint16_t oldtag; + lib9p_tag_t tag; + uint16_t oldtag; }; -struct lib9p_msg_Rflush {}; +struct lib9p_msg_Rflush { + lib9p_tag_t tag; +}; struct lib9p_msg_Twalk { - uint32_t fid; - uint32_t newfid; + lib9p_tag_t tag; + lib9p_fid_t fid; + lib9p_fid_t newfid; uint16_t nwname; struct lib9p_s *wname; }; struct lib9p_msg_Rwalk { + lib9p_tag_t tag; uint16_t nwqid; struct lib9p_qid *wqid; }; struct lib9p_msg_Topen { - uint32_t fid; - lib9p_o_t mode; + lib9p_tag_t tag; + lib9p_fid_t fid; + lib9p_o_t mode; }; struct lib9p_msg_Ropen { + lib9p_tag_t tag; struct lib9p_qid qid; uint32_t iounit; }; struct lib9p_msg_Tcreate { - uint32_t fid; + lib9p_tag_t tag; + lib9p_fid_t fid; struct lib9p_s name; lib9p_dm_t perm; lib9p_o_t mode; }; struct lib9p_msg_Rcreate { + lib9p_tag_t tag; struct lib9p_qid qid; uint32_t iounit; }; struct lib9p_msg_Tread { - uint32_t fid; - uint64_t offset; - uint32_t count; + lib9p_tag_t tag; + lib9p_fid_t fid; + uint64_t offset; + uint32_t count; }; struct lib9p_msg_Rread { + lib9p_tag_t tag; struct lib9p_d data; }; struct lib9p_msg_Twrite { - uint32_t fid; + lib9p_tag_t tag; + lib9p_fid_t fid; uint64_t offset; struct lib9p_d data; }; struct lib9p_msg_Rwrite { - uint32_t count; + lib9p_tag_t tag; + uint32_t count; }; struct lib9p_msg_Tclunk { - uint32_t fid; + lib9p_tag_t tag; + lib9p_fid_t fid; }; -struct lib9p_msg_Rclunk {}; +struct lib9p_msg_Rclunk { + lib9p_tag_t tag; +}; struct lib9p_msg_Tremove { - uint32_t fid; + lib9p_tag_t tag; + lib9p_fid_t fid; }; -struct lib9p_msg_Rremove {}; +struct lib9p_msg_Rremove { + lib9p_tag_t tag; +}; struct lib9p_msg_Tstat { - uint32_t fid; + lib9p_tag_t tag; + lib9p_fid_t fid; }; struct lib9p_msg_Rstat { + lib9p_tag_t tag; struct lib9p_stat stat; }; struct lib9p_msg_Twstat { - uint32_t fid; + lib9p_tag_t tag; + lib9p_fid_t fid; struct lib9p_stat stat; }; -struct lib9p_msg_Rwstat {}; +struct lib9p_msg_Rwstat { + lib9p_tag_t tag; +}; -/* 9P2000.e */ +#endif /* defined(CONFIG_9P_ENABLE_9P2000) || defined(CONFIG_9P_ENABLE_9P2000_e) || defined(CONFIG_9P_ENABLE_9P2000_u) */ +#if defined(CONFIG_9P_ENABLE_9P2000_e) struct lib9p_msg_Tsession { - uint64_t key; + lib9p_tag_t tag; + uint64_t key; }; -/* 9P2000.e */ -struct lib9p_msg_Rsession {}; +struct lib9p_msg_Rsession { + lib9p_tag_t tag; +}; -/* 9P2000.e */ struct lib9p_msg_Tsread { + lib9p_tag_t tag; uint32_t fid; uint16_t nwname; struct lib9p_s *wname; }; -/* 9P2000.e */ struct lib9p_msg_Rsread { + lib9p_tag_t tag; struct lib9p_d data; }; -/* 9P2000.e */ struct lib9p_msg_Tswrite { + lib9p_tag_t tag; uint32_t fid; uint16_t nwname; struct lib9p_s *wname; struct lib9p_d data; }; -/* 9P2000.e */ struct lib9p_msg_Rswrite { - uint32_t count; + lib9p_tag_t tag; + uint32_t count; }; +#endif /* defined(CONFIG_9P_ENABLE_9P2000_e) */ |