Skip to content

Commit

Permalink
new pcap
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyxdd committed May 9, 2024
1 parent 3bf69c5 commit 8ad9068
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
10 changes: 4 additions & 6 deletions docs/docs/build-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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

Expand Down Expand Up @@ -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)
8 changes: 3 additions & 5 deletions docs/docs/build-run.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ title: 构建与运行
### 构建

```shell
sudo apt install -y libpcap-dev
# 或者在你使用的发行版上安装 libpcap-dev 的对应命令

export CGO_ENABLED=0
go build
```

Expand All @@ -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
Expand Down Expand Up @@ -70,4 +68,4 @@ replay:
2. 如果想为被阻断的 TCP 连接发送 RST,设置为 true。**仅在 local=false 时有效**
3. 建议不超过 CPU 核心数
4. 一个连接多久没有数据传输后会被认为是死连接。TCP 重组的连接池会以每分钟一次的频率清理死连接
5. 是否按照 pcap 文件中的时间戳以实时速度回放每个数据包
5. 如果希望以实时速度(pcap 文件中的时间戳)回放 pcap 中的数据包(而不是以能处理的最快速度),设置为 true

0 comments on commit 8ad9068

Please sign in to comment.