Class: HiddenHippo::Extractors::WpsExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/hidden_hippo/extractors/wps_extractor.rb

Instance Method Summary collapse

Constructor Details

#initialize(queue) ⇒ WpsExtractor

Returns a new instance of WpsExtractor.



6
7
8
# File 'lib/hidden_hippo/extractors/wps_extractor.rb', line 6

def initialize(queue)
  @queue = queue
end

Instance Method Details

#call(packet) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/hidden_hippo/extractors/wps_extractor.rb', line 10

def call(packet)
  fields = {
    device_name: packet.device_name,
    device_model_name: packet.device_model_number,
    device_model_number: packet.device_model_number,
    device_manufacturer: packet.device_manufacturer,
    device_oui: packet.device_oui
  }
   
  @queue << Update.new(packet.mac_src, fields.delete_if{|_, v| v.nil?})
end