forked from dhiltgen/go-owfs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
defs.go
46 lines (42 loc) · 971 Bytes
/
defs.go
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
package owfs
import (
"log"
)
const (
msg_error = iota
msg_nop = iota
msg_read = iota
msg_write = iota
msg_dir = iota
msg_size = iota // unused
msg_presence = iota
msg_dirall = iota
msg_get = iota
msg_dirallslash = iota
msg_getslash = iota
)
type RequestHeader struct {
Version int32
PayloadLength int32
Type int32
Flags int32
Size int32
Offset int32
}
type ResponseHeader struct {
Version int32
PayloadLength int32
Ret int32
Flags int32
Size int32
Offset int32
}
func (h ResponseHeader) dump() {
log.Println("Response Header")
log.Println(" Version: ", h.Version)
log.Println(" PayloadLength: ", h.PayloadLength)
log.Println(" Ret: ", h.Ret)
log.Println(" Flags: ", h.Flags)
log.Println(" Size: ", h.Size)
log.Println(" Offset: ", h.Offset)
}