Class: Wifimap::Parser::Airodump
- Inherits:
-
Object
- Object
- Wifimap::Parser::Airodump
- Includes:
- Wifimap::Parsable
- Defined in:
- lib/wifimap/parser/airodump.rb
Overview
Parse the content of an airodump.csv file.
Instance Method Summary collapse
-
#access_points ⇒ Array
Get the list of access points from the dump.
-
#initialize(dump) ⇒ Airodump
constructor
A new instance of Airodump.
-
#stations ⇒ Array
Get the list of stations from the dump.
Methods included from Wifimap::Parsable
Constructor Details
#initialize(dump) ⇒ Airodump
Returns a new instance of Airodump.
9 10 11 |
# File 'lib/wifimap/parser/airodump.rb', line 9 def initialize(dump) @dump = dump end |
Instance Method Details
#access_points ⇒ Array
Get the list of access points from the dump.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/wifimap/parser/airodump.rb', line 16 def access_points dump_row_fields .filter { |row| valid_access_point?(row) } .map do |fields| AccessPoint.new( bssid: fields.first, privacy: fields[5].strip, essid: fields[13].strip ) end end |
#stations ⇒ Array
Get the list of stations from the dump.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/wifimap/parser/airodump.rb', line 31 def stations dump_row_fields .filter { |row| valid_station?(row) } .map do |fields| station = Station.new(mac: fields.first) station.associations << fields[5].strip unless fields[5].include?('(not associated)') station.probes << fields[6].strip unless fields[6].strip.empty? station end end |