diff options
Diffstat (limited to 'src/global.go')
-rw-r--r-- | src/global.go | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/global.go b/src/global.go deleted file mode 100644 index 349ba6c..0000000 --- a/src/global.go +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | package main | ||
2 | |||
3 | import ( | ||
4 | "sync" | ||
5 | "time" | ||
6 | ) | ||
7 | |||
8 | type eventType int | ||
9 | |||
10 | const ( | ||
11 | NEWPID eventType = iota | ||
12 | PIDEXIT | ||
13 | EXECVE | ||
14 | FILEOPEN | ||
15 | FILECLOSE | ||
16 | FILEWRITE | ||
17 | PIVOTROOT | ||
18 | TYPENUM | ||
19 | ) | ||
20 | |||
21 | func (et eventType) String() string { | ||
22 | names := []string{"NEWPID", "PIDEXIT", "EXECVE", "FILEOPEN", "FILECLOSE", "FILEWRITE", "PIVOTROOT", "TYPENUM"} | ||
23 | if et < NEWPID || et > TYPENUM { | ||
24 | return "Unknown" | ||
25 | } | ||
26 | return names[et] | ||
27 | } | ||
28 | |||
29 | type Event struct { | ||
30 | tag eventType | ||
31 | timestamp time.Time | ||
32 | pid, tgid int | ||
33 | ppid, parentTgid int | ||
34 | syscall int | ||
35 | syscallParam [4]uint64 | ||
36 | argc int | ||
37 | argv []string | ||
38 | cwd string | ||
39 | exit_code uint64 | ||
40 | exit_signal int | ||
41 | srcPath string | ||
42 | destPath string | ||
43 | } | ||
44 | |||
45 | var wg sync.WaitGroup // 掌管协程 | ||
46 | var rawChan chan interface{} // 从接收到整理的管道 | ||
47 | var cookedChan chan Event // 整理好的信息的管道 | ||
48 | var syscallTable [500]string //记录一下系统调用 | ||
49 | var containerdPid int | ||