Class: Dap::Filter::FilterDecodeUPNP_SSDP_Reply

Inherits:
Object
  • Object
show all
Includes:
BaseDecoder
Defined in:
lib/dap/filter/udp.rb

Overview

Decode a SSDP probe response ( zmap: upnp_1900.pkt )

Instance Attribute Summary

Attributes included from Base

#name, #opts

Instance Method Summary collapse

Methods included from BaseDecoder

#process

Methods included from Base

#initialize, #process

Instance Method Details

#decode(data) ⇒ Object



84
85
86
87
88
89
90
91
92
# File 'lib/dap/filter/udp.rb', line 84

def decode(data)
  head = { }
  data.split(/\n/).each do |line|
    k,v = line.strip.split(':', 2)
    next if not k
    head["upnp_#{k.downcase}"] = (v.to_s.strip)
  end
  head
end