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