~moody/ninep

ref: 7b4c0484154111591a670ce6807bfbda3e864f36 ninep/message.go -rw-r--r-- 509 bytes
7b4c0484 — Jacob Moody More docs touchup 5 months ago
                                                                                
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
package ninep

//go:generate go run genproto.go

const (
	//byte codes for each 9p message type
	tversion = iota + 100
	rversion
	tauth
	rauth
	tattach
	rattach
	terror /* illegal */
	rerror
	tflush
	rflush
	twalk
	rwalk
	topen
	ropen
	tcreate
	rcreate
	tread
	rread
	twrite
	rwrite
	tclunk
	rclunk
	tremove
	rremove
	tstat
	rstat
	twstat
	rwstat
)

type message interface {
	size() int
	typ() byte
	tag() uint16
	encode(dst []byte)
	decode(src []byte)
}

type respFunc func(t message, r message, err string)