nflog 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nflog.rb +9 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e672012c03d1dea27899e34419d0332b6349b108
|
4
|
+
data.tar.gz: a099ab145e6aa8b7f5759ea0fa8271ab03d4e0c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60dcb1ccd32cdd420d7b1c4866e55ca641c5d1a62a0434b2471bf87742b2d542d9ca4557bcfd2ddd744d0fda8b34b07c44eb06330a73f3b24671a354f634ba9f
|
7
|
+
data.tar.gz: a5b6290feae8ed0ae40ad677d699178026c18b0ebecddbd0c0f7d3612b0beab5cdfa0ee601b10483e76a6b4c11902af4204d2042497b7fa24eb9915013c35347
|
data/lib/nflog.rb
CHANGED
@@ -319,7 +319,15 @@ module Netfilter
|
|
319
319
|
|
320
320
|
set_mode(mode)
|
321
321
|
|
322
|
-
|
322
|
+
@callback = Proc.new {|packet| raise LogError, "Undefined callback method."}
|
323
|
+
@callback_handler =
|
324
|
+
FFI::Function.new(:int, [:pointer, :pointer, :pointer, :buffer_in]) do |nflog_group, nfmsg, nfad, data|
|
325
|
+
packet = Packet.new(self, nfad)
|
326
|
+
|
327
|
+
@callback[packet]
|
328
|
+
end
|
329
|
+
|
330
|
+
Log.nflog_callback_register(@nflog_group, @callback_handler, nil)
|
323
331
|
end
|
324
332
|
|
325
333
|
#
|
@@ -403,12 +411,6 @@ module Netfilter
|
|
403
411
|
|
404
412
|
private
|
405
413
|
|
406
|
-
def callback_handler(nflog_group, nfmsg, nfad, data)
|
407
|
-
packet = Packet.new(self, nfad)
|
408
|
-
|
409
|
-
@callback[packet]
|
410
|
-
end
|
411
|
-
|
412
414
|
def close
|
413
415
|
Log.nflog_close(@nflog_handle)
|
414
416
|
end
|