From 8ad9068e70695463c2458518581eec187e503629 Mon Sep 17 00:00:00 2001 From: Toby Date: Wed, 8 May 2024 17:46:26 -0700 Subject: [PATCH] new pcap --- docs/docs/build-run.md | 10 ++++------ docs/docs/build-run.zh.md | 8 +++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/docs/build-run.md b/docs/docs/build-run.md index 4a36d3b..4de4d48 100644 --- a/docs/docs/build-run.md +++ b/docs/docs/build-run.md @@ -5,9 +5,7 @@ title: Build & Run ### Build ```shell -sudo apt install -y libpcap-dev -# or whatever it takes to install libpcap-dev on your system - +export CGO_ENABLED=0 go build ``` @@ -20,13 +18,13 @@ export OPENGFW_LOG_LEVEL=debug Where `config.yaml` is the config file and `rules.yaml` is the rules file. -#### pcap file mode +#### pcap file replay mode ```shell ./OpenGFW -p your.pcap -c config.yaml rules.yaml ``` -In pcap mode, none of the actions in the rules have any effect. This is mainly for debugging purposes. +In pcap mode, none of the actions in the rules have any effect. This mode is mainly for debugging. #### OpenWrt @@ -70,4 +68,4 @@ replay: 2. Set to true if you want to send RST for blocked TCP connections, **local=false only** 3. Recommended to be no more than the number of CPU cores 4. How long a connection is considered dead when no data is being transferred. Dead connections are purged from TCP reassembly pools once per minute. -5. Set to true if you want to playback the packets in the pcap file in "real time" (instead of as fast as possible) +5. Set to true if you want to replay the packets in the pcap file in "real time" (instead of as fast as possible) diff --git a/docs/docs/build-run.zh.md b/docs/docs/build-run.zh.md index b553cf8..8e3cab5 100644 --- a/docs/docs/build-run.zh.md +++ b/docs/docs/build-run.zh.md @@ -5,9 +5,7 @@ title: 构建与运行 ### 构建 ```shell -sudo apt install -y libpcap-dev -# 或者在你使用的发行版上安装 libpcap-dev 的对应命令 - +export CGO_ENABLED=0 go build ``` @@ -20,7 +18,7 @@ export OPENGFW_LOG_LEVEL=debug 其中 `config.yaml` 是配置文件,`rules.yaml` 是规则文件。 -#### pcap 文件模式 +#### pcap 文件回放模式 ```shell ./OpenGFW -p your.pcap -c config.yaml rules.yaml @@ -70,4 +68,4 @@ replay: 2. 如果想为被阻断的 TCP 连接发送 RST,设置为 true。**仅在 local=false 时有效** 3. 建议不超过 CPU 核心数 4. 一个连接多久没有数据传输后会被认为是死连接。TCP 重组的连接池会以每分钟一次的频率清理死连接 -5. 是否按照 pcap 文件中的时间戳以实时速度回放每个数据包 +5. 如果希望以实时速度(pcap 文件中的时间戳)回放 pcap 中的数据包(而不是以能处理的最快速度),设置为 true