-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.go
74 lines (67 loc) · 1.18 KB
/
types.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package main
type param struct {
name string
paramType ArgType
}
type eventDefinition struct {
event string
params []param
}
type ArgType uint8
const (
noneT ArgType = iota
intT
uintT
longT
ulongT
offT
modeT
devT
sizeT
pointerT
strT
strArrT
sockAddrT
bytesT
u16T
credT
intArr2T
uint64ArrT
u8T
timespecT
tupleT
)
// These types don't match the ones defined in the ebpf code since they are not being used by syscalls arguments.
// They have their own set of value to avoid collision in the future.
const (
argsArrT ArgType = iota + 0x80
boolT
)
var argTypeNames = map[ArgType]string{
noneT: "noneT",
intT: "intT",
uintT: "uintT",
longT: "longT",
ulongT: "ulongT",
offT: "offT",
modeT: "modeT",
devT: "devT",
sizeT: "sizeT",
pointerT: "pointerT",
strT: "strT",
strArrT: "strArrT",
sockAddrT: "sockAddrT",
bytesT: "bytesT",
u16T: "u16T",
credT: "credT",
intArr2T: "intArr2T",
uint64ArrT: "uint64ArrT",
u8T: "u8T",
timespecT: "timespecT",
tupleT: "tupleT",
argsArrT: "argsArrT",
boolT: "boolT",
}
func (a ArgType) String() string {
return argTypeNames[a]
}