nflog 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nflog.rb +9 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6aa6e69a68ef3ae301732c9afa018aa22e1205a8
4
- data.tar.gz: 35fea54dd55b836fa85275045ca398433e7399a3
3
+ metadata.gz: e672012c03d1dea27899e34419d0332b6349b108
4
+ data.tar.gz: a099ab145e6aa8b7f5759ea0fa8271ab03d4e0c0
5
5
  SHA512:
6
- metadata.gz: 9868ad49be63e5933e2b8303fdc29321ffd5b0c478fc8c917dba517ce37defbe498e895315a59c4fb7db99cdb64ba9e34a42d28aaa359a9600592ae3e4f4140f
7
- data.tar.gz: 9a49e7fbb96b875bc420503e60eb0a4a4aa4acb932a80745e0d8ba2d9f9ab8348ba39339c5822da6a560d813191e08443d65c1c8be4560fa94facd4a61c3c064
6
+ metadata.gz: 60dcb1ccd32cdd420d7b1c4866e55ca641c5d1a62a0434b2471bf87742b2d542d9ca4557bcfd2ddd744d0fda8b34b07c44eb06330a73f3b24671a354f634ba9f
7
+ data.tar.gz: a5b6290feae8ed0ae40ad677d699178026c18b0ebecddbd0c0f7d3612b0beab5cdfa0ee601b10483e76a6b4c11902af4204d2042497b7fa24eb9915013c35347
@@ -319,7 +319,15 @@ module Netfilter
319
319
 
320
320
  set_mode(mode)
321
321
 
322
- Log.nflog_callback_register(@nflog_group, method(:callback_handler), nil)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nflog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Delugré