Class: Dap::Filter::FilterDecodeDTLS

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

Overview

Quickly decode a DTLS message

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



323
324
325
326
327
328
329
330
331
332
333
# File 'lib/dap/filter/udp.rb', line 323

def decode(data)
  return unless data.length >= 13
  info = Dap::Proto::DTLS::RecordLayer.new(data)
  return unless (info && info.valid?)
  {}.tap do |h|
    info.fields.each do |f|
      name = f.name
      h[name] = info.send(name).to_s
    end
  end
end