summaryrefslogtreecommitdiff
path: root/lib9p/9p.generated.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/9p.generated.c')
-rw-r--r--lib9p/9p.generated.c121
1 files changed, 96 insertions, 25 deletions
diff --git a/lib9p/9p.generated.c b/lib9p/9p.generated.c
index b58a485..914a612 100644
--- a/lib9p/9p.generated.c
+++ b/lib9p/9p.generated.c
@@ -37,7 +37,11 @@ LO_IMPLEMENTATION_C(fmt_formatter, struct lib9p_msg_Tauth, lib9p_msg_Tauth, stat
LO_IMPLEMENTATION_C(fmt_formatter, struct lib9p_msg_Rauth, lib9p_msg_Rauth, static);
LO_IMPLEMENTATION_C(fmt_formatter, struct lib9p_msg_Tattach, lib9p_msg_Tattach, static);
LO_IMPLEMENTATION_C(fmt_formatter, struct lib9p_msg_Rattach, lib9p_msg_Rattach, static);
+#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
LO_IMPLEMENTATION_C(fmt_formatter, struct lib9p_msg_Rerror, lib9p_msg_Rerror, static);
+#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
LO_IMPLEMENTATION_C(fmt_formatter, struct lib9p_msg_Tflush, lib9p_msg_Tflush, static);
LO_IMPLEMENTATION_C(fmt_formatter, struct lib9p_msg_Rflush, lib9p_msg_Rflush, static);
LO_IMPLEMENTATION_C(fmt_formatter, struct lib9p_msg_Twalk, lib9p_msg_Twalk, static);
@@ -507,6 +511,8 @@ static ssize_t validate_Rattach(struct lib9p_ctx *ctx, uint32_t net_size, uint8_
return (ssize_t)host_size;
}
+#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
static ssize_t validate_Rerror(struct lib9p_ctx *ctx, uint32_t net_size, uint8_t *net_bytes) {
uint32_t net_offset = 0;
ssize_t host_size = sizeof(struct lib9p_msg_Rerror);
@@ -529,6 +535,8 @@ static ssize_t validate_Rerror(struct lib9p_ctx *ctx, uint32_t net_size, uint8_t
return (ssize_t)host_size;
}
+#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
static ssize_t validate_Tflush(struct lib9p_ctx *ctx, uint32_t net_size, uint8_t *net_bytes) {
uint32_t net_offset = 0;
ssize_t host_size = sizeof(struct lib9p_msg_Tflush);
@@ -2012,6 +2020,8 @@ static void unmarshal_Rattach([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne
UNMARSHAL_U64LE(ctx, out->qid.path);
}
+#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
static void unmarshal_Rerror([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) {
struct lib9p_msg_Rerror *out = out_buf;
[[gnu::unused]] void *extra = &out[1];
@@ -2019,15 +2029,17 @@ static void unmarshal_Rerror([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net
net_offset += 4;
net_offset += 1;
UNMARSHAL_U16LE(ctx, out->tag);
- UNMARSHAL_U16LE(ctx, out->ename.len);
- UNMARSHAL_BYTES(ctx, out->ename.utf8, out->ename.len);
+ UNMARSHAL_U16LE(ctx, out->errstr.len);
+ UNMARSHAL_BYTES(ctx, out->errstr.utf8, out->errstr.len);
#if CONFIG_9P_ENABLE_9P2000_u
if (is_ver(ctx, 9P2000_u)) {
- UNMARSHAL_U32LE(ctx, out->errno);
+ UNMARSHAL_U32LE(ctx, out->errnum);
}
#endif /* CONFIG_9P_ENABLE_9P2000_u */
}
+#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
static void unmarshal_Tflush([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) {
struct lib9p_msg_Tflush *out = out_buf;
[[gnu::unused]] void *extra = &out[1];
@@ -2353,7 +2365,7 @@ static void unmarshal_Rlerror([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *ne
net_offset += 4;
net_offset += 1;
UNMARSHAL_U16LE(ctx, out->tag);
- UNMARSHAL_U32LE(ctx, out->ecode);
+ UNMARSHAL_U32LE(ctx, out->errnum);
}
static void unmarshal_Tstatfs([[gnu::unused]] struct lib9p_ctx *ctx, uint8_t *net_bytes, void *out_buf) {
@@ -3153,8 +3165,10 @@ static bool marshal_Rattach(struct lib9p_ctx *ctx, struct lib9p_msg_Rattach *val
return false;
}
+#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
static bool marshal_Rerror(struct lib9p_ctx *ctx, struct lib9p_msg_Rerror *val, struct _marshal_ret *ret) {
- uint32_t needed_size = 9 + val->ename.len;
+ uint32_t needed_size = 9 + val->errstr.len;
#if CONFIG_9P_ENABLE_9P2000_u
if is_ver(ctx, 9P2000_u) {
needed_size += 4;
@@ -3172,16 +3186,18 @@ static bool marshal_Rerror(struct lib9p_ctx *ctx, struct lib9p_msg_Rerror *val,
MARSHAL_U32LE(ctx, offsetof_end - offsetof_size);
MARSHAL_U8LE(ctx, 107);
MARSHAL_U16LE(ctx, val->tag);
- MARSHAL_U16LE(ctx, val->ename.len);
- MARSHAL_BYTES_ZEROCOPY(ctx, val->ename.utf8, val->ename.len);
+ MARSHAL_U16LE(ctx, val->errstr.len);
+ MARSHAL_BYTES_ZEROCOPY(ctx, val->errstr.utf8, val->errstr.len);
#if CONFIG_9P_ENABLE_9P2000_u
if (is_ver(ctx, 9P2000_u)) {
- MARSHAL_U32LE(ctx, val->errno);
+ MARSHAL_U32LE(ctx, val->errnum);
}
#endif /* CONFIG_9P_ENABLE_9P2000_u */
return false;
}
+#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
static bool marshal_Tflush(struct lib9p_ctx *ctx, struct lib9p_msg_Tflush *val, struct _marshal_ret *ret) {
uint32_t needed_size = 9;
if (needed_size > ctx->max_msg_size) {
@@ -3715,7 +3731,7 @@ static bool marshal_Rlerror(struct lib9p_ctx *ctx, struct lib9p_msg_Rlerror *val
MARSHAL_U32LE(ctx, offsetof_end - offsetof_size);
MARSHAL_U8LE(ctx, 7);
MARSHAL_U16LE(ctx, val->tag);
- MARSHAL_U32LE(ctx, val->ecode);
+ MARSHAL_U32LE(ctx, val->errnum);
return false;
}
@@ -4665,7 +4681,6 @@ static void lib9p_fid_format(lib9p_fid_t *self, struct fmt_state *state) {
}
static void lib9p_s_format(struct lib9p_s *self, struct fmt_state *state) {
- /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47781 */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
#pragma GCC diagnostic ignored "-Wformat-extra-args"
@@ -5137,19 +5152,23 @@ static void lib9p_msg_Rattach_format(struct lib9p_msg_Rattach *self, struct fmt_
fmt_state_puts(state, " }");
}
+#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
static void lib9p_msg_Rerror_format(struct lib9p_msg_Rerror *self, struct fmt_state *state) {
fmt_state_puts(state, "Rerror {");
fmt_state_puts(state, " tag=");
lib9p_tag_format(&self->tag, state);
- fmt_state_puts(state, " ename=");
- lib9p_s_format(&self->ename, state);
+ fmt_state_puts(state, " errstr=");
+ lib9p_s_format(&self->errstr, state);
#if CONFIG_9P_ENABLE_9P2000_u
- fmt_state_puts(state, " errno=");
- lib9p_errno_format(&self->errno, state);
+ fmt_state_puts(state, " errnum=");
+ lib9p_errno_format(&self->errnum, state);
#endif /* CONFIG_9P_ENABLE_9P2000_u */
fmt_state_puts(state, " }");
}
+#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
static void lib9p_msg_Tflush_format(struct lib9p_msg_Tflush *self, struct fmt_state *state) {
fmt_state_puts(state, "Tflush {");
fmt_state_puts(state, " tag=");
@@ -5273,7 +5292,18 @@ static void lib9p_msg_Rread_format(struct lib9p_msg_Rread *self, struct fmt_stat
lib9p_tag_format(&self->tag, state);
fmt_state_puts(state, " count=");
fmt_state_printf(state, "%"PRIu32, self->count);
- fmt_state_puts(state, " data=<bytedata>");
+ if (is_valid_utf8_without_nul((uint8_t *)self->data, (size_t)self->count)) {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wformat-extra-args"
+ fmt_state_printf(state, " data=%.*q%s",
+ (int)(self->count < 50 ? self->count : 50),
+ (char *)self->data,
+ self->count < 50 ? "" : "...");
+#pragma GCC diagnostic pop
+ } else {
+ fmt_state_puts(state, " data=<bytedata>");
+ }
fmt_state_puts(state, " }");
}
@@ -5287,7 +5317,18 @@ static void lib9p_msg_Twrite_format(struct lib9p_msg_Twrite *self, struct fmt_st
fmt_state_printf(state, "%"PRIu64, self->offset);
fmt_state_puts(state, " count=");
fmt_state_printf(state, "%"PRIu32, self->count);
- fmt_state_puts(state, " data=<bytedata>");
+ if (is_valid_utf8_without_nul((uint8_t *)self->data, (size_t)self->count)) {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wformat-extra-args"
+ fmt_state_printf(state, " data=%.*q%s",
+ (int)(self->count < 50 ? self->count : 50),
+ (char *)self->data,
+ self->count < 50 ? "" : "...");
+#pragma GCC diagnostic pop
+ } else {
+ fmt_state_puts(state, " data=<bytedata>");
+ }
fmt_state_puts(state, " }");
}
@@ -6752,8 +6793,8 @@ static void lib9p_msg_Rlerror_format(struct lib9p_msg_Rlerror *self, struct fmt_
fmt_state_puts(state, "Rlerror {");
fmt_state_puts(state, " tag=");
lib9p_tag_format(&self->tag, state);
- fmt_state_puts(state, " ecode=");
- lib9p_errno_format(&self->ecode, state);
+ fmt_state_puts(state, " errnum=");
+ lib9p_errno_format(&self->errnum, state);
fmt_state_puts(state, " }");
}
@@ -7086,7 +7127,18 @@ static void lib9p_msg_Rreaddir_format(struct lib9p_msg_Rreaddir *self, struct fm
lib9p_tag_format(&self->tag, state);
fmt_state_puts(state, " count=");
fmt_state_printf(state, "%"PRIu32, self->count);
- fmt_state_puts(state, " data=<bytedata>");
+ if (is_valid_utf8_without_nul((uint8_t *)self->data, (size_t)self->count)) {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wformat-extra-args"
+ fmt_state_printf(state, " data=%.*q%s",
+ (int)(self->count < 50 ? self->count : 50),
+ (char *)self->data,
+ self->count < 50 ? "" : "...");
+#pragma GCC diagnostic pop
+ } else {
+ fmt_state_puts(state, " data=<bytedata>");
+ }
fmt_state_puts(state, " }");
}
@@ -7302,7 +7354,18 @@ static void lib9p_msg_Rsread_format(struct lib9p_msg_Rsread *self, struct fmt_st
lib9p_tag_format(&self->tag, state);
fmt_state_puts(state, " count=");
fmt_state_printf(state, "%"PRIu32, self->count);
- fmt_state_puts(state, " data=<bytedata>");
+ if (is_valid_utf8_without_nul((uint8_t *)self->data, (size_t)self->count)) {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wformat-extra-args"
+ fmt_state_printf(state, " data=%.*q%s",
+ (int)(self->count < 50 ? self->count : 50),
+ (char *)self->data,
+ self->count < 50 ? "" : "...");
+#pragma GCC diagnostic pop
+ } else {
+ fmt_state_puts(state, " data=<bytedata>");
+ }
fmt_state_puts(state, " }");
}
@@ -7323,7 +7386,18 @@ static void lib9p_msg_Tswrite_format(struct lib9p_msg_Tswrite *self, struct fmt_
fmt_state_puts(state, " ]");
fmt_state_puts(state, " count=");
fmt_state_printf(state, "%"PRIu32, self->count);
- fmt_state_puts(state, " data=<bytedata>");
+ if (is_valid_utf8_without_nul((uint8_t *)self->data, (size_t)self->count)) {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wformat-extra-args"
+ fmt_state_printf(state, " data=%.*q%s",
+ (int)(self->count < 50 ? self->count : 50),
+ (char *)self->data,
+ self->count < 50 ? "" : "...");
+#pragma GCC diagnostic pop
+ } else {
+ fmt_state_puts(state, " data=<bytedata>");
+ }
fmt_state_puts(state, " }");
}
@@ -7345,7 +7419,7 @@ const struct _lib9p_ver_tentry _lib9p_table_ver[LIB9P_VER_NUM] = {
[LIB9P_VER_9P2000] = {.name="9P2000", .min_msg_size=9},
#endif /* CONFIG_9P_ENABLE_9P2000 */
#if CONFIG_9P_ENABLE_9P2000_L
- [LIB9P_VER_9P2000_L] = {.name="9P2000.L", .min_msg_size=9},
+ [LIB9P_VER_9P2000_L] = {.name="9P2000.L", .min_msg_size=11},
#endif /* CONFIG_9P_ENABLE_9P2000_L */
#if CONFIG_9P_ENABLE_9P2000_e
[LIB9P_VER_9P2000_e] = {.name="9P2000.e", .min_msg_size=9},
@@ -7446,7 +7520,6 @@ const struct _lib9p_msg_tentry _lib9p_table_msg[LIB9P_VER_NUM][0x100] = {
_MSG(Rauth),
_MSG(Tattach),
_MSG(Rattach),
- _MSG(Rerror),
_MSG(Tflush),
_MSG(Rflush),
_MSG(Twalk),
@@ -7730,7 +7803,6 @@ const struct _lib9p_recv_tentry _lib9p_table_Rmsg_recv[LIB9P_VER_NUM][0x80] = {
_MSG_RECV(Rversion),
_MSG_RECV(Rauth),
_MSG_RECV(Rattach),
- _MSG_RECV(Rerror),
_MSG_RECV(Rflush),
_MSG_RECV(Rwalk),
_MSG_RECV(Rread),
@@ -7957,7 +8029,6 @@ const struct _lib9p_send_tentry _lib9p_table_Rmsg_send[LIB9P_VER_NUM][0x80] = {
_MSG_SEND(Rversion),
_MSG_SEND(Rauth),
_MSG_SEND(Rattach),
- _MSG_SEND(Rerror),
_MSG_SEND(Rflush),
_MSG_SEND(Rwalk),
_MSG_SEND(Rread),