diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-11 23:17:53 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-19 15:43:34 -0700 |
commit | 7d96ae649f38f40ed22fc7d371d2dacfc989eef0 (patch) | |
tree | 89876a2b90307a180bd042575d1a58d1c9cb5b02 | |
parent | 7c2c347c7735d3ea96e4a101e6278d68ebff0b5e (diff) |
lib9p: idl.gen: Track min and max object sizes
-rwxr-xr-x | lib9p/idl.gen | 43 | ||||
-rw-r--r-- | lib9p/idl/__init__.py | 89 | ||||
-rw-r--r-- | lib9p/include/lib9p/9p.generated.h | 106 |
3 files changed, 231 insertions, 7 deletions
diff --git a/lib9p/idl.gen b/lib9p/idl.gen index 05d78be..f9db2d5 100755 --- a/lib9p/idl.gen +++ b/lib9p/idl.gen @@ -23,6 +23,9 @@ import idl idprefix = "lib9p_" +u32max = (1 << 32) - 1 +u64max = (1 << 64) - 1 + def tab_ljust(s: str, width: int) -> str: cur = len(s.expandtabs(tabsize=8)) @@ -222,9 +225,43 @@ enum {idprefix}version {{ ret += """ /* payload types **************************************************************/ """ + + def per_version_comment( + typ: idl.Type, fn: typing.Callable[[idl.Type, str], str] + ) -> str: + lines: dict[str, str] = {} + for version in sorted(typ.in_versions): + lines[version] = fn(typ, version) + if len(set(lines.values())) == 1: + for _, line in lines.items(): + return f"/* {line} */\n" + assert False + else: + ret = "" + v_width = max(len(c_ver_enum(v)) for v in typ.in_versions) + for version, line in lines.items(): + ret += f"/* {c_ver_enum(version).ljust(v_width)}: {line} */\n" + return ret + for typ in topo_sorted(typs): ret += "\n" ret += ifdef_push(1, c_ver_ifdef(typ.in_versions)) + + def sum_size(typ: idl.Type, version: str) -> str: + min_size = typ.min_size(version) + max_size = typ.max_size(version) + assert min_size <= max_size and max_size < u64max + ret = "" + if min_size == max_size: + ret += f"size = {min_size:,}" + else: + ret += f"min_size = {min_size:,} ; max_size = {max_size:,}" + if max_size > u32max: + ret += " (warning: >UINT32_MAX)" + return ret + + ret += per_version_comment(typ, sum_size) + match typ: case idl.Number(): ret += f"typedef {c_typename(typ.prim)} {c_typename(typ)};\n" @@ -618,8 +655,8 @@ LM_ALWAYS_INLINE static void unmarshal_8(struct _unmarshal_ctx *ctx, uint64_t *o ret += "{\n" ret += prefix ret += f"out->{member.name} = ctx->extra;\n" - ret += f"{prefix}ctx->extra += sizeof(out->{member.name}[0]) * out->{member.cnt};\n" - ret += f"{prefix}for (typeof(out->{member.cnt}) i = 0; i < out->{member.cnt}; i++)\n" + ret += f"{prefix}ctx->extra += sizeof(out->{member.name}[0]) * out->{member.cnt.name};\n" + ret += f"{prefix}for (typeof(out->{member.cnt.name}) i = 0; i < out->{member.cnt.name}; i++)\n" if typ.name in ["d", "s"]: # SPECIAL # Special-case is that we cast from `char` to `uint8_t`. ret += f"{prefix}\tunmarshal_{member.typ.name}(ctx, (uint8_t *)&out->{member.name}[i]);\n" @@ -721,7 +758,7 @@ LM_ALWAYS_INLINE static bool marshal_8(struct _marshal_ctx *ctx, uint64_t *val) ret += f"({{ _{member.name}_offset = ctx->net_offset; " if member.cnt: ret += "({ bool err = false;\n" - ret += f"\t for (typeof(val->{member.cnt}) i = 0; i < val->{member.cnt} && !err; i++)\n" + ret += f"\t for (typeof(val->{member.cnt.name}) i = 0; i < val->{member.cnt.name} && !err; i++)\n" ret += "\t \terr = " if typ.name in ["d", "s"]: # SPECIAL # Special-case is that we cast from `char` to `uint8_t`. diff --git a/lib9p/idl/__init__.py b/lib9p/idl/__init__.py index ab45ed0..8fd7e25 100644 --- a/lib9p/idl/__init__.py +++ b/lib9p/idl/__init__.py @@ -43,6 +43,12 @@ class Primitive(enum.Enum): def static_size(self) -> int: return self.value + def min_size(self, version: str) -> int: + return self.value + + def max_size(self, version: str) -> int: + return self.value + class Number: name: str @@ -60,6 +66,12 @@ class Number: def static_size(self) -> int: return self.prim.static_size + def min_size(self, version: str) -> int: + return self.static_size + + def max_size(self, version: str) -> int: + return self.static_size + class BitfieldVal: name: str @@ -88,6 +100,12 @@ class Bitfield: def static_size(self) -> int: return self.prim.static_size + def min_size(self, version: str) -> int: + return self.static_size + + def max_size(self, version: str) -> int: + return self.static_size + def bit_is_valid(self, bit: str | int, ver: str | None = None) -> bool: """Return whether the given bit is valid in the given protocol version. @@ -137,7 +155,7 @@ class Expr: class StructMember: # from left-to-right when parsing - cnt: str | None = None + cnt: "StructMember | None" = None name: str typ: "Type" max: Expr @@ -146,11 +164,58 @@ class StructMember: in_versions: set[str] @property + def min_cnt(self) -> int: + assert self.cnt + if not isinstance(self.cnt.typ, Primitive): + raise ValueError( + f"list count must be an integer type: {repr(self.cnt.name)}" + ) + if self.cnt.val: # TODO: allow this? + raise ValueError(f"list count may not have ,val=: {repr(self.cnt.name)}") + return 0 + + @property + def max_cnt(self) -> int: + assert self.cnt + if not isinstance(self.cnt.typ, Primitive): + raise ValueError( + f"list count must be an integer type: {repr(self.cnt.name)}" + ) + if self.cnt.val: # TODO: allow this? + raise ValueError(f"list count may not have ,val=: {repr(self.cnt.name)}") + if self.cnt.max: + # TODO: be more flexible? + if len(self.cnt.max.tokens) != 1: + raise ValueError( + f"list count ,max= may only have 1 token: {repr(self.cnt.name)}" + ) + match tok := self.cnt.max.tokens[0]: + case ExprLit(): + return tok.val + case ExprSym(name="s32_max"): + return (1 << 31) - 1 + case ExprSym(name="s64_max"): + return (1 << 63) - 1 + case _: + raise ValueError( + f'list count ,max= only allows literal, "s32_max", and "s64_max" tokens: {repr(self.cnt.name)}' + ) + return (1 << (self.cnt.typ.value * 8)) - 1 + + @property def static_size(self) -> int | None: if self.cnt: return None return self.typ.static_size + def min_size(self, version: str) -> int: + cnt = self.min_cnt if self.cnt else 1 + return cnt * self.typ.min_size(version) + + def max_size(self, version: str) -> int: + cnt = self.max_cnt if self.cnt else 1 + return cnt * self.typ.max_size(version) + class Struct: name: str @@ -165,12 +230,28 @@ class Struct: def static_size(self) -> int | None: size = 0 for member in self.members: + if member.in_versions < self.in_versions: + return None msize = member.static_size if msize is None: return None size += msize return size + def min_size(self, version: str) -> int: + return sum( + member.min_size(version) + for member in self.members + if (version in member.in_versions) + ) + + def max_size(self, version: str) -> int: + return sum( + member.max_size(version) + for member in self.members + if (version in member.in_versions) + ) + class Message(Struct): @property @@ -289,9 +370,9 @@ def parse_members(ver: str, env: dict[str, Type], struct: Struct, specs: str) -> if cnt := m.group("cnt"): if len(struct.members) == 0 or struct.members[-1].name != cnt: raise ValueError(f"list count must be previous item: {repr(cnt)}") - if not isinstance(struct.members[-1].typ, Primitive): - raise ValueError(f"list count must be an integer type: {repr(cnt)}") - member.cnt = cnt + cnt_mem = struct.members[-1] + member.cnt = cnt_mem + _ = member.max_cnt # force validation if maxstr := m.group("max"): if (not isinstance(member.typ, Primitive)) or member.cnt: diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h index da4a578..b5e0647 100644 --- a/lib9p/include/lib9p/9p.generated.h +++ b/lib9p/include/lib9p/9p.generated.h @@ -144,14 +144,17 @@ enum lib9p_msg_type { /* uint8_t */ /* payload types **************************************************************/ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 2 */ typedef uint16_t lib9p_tag_t; #define LIB9P_TAG_NOTAG ((lib9p_tag_t)UINT16_C(~0)) +/* size = 4 */ typedef uint32_t lib9p_fid_t; #define LIB9P_FID_NOFID ((lib9p_fid_t)UINT32_C(~0)) #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* min_size = 4 ; max_size = 2,147,483,651 */ struct lib9p_d { uint32_t len; [[gnu::nonstring]] char *dat; @@ -159,6 +162,7 @@ struct lib9p_d { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* min_size = 2 ; max_size = 65,537 */ struct lib9p_s { uint16_t len; [[gnu::nonstring]] char *utf8; @@ -166,6 +170,7 @@ struct lib9p_s { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 4 */ typedef uint32_t lib9p_dm_t; #define LIB9P_DM_DIR ((lib9p_dm_t)(1<<31)) @@ -209,6 +214,7 @@ typedef uint32_t lib9p_dm_t; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 1 */ typedef uint8_t lib9p_qt_t; #define LIB9P_QT_DIR ((lib9p_qt_t)(1<<7)) @@ -226,11 +232,13 @@ typedef uint8_t lib9p_qt_t; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u +/* size = 4 */ typedef uint32_t lib9p_nuid_t; #define LIB9P_NUID_NONUID ((lib9p_nuid_t)UINT32_C(~0)) #endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 1 */ typedef uint8_t lib9p_o_t; /* unused ((lib9p_o_t)(1<<7)) */ @@ -251,6 +259,7 @@ typedef uint8_t lib9p_o_t; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L +/* size = 8 */ typedef uint64_t lib9p_getattr_t; /* unused ((lib9p_getattr_t)(1<<63)) */ @@ -321,6 +330,7 @@ typedef uint64_t lib9p_getattr_t; #define LIB9P_GETATTR_BASIC ((lib9p_getattr_t)(0x000007ff)) #define LIB9P_GETATTR_ALL ((lib9p_getattr_t)(0x00003fff)) +/* size = 4 */ typedef uint32_t lib9p_setattr_t; /* unused ((lib9p_setattr_t)(1<<31)) */ @@ -357,11 +367,13 @@ typedef uint32_t lib9p_setattr_t; #define LIB9P_SETATTR_MODE ((lib9p_setattr_t)(1<<0)) +/* size = 1 */ typedef uint8_t lib9p_lock_type_t; #define LIB9P_LOCK_TYPE_RDLCK ((lib9p_lock_type_t)UINT8_C(0)) #define LIB9P_LOCK_TYPE_WRLCK ((lib9p_lock_type_t)UINT8_C(1)) #define LIB9P_LOCK_TYPE_UNLCK ((lib9p_lock_type_t)UINT8_C(2)) +/* size = 4 */ typedef uint32_t lib9p_lock_flags_t; /* unused ((lib9p_lock_flags_t)(1<<31)) */ @@ -398,6 +410,7 @@ typedef uint32_t lib9p_lock_flags_t; #define LIB9P_LOCK_FLAGS_BLOCK ((lib9p_lock_flags_t)(1<<0)) +/* size = 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)) @@ -406,15 +419,18 @@ typedef uint8_t lib9p_lock_status_t; #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 9 */ struct lib9p_msg_Tflush { lib9p_tag_t tag; uint16_t oldtag; }; +/* size = 7 */ struct lib9p_msg_Rflush { lib9p_tag_t tag; }; +/* size = 11 */ struct lib9p_msg_Rwrite { lib9p_tag_t tag; uint32_t count; @@ -422,29 +438,34 @@ struct lib9p_msg_Rwrite { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 7 */ struct lib9p_msg_Rclunk { lib9p_tag_t tag; }; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 7 */ struct lib9p_msg_Rremove { lib9p_tag_t tag; }; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 7 */ struct lib9p_msg_Rwstat { lib9p_tag_t tag; }; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L +/* size = 11 */ struct lib9p_msg_Rlerror { lib9p_tag_t tag; uint32_t ecode; }; +/* size = 67 */ struct lib9p_msg_Rstatfs { lib9p_tag_t tag; uint32_t type; @@ -458,56 +479,68 @@ struct lib9p_msg_Rstatfs { uint32_t namelen; }; +/* size = 7 */ struct lib9p_msg_Rrename { lib9p_tag_t tag; }; +/* size = 7 */ struct lib9p_msg_Rsetattr { lib9p_tag_t tag; }; +/* size = 15 */ struct lib9p_msg_Rxattrwalk { lib9p_tag_t tag; uint64_t attr_size; }; +/* size = 7 */ struct lib9p_msg_Rxattrcreate { lib9p_tag_t tag; }; +/* min_size = 11 ; max_size = 4,294,967,306 (warning: >UINT32_MAX) */ struct lib9p_msg_Rreaddir { lib9p_tag_t tag; uint32_t count; uint8_t *data; }; +/* size = 7 */ struct lib9p_msg_Rfsync { lib9p_tag_t tag; }; +/* size = 7 */ struct lib9p_msg_Rlink { lib9p_tag_t tag; }; +/* size = 7 */ struct lib9p_msg_Rrenameat { lib9p_tag_t tag; }; +/* size = 7 */ struct lib9p_msg_Runlinkat { lib9p_tag_t tag; }; #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000_e +/* size = 15 */ struct lib9p_msg_Tsession { lib9p_tag_t tag; uint64_t key; }; +/* size = 7 */ struct lib9p_msg_Rsession { lib9p_tag_t tag; }; +/* size = 11 */ struct lib9p_msg_Rswrite { lib9p_tag_t tag; uint32_t count; @@ -515,6 +548,7 @@ struct lib9p_msg_Rswrite { #endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 23 */ struct lib9p_msg_Tread { lib9p_tag_t tag; lib9p_fid_t fid; @@ -522,11 +556,13 @@ struct lib9p_msg_Tread { uint32_t count; }; +/* size = 11 */ struct lib9p_msg_Tclunk { lib9p_tag_t tag; lib9p_fid_t fid; }; +/* size = 11 */ struct lib9p_msg_Tremove { lib9p_tag_t tag; lib9p_fid_t fid; @@ -534,6 +570,7 @@ struct lib9p_msg_Tremove { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 11 */ struct lib9p_msg_Tstat { lib9p_tag_t tag; lib9p_fid_t fid; @@ -541,22 +578,26 @@ struct lib9p_msg_Tstat { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L +/* size = 11 */ struct lib9p_msg_Tstatfs { lib9p_tag_t tag; lib9p_fid_t fid; }; +/* size = 15 */ struct lib9p_msg_Tlopen { lib9p_tag_t tag; lib9p_fid_t fid; uint32_t flags; }; +/* size = 11 */ struct lib9p_msg_Treadlink { lib9p_tag_t tag; lib9p_fid_t fid; }; +/* size = 23 */ struct lib9p_msg_Treaddir { lib9p_tag_t tag; lib9p_fid_t fid; @@ -564,6 +605,7 @@ struct lib9p_msg_Treaddir { uint32_t count; }; +/* size = 15 */ struct lib9p_msg_Tfsync { lib9p_tag_t tag; lib9p_fid_t fid; @@ -572,11 +614,19 @@ struct lib9p_msg_Tfsync { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* LIB9P_VER_9P2000 : min_size = 11 ; max_size = 2,147,483,658 */ +/* LIB9P_VER_9P2000_L: size = 7 */ +/* LIB9P_VER_9P2000_e: min_size = 11 ; max_size = 2,147,483,658 */ +/* LIB9P_VER_9P2000_u: min_size = 11 ; max_size = 2,147,483,658 */ struct lib9p_msg_Rread { lib9p_tag_t tag; struct lib9p_d data; }; +/* LIB9P_VER_9P2000 : min_size = 23 ; max_size = 2,147,483,670 */ +/* LIB9P_VER_9P2000_L: size = 19 */ +/* LIB9P_VER_9P2000_e: min_size = 23 ; max_size = 2,147,483,670 */ +/* LIB9P_VER_9P2000_u: min_size = 23 ; max_size = 2,147,483,670 */ struct lib9p_msg_Twrite { lib9p_tag_t tag; lib9p_fid_t fid; @@ -586,6 +636,7 @@ struct lib9p_msg_Twrite { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_e +/* min_size = 11 ; max_size = 2,147,483,658 */ struct lib9p_msg_Rsread { lib9p_tag_t tag; struct lib9p_d data; @@ -593,12 +644,14 @@ struct lib9p_msg_Rsread { #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_u +/* min_size = 13 ; max_size = 65,548 */ struct lib9p_msg_Tversion { lib9p_tag_t tag; uint32_t max_msg_size; struct lib9p_s version; }; +/* min_size = 13 ; max_size = 65,548 */ struct lib9p_msg_Rversion { lib9p_tag_t tag; uint32_t max_msg_size; @@ -607,6 +660,9 @@ struct lib9p_msg_Rversion { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* LIB9P_VER_9P2000 : min_size = 9 ; max_size = 65,544 */ +/* LIB9P_VER_9P2000_e: min_size = 9 ; max_size = 65,544 */ +/* LIB9P_VER_9P2000_u: min_size = 13 ; max_size = 65,548 */ struct lib9p_msg_Rerror { lib9p_tag_t tag; struct lib9p_s ename; @@ -617,6 +673,7 @@ struct lib9p_msg_Rerror { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* min_size = 17 ; max_size = 1,048,609 */ struct lib9p_msg_Twalk { lib9p_tag_t tag; lib9p_fid_t fid; @@ -627,6 +684,7 @@ struct lib9p_msg_Twalk { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L +/* min_size = 17 ; max_size = 65,552 */ struct lib9p_msg_Trename { lib9p_tag_t tag; lib9p_fid_t fid; @@ -634,11 +692,13 @@ struct lib9p_msg_Trename { struct lib9p_s name; }; +/* min_size = 9 ; max_size = 65,544 */ struct lib9p_msg_Rreadlink { lib9p_tag_t tag; struct lib9p_s target; }; +/* min_size = 17 ; max_size = 65,552 */ struct lib9p_msg_Txattrwalk { lib9p_tag_t tag; lib9p_fid_t fid; @@ -646,6 +706,7 @@ struct lib9p_msg_Txattrwalk { struct lib9p_s name; }; +/* min_size = 25 ; max_size = 65,560 */ struct lib9p_msg_Txattrcreate { lib9p_tag_t tag; lib9p_fid_t fid; @@ -654,6 +715,7 @@ struct lib9p_msg_Txattrcreate { uint32_t flags; }; +/* min_size = 34 ; max_size = 65,569 */ struct lib9p_msg_Tgetlock { lib9p_tag_t tag; lib9p_fid_t fid; @@ -664,6 +726,7 @@ struct lib9p_msg_Tgetlock { struct lib9p_s client_id; }; +/* min_size = 30 ; max_size = 65,565 */ struct lib9p_msg_Rgetlock { lib9p_tag_t tag; uint8_t type; @@ -673,6 +736,7 @@ struct lib9p_msg_Rgetlock { struct lib9p_s client_id; }; +/* min_size = 17 ; max_size = 65,552 */ struct lib9p_msg_Tlink { lib9p_tag_t tag; lib9p_fid_t dfid; @@ -680,6 +744,7 @@ struct lib9p_msg_Tlink { struct lib9p_s name; }; +/* min_size = 19 ; max_size = 131,089 */ struct lib9p_msg_Trenameat { lib9p_tag_t tag; lib9p_fid_t olddirfid; @@ -688,6 +753,7 @@ struct lib9p_msg_Trenameat { struct lib9p_s newname; }; +/* min_size = 17 ; max_size = 65,552 */ struct lib9p_msg_Tunlinkat { lib9p_tag_t tag; lib9p_fid_t dirfd; @@ -697,6 +763,7 @@ struct lib9p_msg_Tunlinkat { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000_e +/* min_size = 13 ; max_size = 4,294,967,308 (warning: >UINT32_MAX) */ struct lib9p_msg_Tsread { lib9p_tag_t tag; uint32_t fid; @@ -704,6 +771,7 @@ struct lib9p_msg_Tsread { struct lib9p_s *wname; }; +/* min_size = 17 ; max_size = 6,442,450,959 (warning: >UINT32_MAX) */ struct lib9p_msg_Tswrite { lib9p_tag_t tag; uint32_t fid; @@ -714,12 +782,17 @@ struct lib9p_msg_Tswrite { #endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 13 */ struct lib9p_qid { lib9p_qt_t type; uint32_t vers; uint64_t path; }; +/* LIB9P_VER_9P2000 : min_size = 15 ; max_size = 131,085 */ +/* LIB9P_VER_9P2000_L: min_size = 19 ; max_size = 131,089 */ +/* LIB9P_VER_9P2000_e: min_size = 15 ; max_size = 131,085 */ +/* LIB9P_VER_9P2000_u: min_size = 19 ; max_size = 131,089 */ struct lib9p_msg_Tauth { lib9p_tag_t tag; lib9p_fid_t afid; @@ -730,6 +803,10 @@ struct lib9p_msg_Tauth { #endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */ }; +/* LIB9P_VER_9P2000 : min_size = 19 ; max_size = 131,089 */ +/* LIB9P_VER_9P2000_L: min_size = 23 ; max_size = 131,093 */ +/* LIB9P_VER_9P2000_e: min_size = 19 ; max_size = 131,089 */ +/* LIB9P_VER_9P2000_u: min_size = 23 ; max_size = 131,093 */ struct lib9p_msg_Tattach { lib9p_tag_t tag; lib9p_fid_t fid; @@ -743,6 +820,7 @@ struct lib9p_msg_Tattach { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L +/* min_size = 25 ; max_size = 65,560 */ struct lib9p_msg_Tlcreate { lib9p_tag_t tag; lib9p_fid_t fid; @@ -752,6 +830,7 @@ struct lib9p_msg_Tlcreate { lib9p_nuid_t gid; }; +/* min_size = 19 ; max_size = 131,089 */ struct lib9p_msg_Tsymlink { lib9p_tag_t tag; lib9p_fid_t fid; @@ -760,6 +839,7 @@ struct lib9p_msg_Tsymlink { lib9p_nuid_t gid; }; +/* min_size = 29 ; max_size = 65,564 */ struct lib9p_msg_Tmknod { lib9p_tag_t tag; lib9p_fid_t dfid; @@ -772,12 +852,14 @@ struct lib9p_msg_Tmknod { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 12 */ struct lib9p_msg_Topen { lib9p_tag_t tag; lib9p_fid_t fid; lib9p_o_t mode; }; +/* min_size = 18 ; max_size = 65,553 */ struct lib9p_msg_Tcreate { lib9p_tag_t tag; lib9p_fid_t fid; @@ -788,12 +870,14 @@ struct lib9p_msg_Tcreate { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L +/* size = 19 */ struct lib9p_msg_Tgetattr { lib9p_tag_t tag; lib9p_fid_t fid; lib9p_getattr_t request_mask; }; +/* size = 67 */ struct lib9p_msg_Tsetattr { lib9p_tag_t tag; lib9p_fid_t fid; @@ -808,6 +892,7 @@ struct lib9p_msg_Tsetattr { uint64_t mtime_nsec; }; +/* min_size = 38 ; max_size = 65,573 */ struct lib9p_msg_Tlock { lib9p_tag_t tag; lib9p_fid_t fid; @@ -819,6 +904,7 @@ struct lib9p_msg_Tlock { struct lib9p_s client_id; }; +/* size = 8 */ struct lib9p_msg_Rlock { lib9p_tag_t tag; lib9p_lock_status_t status; @@ -826,6 +912,9 @@ struct lib9p_msg_Rlock { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* LIB9P_VER_9P2000 : min_size = 49 ; max_size = 262,189 */ +/* LIB9P_VER_9P2000_e: min_size = 49 ; max_size = 262,189 */ +/* LIB9P_VER_9P2000_u: min_size = 63 ; max_size = 327,738 */ struct lib9p_stat { uint16_t kern_type; uint32_t kern_dev; @@ -848,16 +937,19 @@ struct lib9p_stat { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 20 */ struct lib9p_msg_Rauth { lib9p_tag_t tag; struct lib9p_qid aqid; }; +/* size = 20 */ struct lib9p_msg_Rattach { lib9p_tag_t tag; struct lib9p_qid qid; }; +/* min_size = 9 ; max_size = 217 */ struct lib9p_msg_Rwalk { lib9p_tag_t tag; uint16_t nwqid; @@ -866,12 +958,14 @@ struct lib9p_msg_Rwalk { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* size = 24 */ struct lib9p_msg_Ropen { lib9p_tag_t tag; struct lib9p_qid qid; uint32_t iounit; }; +/* size = 24 */ struct lib9p_msg_Rcreate { lib9p_tag_t tag; struct lib9p_qid qid; @@ -880,28 +974,33 @@ struct lib9p_msg_Rcreate { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L +/* size = 24 */ struct lib9p_msg_Rlopen { lib9p_tag_t tag; struct lib9p_qid qid; uint32_t iounit; }; +/* size = 24 */ struct lib9p_msg_Rlcreate { lib9p_tag_t tag; struct lib9p_qid qid; uint32_t iounit; }; +/* size = 20 */ struct lib9p_msg_Rsymlink { lib9p_tag_t tag; struct lib9p_qid qid; }; +/* size = 20 */ struct lib9p_msg_Rmknod { lib9p_tag_t tag; struct lib9p_qid qid; }; +/* size = 160 */ struct lib9p_msg_Rgetattr { lib9p_tag_t tag; uint64_t valid; @@ -926,6 +1025,7 @@ struct lib9p_msg_Rgetattr { uint64_t data_version; }; +/* size = 20 */ struct lib9p_msg_Tmkdir { lib9p_tag_t tag; struct lib9p_qid qid; @@ -933,11 +1033,17 @@ struct lib9p_msg_Tmkdir { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_u +/* LIB9P_VER_9P2000 : min_size = 58 ; max_size = 262,198 */ +/* LIB9P_VER_9P2000_e: min_size = 58 ; max_size = 262,198 */ +/* LIB9P_VER_9P2000_u: min_size = 72 ; max_size = 327,747 */ struct lib9p_msg_Rstat { lib9p_tag_t tag; struct lib9p_stat stat; }; +/* LIB9P_VER_9P2000 : min_size = 62 ; max_size = 262,202 */ +/* LIB9P_VER_9P2000_e: min_size = 62 ; max_size = 262,202 */ +/* LIB9P_VER_9P2000_u: min_size = 76 ; max_size = 327,751 */ struct lib9p_msg_Twstat { lib9p_tag_t tag; lib9p_fid_t fid; |