/* Generated by `./lib9p/types.gen lib9p/9P2000.txt lib9p/9P2000.u.txt lib9p/9P2000.e.txt`. DO NOT EDIT! */ #include #include /* for size_t */ #include /* for PRI* macros */ #include /* for memset() */ #include #include "internal.h" /* checksize_* (internals of unmarshal_size()) ********************************/ static inline bool _checksize_net(struct _checksize_ctx *ctx, uint32_t n) { if (__builtin_add_overflow(ctx->net_offset, n, &ctx->net_offset)) /* If needed-net-size overflowed uint32_t, then * there's no way that actual-net-size will live up to * that. */ return lib9p_error(ctx->ctx, LINUX_EBADMSG, "message is too short for content"); if (ctx->net_offset > ctx->net_size) return lib9p_error(ctx->ctx, LINUX_EBADMSG, "message is too short for content"); return false; } static inline bool _checksize_host(struct _checksize_ctx *ctx, size_t n) { if (__builtin_add_overflow(ctx->host_extra, n, &ctx->host_extra)) /* If needed-host-size overflowed size_t, then there's * no way that actual-net-size will live up to * that. */ return lib9p_error(ctx->ctx, LINUX_EBADMSG, "message is too short for content"); return false; } static inline bool _checksize_list(struct _checksize_ctx *ctx, size_t cnt, _checksize_fn_t item_fn, size_t item_host_size) { for (size_t i = 0; i < cnt; i++) if (_checksize_host(ctx, item_host_size) || item_fn(ctx)) return true; return false; } #define checksize_1(ctx) _checksize_net(ctx, 1) #define checksize_2(ctx) _checksize_net(ctx, 2) #define checksize_4(ctx) _checksize_net(ctx, 4) #define checksize_8(ctx) _checksize_net(ctx, 8) static inline bool checksize_d(struct _checksize_ctx *ctx) { uint32_t base_offset = ctx->net_offset; if (checksize_4(ctx)) return true; uint32_t len = decode_u32le(&ctx->net_bytes[base_offset]); return _checksize_net(ctx, len) || _checksize_host(ctx, len); } static inline bool checksize_s(struct _checksize_ctx *ctx) { uint32_t base_offset = ctx->net_offset; if (checksize_2(ctx)) return true; uint16_t len = decode_u16le(&ctx->net_bytes[base_offset]); if (_checksize_net(ctx, len) || _checksize_host(ctx, ((size_t)len)+1)) return true; if (!is_valid_utf8_without_nul(&ctx->net_bytes[base_offset+2], len)) return lib9p_error(ctx->ctx, LINUX_EBADMSG, "message contains invalid UTF-8"); return false; } static inline bool checksize_qid(struct _checksize_ctx *ctx) { return checksize_1(ctx) || checksize_4(ctx) || checksize_8(ctx); } static inline bool checksize_stat(struct _checksize_ctx *ctx) { return checksize_2(ctx) || checksize_2(ctx) || checksize_4(ctx) || checksize_qid(ctx) || checksize_4(ctx) || checksize_4(ctx) || checksize_4(ctx) || checksize_8(ctx) || checksize_s(ctx) || checksize_s(ctx) || checksize_s(ctx) || checksize_s(ctx) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && checksize_s(ctx) ) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && checksize_4(ctx) ) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && checksize_4(ctx) ) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && checksize_4(ctx) ); } static bool checksize_Tversion(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_s(ctx); } static bool checksize_Rversion(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_s(ctx); } static bool checksize_Tauth(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_s(ctx) || checksize_s(ctx) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && checksize_4(ctx) ); } static bool checksize_Rauth(struct _checksize_ctx *ctx) { return checksize_qid(ctx); } static bool checksize_Tattach(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_4(ctx) || checksize_s(ctx) || checksize_s(ctx); } static bool checksize_Rattach(struct _checksize_ctx *ctx) { return checksize_qid(ctx); } static bool checksize_Rerror(struct _checksize_ctx *ctx) { return checksize_s(ctx) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && checksize_4(ctx) ); } static bool checksize_Tflush(struct _checksize_ctx *ctx) { return checksize_2(ctx); } static bool checksize_Rflush(struct _checksize_ctx *UNUSED(ctx)) { return false; } static bool checksize_Twalk(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_4(ctx) || checksize_2(ctx) || _checksize_list(ctx, decode_u16le(&ctx->net_bytes[ctx->net_offset-2]), checksize_s, sizeof(struct lib9p_s)); } static bool checksize_Rwalk(struct _checksize_ctx *ctx) { return checksize_2(ctx) || _checksize_list(ctx, decode_u16le(&ctx->net_bytes[ctx->net_offset-2]), checksize_qid, sizeof(struct lib9p_qid)); } static bool checksize_Topen(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_1(ctx); } static bool checksize_Ropen(struct _checksize_ctx *ctx) { return checksize_qid(ctx) || checksize_4(ctx); } static bool checksize_Tcreate(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_s(ctx) || checksize_4(ctx) || checksize_1(ctx); } static bool checksize_Rcreate(struct _checksize_ctx *ctx) { return checksize_qid(ctx) || checksize_4(ctx); } static bool checksize_Tread(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_8(ctx) || checksize_4(ctx); } static bool checksize_Rread(struct _checksize_ctx *ctx) { return checksize_d(ctx); } static bool checksize_Twrite(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_8(ctx) || checksize_d(ctx); } static bool checksize_Rwrite(struct _checksize_ctx *ctx) { return checksize_4(ctx); } static bool checksize_Tclunk(struct _checksize_ctx *ctx) { return checksize_4(ctx); } static bool checksize_Rclunk(struct _checksize_ctx *UNUSED(ctx)) { return false; } static bool checksize_Tremove(struct _checksize_ctx *ctx) { return checksize_4(ctx); } static bool checksize_Rremove(struct _checksize_ctx *UNUSED(ctx)) { return false; } static bool checksize_Tstat(struct _checksize_ctx *ctx) { return checksize_4(ctx); } static bool checksize_Rstat(struct _checksize_ctx *ctx) { return checksize_stat(ctx); } static bool checksize_Twstat(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_stat(ctx); } static bool checksize_Rwstat(struct _checksize_ctx *UNUSED(ctx)) { return false; } static bool checksize_Tsession(struct _checksize_ctx *ctx) { return checksize_8(ctx); } static bool checksize_Rsession(struct _checksize_ctx *UNUSED(ctx)) { return false; } static bool checksize_Tsread(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_2(ctx) || _checksize_list(ctx, decode_u16le(&ctx->net_bytes[ctx->net_offset-2]), checksize_s, sizeof(struct lib9p_s)); } static bool checksize_Rsread(struct _checksize_ctx *ctx) { return checksize_d(ctx); } static bool checksize_Tswrite(struct _checksize_ctx *ctx) { return checksize_4(ctx) || checksize_2(ctx) || _checksize_list(ctx, decode_u16le(&ctx->net_bytes[ctx->net_offset-2]), checksize_s, sizeof(struct lib9p_s)) || checksize_d(ctx); } static bool checksize_Rswrite(struct _checksize_ctx *ctx) { return checksize_4(ctx); } /* unmarshal_* ****************************************************************/ static inline void unmarshal_1(struct _unmarshal_ctx *ctx, uint8_t *out) { *out = decode_u8le(&ctx->net_bytes[ctx->net_offset]); ctx->net_offset += 1; } static inline void unmarshal_2(struct _unmarshal_ctx *ctx, uint16_t *out) { *out = decode_u16le(&ctx->net_bytes[ctx->net_offset]); ctx->net_offset += 2; } static inline void unmarshal_4(struct _unmarshal_ctx *ctx, uint32_t *out) { *out = decode_u32le(&ctx->net_bytes[ctx->net_offset]); ctx->net_offset += 4; } static inline void unmarshal_8(struct _unmarshal_ctx *ctx, uint64_t *out) { *out = decode_u64le(&ctx->net_bytes[ctx->net_offset]); ctx->net_offset += 8; } static inline void unmarshal_d(struct _unmarshal_ctx *ctx, struct lib9p_d *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->len); out->dat = ctx->extra; ctx->extra += sizeof(out->dat[0]) * out->len; for (typeof(out->len) i = 0; i < out->len; i++) unmarshal_1(ctx, &out->dat[i]); } static inline void unmarshal_s(struct _unmarshal_ctx *ctx, struct lib9p_s *out) { memset(out, 0, sizeof(*out)); unmarshal_2(ctx, &out->len); out->utf8 = ctx->extra; ctx->extra += sizeof(out->utf8[0]) * out->len; for (typeof(out->len) i = 0; i < out->len; i++) unmarshal_1(ctx, &out->utf8[i]); } static inline void unmarshal_qid(struct _unmarshal_ctx *ctx, struct lib9p_qid *out) { memset(out, 0, sizeof(*out)); unmarshal_1(ctx, &out->type); unmarshal_4(ctx, &out->vers); unmarshal_8(ctx, &out->path); } static inline void unmarshal_stat(struct _unmarshal_ctx *ctx, struct lib9p_stat *out) { memset(out, 0, sizeof(*out)); unmarshal_2(ctx, &out->stat_size); unmarshal_2(ctx, &out->kern_type); unmarshal_4(ctx, &out->kern_dev); unmarshal_qid(ctx, &out->file_qid); unmarshal_4(ctx, &out->file_mode); unmarshal_4(ctx, &out->file_atime); unmarshal_4(ctx, &out->file_mtime); unmarshal_8(ctx, &out->file_size); unmarshal_s(ctx, &out->file_name); unmarshal_s(ctx, &out->file_owner_uid); unmarshal_s(ctx, &out->file_owner_gid); unmarshal_s(ctx, &out->file_last_modified_uid); if ( (ctx->ctx->version==LIB9P_VER_9P2000_u) ) unmarshal_s(ctx, &out->file_extension); if ( (ctx->ctx->version==LIB9P_VER_9P2000_u) ) unmarshal_4(ctx, &out->file_owner_n_uid); if ( (ctx->ctx->version==LIB9P_VER_9P2000_u) ) unmarshal_4(ctx, &out->file_owner_n_gid); if ( (ctx->ctx->version==LIB9P_VER_9P2000_u) ) unmarshal_4(ctx, &out->file_last_modified_n_uid); } static void unmarshal_Tversion(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tversion *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->max_msg_size); unmarshal_s(ctx, &out->version); } static void unmarshal_Rversion(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rversion *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->max_msg_size); unmarshal_s(ctx, &out->version); } static void unmarshal_Tauth(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tauth *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->afid); unmarshal_s(ctx, &out->uname); unmarshal_s(ctx, &out->aname); if ( (ctx->ctx->version==LIB9P_VER_9P2000_u) ) unmarshal_4(ctx, &out->n_uname); } static void unmarshal_Rauth(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rauth *out) { memset(out, 0, sizeof(*out)); unmarshal_qid(ctx, &out->aqid); } static void unmarshal_Tattach(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tattach *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); unmarshal_4(ctx, &out->afid); unmarshal_s(ctx, &out->uname); unmarshal_s(ctx, &out->aname); } static void unmarshal_Rattach(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rattach *out) { memset(out, 0, sizeof(*out)); unmarshal_qid(ctx, &out->qid); } static void unmarshal_Rerror(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rerror *out) { memset(out, 0, sizeof(*out)); unmarshal_s(ctx, &out->ename); if ( (ctx->ctx->version==LIB9P_VER_9P2000_u) ) unmarshal_4(ctx, &out->errno); } static void unmarshal_Tflush(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tflush *out) { memset(out, 0, sizeof(*out)); unmarshal_2(ctx, &out->oldtag); } static void unmarshal_Rflush(struct _unmarshal_ctx *UNUSED(ctx), struct lib9p_msg_Rflush *out) { memset(out, 0, sizeof(*out)); } static void unmarshal_Twalk(struct _unmarshal_ctx *ctx, struct lib9p_msg_Twalk *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); unmarshal_4(ctx, &out->newfid); unmarshal_2(ctx, &out->nwname); out->wname = ctx->extra; ctx->extra += sizeof(out->wname[0]) * out->nwname; for (typeof(out->nwname) i = 0; i < out->nwname; i++) unmarshal_s(ctx, &out->wname[i]); } static void unmarshal_Rwalk(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rwalk *out) { memset(out, 0, sizeof(*out)); unmarshal_2(ctx, &out->nwqid); out->wqid = ctx->extra; ctx->extra += sizeof(out->wqid[0]) * out->nwqid; for (typeof(out->nwqid) i = 0; i < out->nwqid; i++) unmarshal_qid(ctx, &out->wqid[i]); } static void unmarshal_Topen(struct _unmarshal_ctx *ctx, struct lib9p_msg_Topen *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); unmarshal_1(ctx, &out->mode); } static void unmarshal_Ropen(struct _unmarshal_ctx *ctx, struct lib9p_msg_Ropen *out) { memset(out, 0, sizeof(*out)); unmarshal_qid(ctx, &out->qid); unmarshal_4(ctx, &out->iounit); } static void unmarshal_Tcreate(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tcreate *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); unmarshal_s(ctx, &out->name); unmarshal_4(ctx, &out->perm); unmarshal_1(ctx, &out->mode); } static void unmarshal_Rcreate(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rcreate *out) { memset(out, 0, sizeof(*out)); unmarshal_qid(ctx, &out->qid); unmarshal_4(ctx, &out->iounit); } static void unmarshal_Tread(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tread *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); unmarshal_8(ctx, &out->offset); unmarshal_4(ctx, &out->count); } static void unmarshal_Rread(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rread *out) { memset(out, 0, sizeof(*out)); unmarshal_d(ctx, &out->data); } static void unmarshal_Twrite(struct _unmarshal_ctx *ctx, struct lib9p_msg_Twrite *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); unmarshal_8(ctx, &out->offset); unmarshal_d(ctx, &out->data); } static void unmarshal_Rwrite(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rwrite *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->count); } static void unmarshal_Tclunk(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tclunk *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); } static void unmarshal_Rclunk(struct _unmarshal_ctx *UNUSED(ctx), struct lib9p_msg_Rclunk *out) { memset(out, 0, sizeof(*out)); } static void unmarshal_Tremove(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tremove *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); } static void unmarshal_Rremove(struct _unmarshal_ctx *UNUSED(ctx), struct lib9p_msg_Rremove *out) { memset(out, 0, sizeof(*out)); } static void unmarshal_Tstat(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tstat *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); } static void unmarshal_Rstat(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rstat *out) { memset(out, 0, sizeof(*out)); unmarshal_stat(ctx, &out->stat); } static void unmarshal_Twstat(struct _unmarshal_ctx *ctx, struct lib9p_msg_Twstat *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); unmarshal_stat(ctx, &out->stat); } static void unmarshal_Rwstat(struct _unmarshal_ctx *UNUSED(ctx), struct lib9p_msg_Rwstat *out) { memset(out, 0, sizeof(*out)); } static void unmarshal_Tsession(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tsession *out) { memset(out, 0, sizeof(*out)); unmarshal_8(ctx, &out->key); } static void unmarshal_Rsession(struct _unmarshal_ctx *UNUSED(ctx), struct lib9p_msg_Rsession *out) { memset(out, 0, sizeof(*out)); } static void unmarshal_Tsread(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tsread *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); unmarshal_2(ctx, &out->nwname); out->wname = ctx->extra; ctx->extra += sizeof(out->wname[0]) * out->nwname; for (typeof(out->nwname) i = 0; i < out->nwname; i++) unmarshal_s(ctx, &out->wname[i]); } static void unmarshal_Rsread(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rsread *out) { memset(out, 0, sizeof(*out)); unmarshal_d(ctx, &out->data); } static void unmarshal_Tswrite(struct _unmarshal_ctx *ctx, struct lib9p_msg_Tswrite *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->fid); unmarshal_2(ctx, &out->nwname); out->wname = ctx->extra; ctx->extra += sizeof(out->wname[0]) * out->nwname; for (typeof(out->nwname) i = 0; i < out->nwname; i++) unmarshal_s(ctx, &out->wname[i]); unmarshal_d(ctx, &out->data); } static void unmarshal_Rswrite(struct _unmarshal_ctx *ctx, struct lib9p_msg_Rswrite *out) { memset(out, 0, sizeof(*out)); unmarshal_4(ctx, &out->count); } /* marshal_* ******************************************************************/ static inline bool _marshal_too_large(struct _marshal_ctx *ctx) { lib9p_errorf(ctx->ctx, LINUX_ERANGE, "%s too large to marshal into %s limit (limit=%"PRIu32")", (ctx->net_bytes[4] % 2 == 0) ? "T-message" : "R-message", ctx->ctx->version ? "negotiated" : ((ctx->net_bytes[4] % 2 == 0) ? "client" : "server"), ctx->ctx->max_msg_size); return true; } static inline bool marshal_1(struct _marshal_ctx *ctx, uint8_t *val) { if (ctx->net_offset + 1 > ctx->ctx->max_msg_size) return _marshal_too_large(ctx); ctx->net_bytes[ctx->net_offset] = *val; ctx->net_offset += 1; return false; } static inline bool marshal_2(struct _marshal_ctx *ctx, uint16_t *val) { if (ctx->net_offset + 2 > ctx->ctx->max_msg_size) return _marshal_too_large(ctx); encode_u16le(*val, &ctx->net_bytes[ctx->net_offset]); ctx->net_offset += 2; return false; } static inline bool marshal_4(struct _marshal_ctx *ctx, uint32_t *val) { if (ctx->net_offset + 4 > ctx->ctx->max_msg_size) return true; encode_u32le(*val, &ctx->net_bytes[ctx->net_offset]); ctx->net_offset += 4; return false; } static inline bool marshal_8(struct _marshal_ctx *ctx, uint64_t *val) { if (ctx->net_offset + 8 > ctx->ctx->max_msg_size) return true; encode_u64le(*val, &ctx->net_bytes[ctx->net_offset]); ctx->net_offset += 8; return false; } static inline bool marshal_d(struct _marshal_ctx *ctx, struct lib9p_d *val) { return marshal_4(ctx, &val->len) || ({ bool err = false; for (typeof(val->len) i = 0; i < val->len && !err; i++) err = marshal_1(ctx, &val->dat[i]); err; }); } static inline bool marshal_s(struct _marshal_ctx *ctx, struct lib9p_s *val) { return marshal_2(ctx, &val->len) || ({ bool err = false; for (typeof(val->len) i = 0; i < val->len && !err; i++) err = marshal_1(ctx, &val->utf8[i]); err; }); } static inline bool marshal_qid(struct _marshal_ctx *ctx, struct lib9p_qid *val) { return marshal_1(ctx, &val->type) || marshal_4(ctx, &val->vers) || marshal_8(ctx, &val->path); } static inline bool marshal_stat(struct _marshal_ctx *ctx, struct lib9p_stat *val) { return marshal_2(ctx, &val->stat_size) || marshal_2(ctx, &val->kern_type) || marshal_4(ctx, &val->kern_dev) || marshal_qid(ctx, &val->file_qid) || marshal_4(ctx, &val->file_mode) || marshal_4(ctx, &val->file_atime) || marshal_4(ctx, &val->file_mtime) || marshal_8(ctx, &val->file_size) || marshal_s(ctx, &val->file_name) || marshal_s(ctx, &val->file_owner_uid) || marshal_s(ctx, &val->file_owner_gid) || marshal_s(ctx, &val->file_last_modified_uid) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && marshal_s(ctx, &val->file_extension) ) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && marshal_4(ctx, &val->file_owner_n_uid) ) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && marshal_4(ctx, &val->file_owner_n_gid) ) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && marshal_4(ctx, &val->file_last_modified_n_uid) ); } static bool marshal_Tversion(struct _marshal_ctx *ctx, struct lib9p_msg_Tversion *val) { return marshal_4(ctx, &val->max_msg_size) || marshal_s(ctx, &val->version); } static bool marshal_Rversion(struct _marshal_ctx *ctx, struct lib9p_msg_Rversion *val) { return marshal_4(ctx, &val->max_msg_size) || marshal_s(ctx, &val->version); } static bool marshal_Tauth(struct _marshal_ctx *ctx, struct lib9p_msg_Tauth *val) { return marshal_4(ctx, &val->afid) || marshal_s(ctx, &val->uname) || marshal_s(ctx, &val->aname) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && marshal_4(ctx, &val->n_uname) ); } static bool marshal_Rauth(struct _marshal_ctx *ctx, struct lib9p_msg_Rauth *val) { return marshal_qid(ctx, &val->aqid); } static bool marshal_Tattach(struct _marshal_ctx *ctx, struct lib9p_msg_Tattach *val) { return marshal_4(ctx, &val->fid) || marshal_4(ctx, &val->afid) || marshal_s(ctx, &val->uname) || marshal_s(ctx, &val->aname); } static bool marshal_Rattach(struct _marshal_ctx *ctx, struct lib9p_msg_Rattach *val) { return marshal_qid(ctx, &val->qid); } static bool marshal_Rerror(struct _marshal_ctx *ctx, struct lib9p_msg_Rerror *val) { /* Truncate the error-string if necessary to avoid returning ERANGE. */ if (((uint32_t)val->ename.len) + ctx->ctx->Rerror_overhead > ctx->ctx->max_msg_size) val->ename.len = ctx->ctx->max_msg_size - ctx->ctx->Rerror_overhead; return marshal_s(ctx, &val->ename) || ( (ctx->ctx->version==LIB9P_VER_9P2000_u) && marshal_4(ctx, &val->errno) ); } static bool marshal_Tflush(struct _marshal_ctx *ctx, struct lib9p_msg_Tflush *val) { return marshal_2(ctx, &val->oldtag); } static bool marshal_Rflush(struct _marshal_ctx *UNUSED(ctx), struct lib9p_msg_Rflush *UNUSED(val)) { return false; } static bool marshal_Twalk(struct _marshal_ctx *ctx, struct lib9p_msg_Twalk *val) { return marshal_4(ctx, &val->fid) || marshal_4(ctx, &val->newfid) || marshal_2(ctx, &val->nwname) || ({ bool err = false; for (typeof(val->nwname) i = 0; i < val->nwname && !err; i++) err = marshal_s(ctx, &val->wname[i]); err; }); } static bool marshal_Rwalk(struct _marshal_ctx *ctx, struct lib9p_msg_Rwalk *val) { return marshal_2(ctx, &val->nwqid) || ({ bool err = false; for (typeof(val->nwqid) i = 0; i < val->nwqid && !err; i++) err = marshal_qid(ctx, &val->wqid[i]); err; }); } static bool marshal_Topen(struct _marshal_ctx *ctx, struct lib9p_msg_Topen *val) { return marshal_4(ctx, &val->fid) || marshal_1(ctx, &val->mode); } static bool marshal_Ropen(struct _marshal_ctx *ctx, struct lib9p_msg_Ropen *val) { return marshal_qid(ctx, &val->qid) || marshal_4(ctx, &val->iounit); } static bool marshal_Tcreate(struct _marshal_ctx *ctx, struct lib9p_msg_Tcreate *val) { return marshal_4(ctx, &val->fid) || marshal_s(ctx, &val->name) || marshal_4(ctx, &val->perm) || marshal_1(ctx, &val->mode); } static bool marshal_Rcreate(struct _marshal_ctx *ctx, struct lib9p_msg_Rcreate *val) { return marshal_qid(ctx, &val->qid) || marshal_4(ctx, &val->iounit); } static bool marshal_Tread(struct _marshal_ctx *ctx, struct lib9p_msg_Tread *val) { return marshal_4(ctx, &val->fid) || marshal_8(ctx, &val->offset) || marshal_4(ctx, &val->count); } static bool marshal_Rread(struct _marshal_ctx *ctx, struct lib9p_msg_Rread *val) { return marshal_d(ctx, &val->data); } static bool marshal_Twrite(struct _marshal_ctx *ctx, struct lib9p_msg_Twrite *val) { return marshal_4(ctx, &val->fid) || marshal_8(ctx, &val->offset) || marshal_d(ctx, &val->data); } static bool marshal_Rwrite(struct _marshal_ctx *ctx, struct lib9p_msg_Rwrite *val) { return marshal_4(ctx, &val->count); } static bool marshal_Tclunk(struct _marshal_ctx *ctx, struct lib9p_msg_Tclunk *val) { return marshal_4(ctx, &val->fid); } static bool marshal_Rclunk(struct _marshal_ctx *UNUSED(ctx), struct lib9p_msg_Rclunk *UNUSED(val)) { return false; } static bool marshal_Tremove(struct _marshal_ctx *ctx, struct lib9p_msg_Tremove *val) { return marshal_4(ctx, &val->fid); } static bool marshal_Rremove(struct _marshal_ctx *UNUSED(ctx), struct lib9p_msg_Rremove *UNUSED(val)) { return false; } static bool marshal_Tstat(struct _marshal_ctx *ctx, struct lib9p_msg_Tstat *val) { return marshal_4(ctx, &val->fid); } static bool marshal_Rstat(struct _marshal_ctx *ctx, struct lib9p_msg_Rstat *val) { return marshal_stat(ctx, &val->stat); } static bool marshal_Twstat(struct _marshal_ctx *ctx, struct lib9p_msg_Twstat *val) { return marshal_4(ctx, &val->fid) || marshal_stat(ctx, &val->stat); } static bool marshal_Rwstat(struct _marshal_ctx *UNUSED(ctx), struct lib9p_msg_Rwstat *UNUSED(val)) { return false; } static bool marshal_Tsession(struct _marshal_ctx *ctx, struct lib9p_msg_Tsession *val) { return marshal_8(ctx, &val->key); } static bool marshal_Rsession(struct _marshal_ctx *UNUSED(ctx), struct lib9p_msg_Rsession *UNUSED(val)) { return false; } static bool marshal_Tsread(struct _marshal_ctx *ctx, struct lib9p_msg_Tsread *val) { return marshal_4(ctx, &val->fid) || marshal_2(ctx, &val->nwname) || ({ bool err = false; for (typeof(val->nwname) i = 0; i < val->nwname && !err; i++) err = marshal_s(ctx, &val->wname[i]); err; }); } static bool marshal_Rsread(struct _marshal_ctx *ctx, struct lib9p_msg_Rsread *val) { return marshal_d(ctx, &val->data); } static bool marshal_Tswrite(struct _marshal_ctx *ctx, struct lib9p_msg_Tswrite *val) { return marshal_4(ctx, &val->fid) || marshal_2(ctx, &val->nwname) || ({ bool err = false; for (typeof(val->nwname) i = 0; i < val->nwname && !err; i++) err = marshal_s(ctx, &val->wname[i]); err; }) || marshal_d(ctx, &val->data); } static bool marshal_Rswrite(struct _marshal_ctx *ctx, struct lib9p_msg_Rswrite *val) { return marshal_4(ctx, &val->count); } /* vtables ********************************************************************/ struct _vtable_version _lib9p_vtables[LIB9P_VER_NUM] = { [LIB9P_VER_UNINITIALIZED] = { .msgs = { [LIB9P_TYP_Tversion] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tversion), .unmarshal_extrasize = checksize_Tversion, .unmarshal = (_unmarshal_fn_t)unmarshal_Tversion, .marshal = (_marshal_fn_t)marshal_Tversion, }, [LIB9P_TYP_Rversion] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rversion), .unmarshal_extrasize = checksize_Rversion, .unmarshal = (_unmarshal_fn_t)unmarshal_Rversion, .marshal = (_marshal_fn_t)marshal_Rversion, }, [LIB9P_TYP_Rerror] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rerror), .unmarshal_extrasize = checksize_Rerror, .unmarshal = (_unmarshal_fn_t)unmarshal_Rerror, .marshal = (_marshal_fn_t)marshal_Rerror, }, }}, [LIB9P_VER_9P2000] = { .msgs = { [LIB9P_TYP_Tversion] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tversion), .unmarshal_extrasize = checksize_Tversion, .unmarshal = (_unmarshal_fn_t)unmarshal_Tversion, .marshal = (_marshal_fn_t)marshal_Tversion, }, [LIB9P_TYP_Rversion] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rversion), .unmarshal_extrasize = checksize_Rversion, .unmarshal = (_unmarshal_fn_t)unmarshal_Rversion, .marshal = (_marshal_fn_t)marshal_Rversion, }, [LIB9P_TYP_Tauth] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tauth), .unmarshal_extrasize = checksize_Tauth, .unmarshal = (_unmarshal_fn_t)unmarshal_Tauth, .marshal = (_marshal_fn_t)marshal_Tauth, }, [LIB9P_TYP_Rauth] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rauth), .unmarshal_extrasize = checksize_Rauth, .unmarshal = (_unmarshal_fn_t)unmarshal_Rauth, .marshal = (_marshal_fn_t)marshal_Rauth, }, [LIB9P_TYP_Tattach] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tattach), .unmarshal_extrasize = checksize_Tattach, .unmarshal = (_unmarshal_fn_t)unmarshal_Tattach, .marshal = (_marshal_fn_t)marshal_Tattach, }, [LIB9P_TYP_Rattach] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rattach), .unmarshal_extrasize = checksize_Rattach, .unmarshal = (_unmarshal_fn_t)unmarshal_Rattach, .marshal = (_marshal_fn_t)marshal_Rattach, }, [LIB9P_TYP_Rerror] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rerror), .unmarshal_extrasize = checksize_Rerror, .unmarshal = (_unmarshal_fn_t)unmarshal_Rerror, .marshal = (_marshal_fn_t)marshal_Rerror, }, [LIB9P_TYP_Tflush] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tflush), .unmarshal_extrasize = checksize_Tflush, .unmarshal = (_unmarshal_fn_t)unmarshal_Tflush, .marshal = (_marshal_fn_t)marshal_Tflush, }, [LIB9P_TYP_Rflush] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rflush), .unmarshal_extrasize = checksize_Rflush, .unmarshal = (_unmarshal_fn_t)unmarshal_Rflush, .marshal = (_marshal_fn_t)marshal_Rflush, }, [LIB9P_TYP_Twalk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Twalk), .unmarshal_extrasize = checksize_Twalk, .unmarshal = (_unmarshal_fn_t)unmarshal_Twalk, .marshal = (_marshal_fn_t)marshal_Twalk, }, [LIB9P_TYP_Rwalk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rwalk), .unmarshal_extrasize = checksize_Rwalk, .unmarshal = (_unmarshal_fn_t)unmarshal_Rwalk, .marshal = (_marshal_fn_t)marshal_Rwalk, }, [LIB9P_TYP_Topen] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Topen), .unmarshal_extrasize = checksize_Topen, .unmarshal = (_unmarshal_fn_t)unmarshal_Topen, .marshal = (_marshal_fn_t)marshal_Topen, }, [LIB9P_TYP_Ropen] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Ropen), .unmarshal_extrasize = checksize_Ropen, .unmarshal = (_unmarshal_fn_t)unmarshal_Ropen, .marshal = (_marshal_fn_t)marshal_Ropen, }, [LIB9P_TYP_Tcreate] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tcreate), .unmarshal_extrasize = checksize_Tcreate, .unmarshal = (_unmarshal_fn_t)unmarshal_Tcreate, .marshal = (_marshal_fn_t)marshal_Tcreate, }, [LIB9P_TYP_Rcreate] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rcreate), .unmarshal_extrasize = checksize_Rcreate, .unmarshal = (_unmarshal_fn_t)unmarshal_Rcreate, .marshal = (_marshal_fn_t)marshal_Rcreate, }, [LIB9P_TYP_Tread] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tread), .unmarshal_extrasize = checksize_Tread, .unmarshal = (_unmarshal_fn_t)unmarshal_Tread, .marshal = (_marshal_fn_t)marshal_Tread, }, [LIB9P_TYP_Rread] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rread), .unmarshal_extrasize = checksize_Rread, .unmarshal = (_unmarshal_fn_t)unmarshal_Rread, .marshal = (_marshal_fn_t)marshal_Rread, }, [LIB9P_TYP_Twrite] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Twrite), .unmarshal_extrasize = checksize_Twrite, .unmarshal = (_unmarshal_fn_t)unmarshal_Twrite, .marshal = (_marshal_fn_t)marshal_Twrite, }, [LIB9P_TYP_Rwrite] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rwrite), .unmarshal_extrasize = checksize_Rwrite, .unmarshal = (_unmarshal_fn_t)unmarshal_Rwrite, .marshal = (_marshal_fn_t)marshal_Rwrite, }, [LIB9P_TYP_Tclunk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tclunk), .unmarshal_extrasize = checksize_Tclunk, .unmarshal = (_unmarshal_fn_t)unmarshal_Tclunk, .marshal = (_marshal_fn_t)marshal_Tclunk, }, [LIB9P_TYP_Rclunk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rclunk), .unmarshal_extrasize = checksize_Rclunk, .unmarshal = (_unmarshal_fn_t)unmarshal_Rclunk, .marshal = (_marshal_fn_t)marshal_Rclunk, }, [LIB9P_TYP_Tremove] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tremove), .unmarshal_extrasize = checksize_Tremove, .unmarshal = (_unmarshal_fn_t)unmarshal_Tremove, .marshal = (_marshal_fn_t)marshal_Tremove, }, [LIB9P_TYP_Rremove] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rremove), .unmarshal_extrasize = checksize_Rremove, .unmarshal = (_unmarshal_fn_t)unmarshal_Rremove, .marshal = (_marshal_fn_t)marshal_Rremove, }, [LIB9P_TYP_Tstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tstat), .unmarshal_extrasize = checksize_Tstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Tstat, .marshal = (_marshal_fn_t)marshal_Tstat, }, [LIB9P_TYP_Rstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rstat), .unmarshal_extrasize = checksize_Rstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Rstat, .marshal = (_marshal_fn_t)marshal_Rstat, }, [LIB9P_TYP_Twstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Twstat), .unmarshal_extrasize = checksize_Twstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Twstat, .marshal = (_marshal_fn_t)marshal_Twstat, }, [LIB9P_TYP_Rwstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rwstat), .unmarshal_extrasize = checksize_Rwstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Rwstat, .marshal = (_marshal_fn_t)marshal_Rwstat, }, }}, [LIB9P_VER_9P2000_e] = { .msgs = { [LIB9P_TYP_Tversion] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tversion), .unmarshal_extrasize = checksize_Tversion, .unmarshal = (_unmarshal_fn_t)unmarshal_Tversion, .marshal = (_marshal_fn_t)marshal_Tversion, }, [LIB9P_TYP_Rversion] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rversion), .unmarshal_extrasize = checksize_Rversion, .unmarshal = (_unmarshal_fn_t)unmarshal_Rversion, .marshal = (_marshal_fn_t)marshal_Rversion, }, [LIB9P_TYP_Tauth] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tauth), .unmarshal_extrasize = checksize_Tauth, .unmarshal = (_unmarshal_fn_t)unmarshal_Tauth, .marshal = (_marshal_fn_t)marshal_Tauth, }, [LIB9P_TYP_Rauth] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rauth), .unmarshal_extrasize = checksize_Rauth, .unmarshal = (_unmarshal_fn_t)unmarshal_Rauth, .marshal = (_marshal_fn_t)marshal_Rauth, }, [LIB9P_TYP_Tattach] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tattach), .unmarshal_extrasize = checksize_Tattach, .unmarshal = (_unmarshal_fn_t)unmarshal_Tattach, .marshal = (_marshal_fn_t)marshal_Tattach, }, [LIB9P_TYP_Rattach] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rattach), .unmarshal_extrasize = checksize_Rattach, .unmarshal = (_unmarshal_fn_t)unmarshal_Rattach, .marshal = (_marshal_fn_t)marshal_Rattach, }, [LIB9P_TYP_Rerror] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rerror), .unmarshal_extrasize = checksize_Rerror, .unmarshal = (_unmarshal_fn_t)unmarshal_Rerror, .marshal = (_marshal_fn_t)marshal_Rerror, }, [LIB9P_TYP_Tflush] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tflush), .unmarshal_extrasize = checksize_Tflush, .unmarshal = (_unmarshal_fn_t)unmarshal_Tflush, .marshal = (_marshal_fn_t)marshal_Tflush, }, [LIB9P_TYP_Rflush] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rflush), .unmarshal_extrasize = checksize_Rflush, .unmarshal = (_unmarshal_fn_t)unmarshal_Rflush, .marshal = (_marshal_fn_t)marshal_Rflush, }, [LIB9P_TYP_Twalk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Twalk), .unmarshal_extrasize = checksize_Twalk, .unmarshal = (_unmarshal_fn_t)unmarshal_Twalk, .marshal = (_marshal_fn_t)marshal_Twalk, }, [LIB9P_TYP_Rwalk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rwalk), .unmarshal_extrasize = checksize_Rwalk, .unmarshal = (_unmarshal_fn_t)unmarshal_Rwalk, .marshal = (_marshal_fn_t)marshal_Rwalk, }, [LIB9P_TYP_Topen] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Topen), .unmarshal_extrasize = checksize_Topen, .unmarshal = (_unmarshal_fn_t)unmarshal_Topen, .marshal = (_marshal_fn_t)marshal_Topen, }, [LIB9P_TYP_Ropen] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Ropen), .unmarshal_extrasize = checksize_Ropen, .unmarshal = (_unmarshal_fn_t)unmarshal_Ropen, .marshal = (_marshal_fn_t)marshal_Ropen, }, [LIB9P_TYP_Tcreate] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tcreate), .unmarshal_extrasize = checksize_Tcreate, .unmarshal = (_unmarshal_fn_t)unmarshal_Tcreate, .marshal = (_marshal_fn_t)marshal_Tcreate, }, [LIB9P_TYP_Rcreate] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rcreate), .unmarshal_extrasize = checksize_Rcreate, .unmarshal = (_unmarshal_fn_t)unmarshal_Rcreate, .marshal = (_marshal_fn_t)marshal_Rcreate, }, [LIB9P_TYP_Tread] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tread), .unmarshal_extrasize = checksize_Tread, .unmarshal = (_unmarshal_fn_t)unmarshal_Tread, .marshal = (_marshal_fn_t)marshal_Tread, }, [LIB9P_TYP_Rread] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rread), .unmarshal_extrasize = checksize_Rread, .unmarshal = (_unmarshal_fn_t)unmarshal_Rread, .marshal = (_marshal_fn_t)marshal_Rread, }, [LIB9P_TYP_Twrite] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Twrite), .unmarshal_extrasize = checksize_Twrite, .unmarshal = (_unmarshal_fn_t)unmarshal_Twrite, .marshal = (_marshal_fn_t)marshal_Twrite, }, [LIB9P_TYP_Rwrite] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rwrite), .unmarshal_extrasize = checksize_Rwrite, .unmarshal = (_unmarshal_fn_t)unmarshal_Rwrite, .marshal = (_marshal_fn_t)marshal_Rwrite, }, [LIB9P_TYP_Tclunk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tclunk), .unmarshal_extrasize = checksize_Tclunk, .unmarshal = (_unmarshal_fn_t)unmarshal_Tclunk, .marshal = (_marshal_fn_t)marshal_Tclunk, }, [LIB9P_TYP_Rclunk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rclunk), .unmarshal_extrasize = checksize_Rclunk, .unmarshal = (_unmarshal_fn_t)unmarshal_Rclunk, .marshal = (_marshal_fn_t)marshal_Rclunk, }, [LIB9P_TYP_Tremove] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tremove), .unmarshal_extrasize = checksize_Tremove, .unmarshal = (_unmarshal_fn_t)unmarshal_Tremove, .marshal = (_marshal_fn_t)marshal_Tremove, }, [LIB9P_TYP_Rremove] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rremove), .unmarshal_extrasize = checksize_Rremove, .unmarshal = (_unmarshal_fn_t)unmarshal_Rremove, .marshal = (_marshal_fn_t)marshal_Rremove, }, [LIB9P_TYP_Tstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tstat), .unmarshal_extrasize = checksize_Tstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Tstat, .marshal = (_marshal_fn_t)marshal_Tstat, }, [LIB9P_TYP_Rstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rstat), .unmarshal_extrasize = checksize_Rstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Rstat, .marshal = (_marshal_fn_t)marshal_Rstat, }, [LIB9P_TYP_Twstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Twstat), .unmarshal_extrasize = checksize_Twstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Twstat, .marshal = (_marshal_fn_t)marshal_Twstat, }, [LIB9P_TYP_Rwstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rwstat), .unmarshal_extrasize = checksize_Rwstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Rwstat, .marshal = (_marshal_fn_t)marshal_Rwstat, }, [LIB9P_TYP_Tsession] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tsession), .unmarshal_extrasize = checksize_Tsession, .unmarshal = (_unmarshal_fn_t)unmarshal_Tsession, .marshal = (_marshal_fn_t)marshal_Tsession, }, [LIB9P_TYP_Rsession] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rsession), .unmarshal_extrasize = checksize_Rsession, .unmarshal = (_unmarshal_fn_t)unmarshal_Rsession, .marshal = (_marshal_fn_t)marshal_Rsession, }, [LIB9P_TYP_Tsread] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tsread), .unmarshal_extrasize = checksize_Tsread, .unmarshal = (_unmarshal_fn_t)unmarshal_Tsread, .marshal = (_marshal_fn_t)marshal_Tsread, }, [LIB9P_TYP_Rsread] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rsread), .unmarshal_extrasize = checksize_Rsread, .unmarshal = (_unmarshal_fn_t)unmarshal_Rsread, .marshal = (_marshal_fn_t)marshal_Rsread, }, [LIB9P_TYP_Tswrite] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tswrite), .unmarshal_extrasize = checksize_Tswrite, .unmarshal = (_unmarshal_fn_t)unmarshal_Tswrite, .marshal = (_marshal_fn_t)marshal_Tswrite, }, [LIB9P_TYP_Rswrite] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rswrite), .unmarshal_extrasize = checksize_Rswrite, .unmarshal = (_unmarshal_fn_t)unmarshal_Rswrite, .marshal = (_marshal_fn_t)marshal_Rswrite, }, }}, [LIB9P_VER_9P2000_u] = { .msgs = { [LIB9P_TYP_Tversion] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tversion), .unmarshal_extrasize = checksize_Tversion, .unmarshal = (_unmarshal_fn_t)unmarshal_Tversion, .marshal = (_marshal_fn_t)marshal_Tversion, }, [LIB9P_TYP_Rversion] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rversion), .unmarshal_extrasize = checksize_Rversion, .unmarshal = (_unmarshal_fn_t)unmarshal_Rversion, .marshal = (_marshal_fn_t)marshal_Rversion, }, [LIB9P_TYP_Tauth] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tauth), .unmarshal_extrasize = checksize_Tauth, .unmarshal = (_unmarshal_fn_t)unmarshal_Tauth, .marshal = (_marshal_fn_t)marshal_Tauth, }, [LIB9P_TYP_Rauth] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rauth), .unmarshal_extrasize = checksize_Rauth, .unmarshal = (_unmarshal_fn_t)unmarshal_Rauth, .marshal = (_marshal_fn_t)marshal_Rauth, }, [LIB9P_TYP_Tattach] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tattach), .unmarshal_extrasize = checksize_Tattach, .unmarshal = (_unmarshal_fn_t)unmarshal_Tattach, .marshal = (_marshal_fn_t)marshal_Tattach, }, [LIB9P_TYP_Rattach] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rattach), .unmarshal_extrasize = checksize_Rattach, .unmarshal = (_unmarshal_fn_t)unmarshal_Rattach, .marshal = (_marshal_fn_t)marshal_Rattach, }, [LIB9P_TYP_Rerror] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rerror), .unmarshal_extrasize = checksize_Rerror, .unmarshal = (_unmarshal_fn_t)unmarshal_Rerror, .marshal = (_marshal_fn_t)marshal_Rerror, }, [LIB9P_TYP_Tflush] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tflush), .unmarshal_extrasize = checksize_Tflush, .unmarshal = (_unmarshal_fn_t)unmarshal_Tflush, .marshal = (_marshal_fn_t)marshal_Tflush, }, [LIB9P_TYP_Rflush] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rflush), .unmarshal_extrasize = checksize_Rflush, .unmarshal = (_unmarshal_fn_t)unmarshal_Rflush, .marshal = (_marshal_fn_t)marshal_Rflush, }, [LIB9P_TYP_Twalk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Twalk), .unmarshal_extrasize = checksize_Twalk, .unmarshal = (_unmarshal_fn_t)unmarshal_Twalk, .marshal = (_marshal_fn_t)marshal_Twalk, }, [LIB9P_TYP_Rwalk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rwalk), .unmarshal_extrasize = checksize_Rwalk, .unmarshal = (_unmarshal_fn_t)unmarshal_Rwalk, .marshal = (_marshal_fn_t)marshal_Rwalk, }, [LIB9P_TYP_Topen] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Topen), .unmarshal_extrasize = checksize_Topen, .unmarshal = (_unmarshal_fn_t)unmarshal_Topen, .marshal = (_marshal_fn_t)marshal_Topen, }, [LIB9P_TYP_Ropen] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Ropen), .unmarshal_extrasize = checksize_Ropen, .unmarshal = (_unmarshal_fn_t)unmarshal_Ropen, .marshal = (_marshal_fn_t)marshal_Ropen, }, [LIB9P_TYP_Tcreate] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tcreate), .unmarshal_extrasize = checksize_Tcreate, .unmarshal = (_unmarshal_fn_t)unmarshal_Tcreate, .marshal = (_marshal_fn_t)marshal_Tcreate, }, [LIB9P_TYP_Rcreate] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rcreate), .unmarshal_extrasize = checksize_Rcreate, .unmarshal = (_unmarshal_fn_t)unmarshal_Rcreate, .marshal = (_marshal_fn_t)marshal_Rcreate, }, [LIB9P_TYP_Tread] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tread), .unmarshal_extrasize = checksize_Tread, .unmarshal = (_unmarshal_fn_t)unmarshal_Tread, .marshal = (_marshal_fn_t)marshal_Tread, }, [LIB9P_TYP_Rread] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rread), .unmarshal_extrasize = checksize_Rread, .unmarshal = (_unmarshal_fn_t)unmarshal_Rread, .marshal = (_marshal_fn_t)marshal_Rread, }, [LIB9P_TYP_Twrite] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Twrite), .unmarshal_extrasize = checksize_Twrite, .unmarshal = (_unmarshal_fn_t)unmarshal_Twrite, .marshal = (_marshal_fn_t)marshal_Twrite, }, [LIB9P_TYP_Rwrite] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rwrite), .unmarshal_extrasize = checksize_Rwrite, .unmarshal = (_unmarshal_fn_t)unmarshal_Rwrite, .marshal = (_marshal_fn_t)marshal_Rwrite, }, [LIB9P_TYP_Tclunk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tclunk), .unmarshal_extrasize = checksize_Tclunk, .unmarshal = (_unmarshal_fn_t)unmarshal_Tclunk, .marshal = (_marshal_fn_t)marshal_Tclunk, }, [LIB9P_TYP_Rclunk] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rclunk), .unmarshal_extrasize = checksize_Rclunk, .unmarshal = (_unmarshal_fn_t)unmarshal_Rclunk, .marshal = (_marshal_fn_t)marshal_Rclunk, }, [LIB9P_TYP_Tremove] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tremove), .unmarshal_extrasize = checksize_Tremove, .unmarshal = (_unmarshal_fn_t)unmarshal_Tremove, .marshal = (_marshal_fn_t)marshal_Tremove, }, [LIB9P_TYP_Rremove] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rremove), .unmarshal_extrasize = checksize_Rremove, .unmarshal = (_unmarshal_fn_t)unmarshal_Rremove, .marshal = (_marshal_fn_t)marshal_Rremove, }, [LIB9P_TYP_Tstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Tstat), .unmarshal_extrasize = checksize_Tstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Tstat, .marshal = (_marshal_fn_t)marshal_Tstat, }, [LIB9P_TYP_Rstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rstat), .unmarshal_extrasize = checksize_Rstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Rstat, .marshal = (_marshal_fn_t)marshal_Rstat, }, [LIB9P_TYP_Twstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Twstat), .unmarshal_extrasize = checksize_Twstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Twstat, .marshal = (_marshal_fn_t)marshal_Twstat, }, [LIB9P_TYP_Rwstat] = { .unmarshal_basesize = sizeof(struct lib9p_msg_Rwstat), .unmarshal_extrasize = checksize_Rwstat, .unmarshal = (_unmarshal_fn_t)unmarshal_Rwstat, .marshal = (_marshal_fn_t)marshal_Rwstat, }, }}, };