Class: Dap::Filter::FilterDecodeNATPMPExternalAddressResponse
- Inherits:
-
Object
- Object
- Dap::Filter::FilterDecodeNATPMPExternalAddressResponse
- Includes:
- BaseDecoder
- Defined in:
- lib/dap/filter/udp.rb
Overview
Decode a NAT-PMP External Address response
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from BaseDecoder
Methods included from Base
Instance Method Details
#decode(data) ⇒ Object
198 199 200 201 202 203 204 205 206 207 |
# File 'lib/dap/filter/udp.rb', line 198 def decode(data) return unless (data && data.size == Dap::Proto::NATPMP::REQUIRED_SIZE) info = Dap::Proto::NATPMP::ExternalAddressResponse.new(data) {}.tap do |h| info.fields.each do |f| name = f.name h[name] = info.send(name).to_s end end end |