DIY-pcap 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +2 -1
- data/lib/diy/controller.rb +1 -0
- data/lib/diy/version.rb +1 -1
- data/lib/diy/worker.rb +5 -1
- data/simple/pcap.rb +1 -0
- metadata +2 -2
data/README.md
CHANGED
@@ -49,7 +49,8 @@ DIY::Builder.new do
|
|
49
49
|
pcapfile "pcaps/simple.pcap"
|
50
50
|
use DIY::SimpleStrategy.new
|
51
51
|
client "x.x.x.x" # 配置客户端ip, 缺省端口为7878
|
52
|
-
server "x.x.x.x" # 配置服务端ip, 缺省端口为7879
|
52
|
+
server "x.x.x.x" # 配置服务端ip, 缺省端口为7879
|
53
|
+
me "x.x.x.x" # 配置控制端ip, 缺省端口为7880, 以上都可以写为 x.x.x.x:x 的形式, 与 rpcap或pcap的 -i 参数对应
|
53
54
|
end
|
54
55
|
```
|
55
56
|
3. 使用方法( 准备三台主机或逻辑主机, 只是试验的话可以使用 `127.0.0.1` )
|
data/lib/diy/controller.rb
CHANGED
data/lib/diy/version.rb
CHANGED
data/lib/diy/worker.rb
CHANGED
@@ -24,7 +24,11 @@ module DIY
|
|
24
24
|
DIY::Logger.info "start thread recving pkt..."
|
25
25
|
@live.loop do |this, pkt|
|
26
26
|
next unless @start
|
27
|
-
|
27
|
+
begin
|
28
|
+
@block.call(pkt.body) if @block
|
29
|
+
rescue DRb::DRbconnError
|
30
|
+
DIY::Logger.info "closed connection by controller"
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
30
34
|
end
|
data/simple/pcap.rb
CHANGED