diff options
author | We-unite <3205135446@qq.com> | 2024-08-19 19:41:01 +0800 |
---|---|---|
committer | We-unite <3205135446@qq.com> | 2024-08-22 14:12:01 +0800 |
commit | f9f8f35ccd8b505a827d40f95c52ed039512b79d (patch) | |
tree | 241c393f6b865958191df802cd112f26d40dddc4 /listener/global.go | |
parent | ae4957b41156d576e849ec0424edd4d89d8d49f2 (diff) | |
download | godo-f9f8f35ccd8b505a827d40f95c52ed039512b79d.tar.gz godo-f9f8f35ccd8b505a827d40f95c52ed039512b79d.zip |
Write documents of the program.
Add README.md on the design of the whole program, and how its every
part(listener, filter) works, finally how to compile and use them.
Besides, notes.md records the things and technology learned in this
program, such as how to read kernel src, how the pthread_create/fork/
clone syscall works on processes and threads, the techs used to make
docker container works well, and books to be read. Good good study,
day day up.
Diffstat (limited to '')
-rw-r--r-- | listener/global.go | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/listener/global.go b/listener/global.go index b782284..49d6e94 100644 --- a/listener/global.go +++ b/listener/global.go | |||
@@ -44,12 +44,6 @@ type Event struct { | |||
44 | destPath string | 44 | destPath string |
45 | } | 45 | } |
46 | 46 | ||
47 | var wg sync.WaitGroup // 掌管协程 | ||
48 | var rawChan chan interface{} // 从接收到整理的管道 | ||
49 | var cookedChan chan Event // 整理好的信息的管道 | ||
50 | var syscallTable [500]string //记录一下系统调用 | ||
51 | var containerdPid int | ||
52 | |||
53 | // 插入到数据库的结构 | 47 | // 插入到数据库的结构 |
54 | type Exec struct { | 48 | type Exec struct { |
55 | Timestamp time.Time `bson:"timestamp"` | 49 | Timestamp time.Time `bson:"timestamp"` |
@@ -84,3 +78,17 @@ type File struct { | |||
84 | Written []time.Time `bson:"written"` | 78 | Written []time.Time `bson:"written"` |
85 | CloseTimestamp time.Time `bson:"close_timestamp"` | 79 | CloseTimestamp time.Time `bson:"close_timestamp"` |
86 | } | 80 | } |
81 | |||
82 | const ( | ||
83 | dbName string = "test" | ||
84 | pidColName string = "pids" | ||
85 | fdColName string = "fds" | ||
86 | fileColName string = "files" | ||
87 | ) | ||
88 | |||
89 | var wg sync.WaitGroup // 掌管协程 | ||
90 | var rawChan chan interface{} // 从接收到整理的管道 | ||
91 | var cookedChan chan Event // 整理好的信息的管道 | ||
92 | var syscallTable [500]string //记录一下系统调用 | ||
93 | var containerdPid int // 容器守护进程进程号 | ||
94 | var pidCol, fdCol, fileCol mongoClient // 数据库集合 | ||