Blame


1 056fe1ba 2003-11-23 devnull #include <u.h>
2 056fe1ba 2003-11-23 devnull #include <libc.h>
3 056fe1ba 2003-11-23 devnull #include <venti.h>
4 056fe1ba 2003-11-23 devnull
5 056fe1ba 2003-11-23 devnull int
6 056fe1ba 2003-11-23 devnull vtfcallfmt(Fmt *f)
7 056fe1ba 2003-11-23 devnull {
8 056fe1ba 2003-11-23 devnull VtFcall *t;
9 056fe1ba 2003-11-23 devnull
10 056fe1ba 2003-11-23 devnull t = va_arg(f->args, VtFcall*);
11 056fe1ba 2003-11-23 devnull if(t == nil){
12 056fe1ba 2003-11-23 devnull fmtprint(f, "<nil fcall>");
13 056fe1ba 2003-11-23 devnull return 0;
14 056fe1ba 2003-11-23 devnull }
15 7643b263 2005-07-13 devnull switch(t->msgtype){
16 056fe1ba 2003-11-23 devnull default:
17 7643b263 2005-07-13 devnull return fmtprint(f, "%c%d tag %ud", "TR"[t->msgtype&1], t->msgtype>>1, t->tag);
18 056fe1ba 2003-11-23 devnull case VtRerror:
19 056fe1ba 2003-11-23 devnull return fmtprint(f, "Rerror tag %ud error %s", t->tag, t->error);
20 056fe1ba 2003-11-23 devnull case VtTping:
21 056fe1ba 2003-11-23 devnull return fmtprint(f, "Tping tag %ud", t->tag);
22 056fe1ba 2003-11-23 devnull case VtRping:
23 056fe1ba 2003-11-23 devnull return fmtprint(f, "Rping tag %ud", t->tag);
24 056fe1ba 2003-11-23 devnull case VtThello:
25 056fe1ba 2003-11-23 devnull return fmtprint(f, "Thello tag %ud vers %s uid %s strength %d crypto %d:%.*H codec %d:%.*H", t->tag,
26 056fe1ba 2003-11-23 devnull t->version, t->uid, t->strength, t->ncrypto, t->ncrypto, t->crypto,
27 056fe1ba 2003-11-23 devnull t->ncodec, t->ncodec, t->codec);
28 056fe1ba 2003-11-23 devnull case VtRhello:
29 056fe1ba 2003-11-23 devnull return fmtprint(f, "Rhello tag %ud sid %s rcrypto %d rcodec %d", t->tag, t->sid, t->rcrypto, t->rcodec);
30 056fe1ba 2003-11-23 devnull case VtTgoodbye:
31 056fe1ba 2003-11-23 devnull return fmtprint(f, "Tgoodbye tag %ud", t->tag);
32 056fe1ba 2003-11-23 devnull case VtRgoodbye:
33 056fe1ba 2003-11-23 devnull return fmtprint(f, "Rgoodbye tag %ud", t->tag);
34 056fe1ba 2003-11-23 devnull case VtTauth0:
35 056fe1ba 2003-11-23 devnull return fmtprint(f, "Tauth0 tag %ud auth %.*H", t->tag, t->nauth, t->auth);
36 056fe1ba 2003-11-23 devnull case VtRauth0:
37 056fe1ba 2003-11-23 devnull return fmtprint(f, "Rauth0 tag %ud auth %.*H", t->tag, t->nauth, t->auth);
38 056fe1ba 2003-11-23 devnull case VtTauth1:
39 056fe1ba 2003-11-23 devnull return fmtprint(f, "Tauth1 tag %ud auth %.*H", t->tag, t->nauth, t->auth);
40 056fe1ba 2003-11-23 devnull case VtRauth1:
41 056fe1ba 2003-11-23 devnull return fmtprint(f, "Rauth1 tag %ud auth %.*H", t->tag, t->nauth, t->auth);
42 056fe1ba 2003-11-23 devnull case VtTread:
43 7643b263 2005-07-13 devnull return fmtprint(f, "Tread tag %ud score %V blocktype %d count %d", t->tag, t->score, t->blocktype, t->count);
44 056fe1ba 2003-11-23 devnull case VtRread:
45 056fe1ba 2003-11-23 devnull return fmtprint(f, "Rread tag %ud count %d", t->tag, packetsize(t->data));
46 056fe1ba 2003-11-23 devnull case VtTwrite:
47 7643b263 2005-07-13 devnull return fmtprint(f, "Twrite tag %ud blocktype %d count %d", t->tag, t->blocktype, packetsize(t->data));
48 056fe1ba 2003-11-23 devnull case VtRwrite:
49 056fe1ba 2003-11-23 devnull return fmtprint(f, "Rwrite tag %ud score %V", t->tag, t->score);
50 056fe1ba 2003-11-23 devnull case VtTsync:
51 056fe1ba 2003-11-23 devnull return fmtprint(f, "Tsync tag %ud", t->tag);
52 056fe1ba 2003-11-23 devnull case VtRsync:
53 056fe1ba 2003-11-23 devnull return fmtprint(f, "Rsync tag %ud", t->tag);
54 056fe1ba 2003-11-23 devnull }
55 056fe1ba 2003-11-23 devnull }