4 static void dumpsome(char*, char*, long);
5 static void fdirconv(char*, Dentry*);
12 int fid, type, tag, n;
15 f = va_arg(f1->args, Oldfcall*);
20 case Tnop9p1: /* 50 */
21 sprint(buf, "Tnop9p1 tag %ud", tag);
24 sprint(buf, "Rnop9p1 tag %ud", tag);
26 case Tsession9p1: /* 52 */
27 sprint(buf, "Tsession9p1 tag %ud", tag);
30 sprint(buf, "Rsession9p1 tag %ud", tag);
32 case Rerror9p1: /* 55 */
33 sprint(buf, "Rerror9p1 tag %ud error %.64s", tag, f->ename);
35 case Tflush9p1: /* 56 */
36 sprint(buf, "Tflush9p1 tag %ud oldtag %d", tag, f->oldtag);
39 sprint(buf, "Rflush9p1 tag %ud", tag);
41 case Tattach9p1: /* 58 */
42 sprint(buf, "Tattach9p1 tag %ud fid %d uname %.28s aname %.28s auth %.28s",
43 tag, f->fid, f->uname, f->aname, f->auth);
46 sprint(buf, "Rattach9p1 tag %ud fid %d qid 0x%lux|0x%lux",
47 tag, fid, f->qid.path, f->qid.version);
49 case Tclone9p1: /* 60 */
50 sprint(buf, "Tclone9p1 tag %ud fid %d newfid %d", tag, fid, f->newfid);
53 sprint(buf, "Rclone9p1 tag %ud fid %d", tag, fid);
55 case Twalk9p1: /* 62 */
56 sprint(buf, "Twalk9p1 tag %ud fid %d name %.28s", tag, fid, f->name);
59 sprint(buf, "Rwalk9p1 tag %ud fid %d qid 0x%lux|0x%lux",
60 tag, fid, f->qid.path, f->qid.version);
62 case Topen9p1: /* 64 */
63 sprint(buf, "Topen9p1 tag %ud fid %d mode %d", tag, fid, f->mode);
66 sprint(buf, "Ropen9p1 tag %ud fid %d qid 0x%lux|0x%lux",
67 tag, fid, f->qid.path, f->qid.version);
69 case Tcreate9p1: /* 66 */
70 sprint(buf, "Tcreate9p1 tag %ud fid %d name %.28s perm 0x%lux mode %d",
71 tag, fid, f->name, f->perm, f->mode);
74 sprint(buf, "Rcreate9p1 tag %ud fid %d qid 0x%lux|0x%lux",
75 tag, fid, f->qid.path, f->qid.version);
77 case Tread9p1: /* 68 */
78 sprint(buf, "Tread9p1 tag %ud fid %d offset %ld count %ld",
79 tag, fid, f->offset, f->count);
82 n = sprint(buf, "Rread9p1 tag %ud fid %d count %ld ", tag, fid, f->count);
83 dumpsome(buf+n, f->data, f->count);
85 case Twrite9p1: /* 70 */
86 n = sprint(buf, "Twrite9p1 tag %ud fid %d offset %ld count %ld ",
87 tag, fid, f->offset, f->count);
88 dumpsome(buf+n, f->data, f->count);
91 sprint(buf, "Rwrite9p1 tag %ud fid %d count %ld", tag, fid, f->count);
93 case Tclunk9p1: /* 72 */
94 sprint(buf, "Tclunk9p1 tag %ud fid %d", tag, fid);
97 sprint(buf, "Rclunk9p1 tag %ud fid %d", tag, fid);
99 case Tremove9p1: /* 74 */
100 sprint(buf, "Tremove9p1 tag %ud fid %d", tag, fid);
103 sprint(buf, "Rremove9p1 tag %ud fid %d", tag, fid);
105 case Tstat9p1: /* 76 */
106 sprint(buf, "Tstat9p1 tag %ud fid %d", tag, fid);
109 n = sprint(buf, "Rstat9p1 tag %ud fid %d", tag, fid);
110 convM2D9p1(f->stat, &d);
111 sprint(buf+n, " stat ");
112 fdirconv(buf+n+6, &d);
114 case Twstat9p1: /* 78 */
115 convM2D9p1(f->stat, &d);
116 n = sprint(buf, "Twstat9p1 tag %ud fid %d stat ", tag, fid);
120 sprint(buf, "Rwstat9p1 tag %ud fid %d", tag, fid);
122 case Tclwalk9p1: /* 81 */
123 sprint(buf, "Tclwalk9p1 tag %ud fid %d newfid %d name %.28s",
124 tag, fid, f->newfid, f->name);
127 sprint(buf, "Rclwalk9p1 tag %ud fid %d qid 0x%lux|0x%lux",
128 tag, fid, f->qid.path, f->qid.version);
131 sprint(buf, "unknown type %d", type);
133 return fmtstrcpy(f1, buf);
137 fdirconv(char *buf, Dentry *d)
139 sprint(buf, "'%s' uid=%d gid=%d "
141 "at %ld mt %ld l %ld ",
142 d->name, d->uid, d->gid,
143 d->qid.path, d->qid.version, d->mode,
144 d->atime, d->mtime, d->size);
148 * dump out count (or DUMPL, if count is bigger) bytes from
149 * buf to ans, as a string if they are all printable,
150 * else as a series of hex bytes
155 dumpsome(char *ans, char *buf, long count)
163 for(i=0; i<count && printable; i++)
164 if((buf[i]<32 && buf[i] !='\n' && buf[i] !='\t') || (uchar)buf[i]>127)
169 memmove(p, buf, count);
172 for(i=0; i<count; i++){
175 sprint(p, "%2.2ux", buf[i]);