class PacketFu::InvalidHeader
InvalidHeader
catches all packets that we don’t already have a Struct
for, or for whatever reason, violates some basic packet rules for other packet types.
Public Class Methods
new(args={})
click to toggle source
Calls superclass method
# File lib/packetfu/protos/invalid.rb, line 9 def initialize(args={}) args[:body] ||= StructFu::String.new super(args[:body]) end
Public Instance Methods
read(str)
click to toggle source
Reads a string to populate the object.
# File lib/packetfu/protos/invalid.rb, line 20 def read(str) force_binary(str) return self if str.nil? self[:body].read str self end
to_s()
click to toggle source
Returns the object in string form.
# File lib/packetfu/protos/invalid.rb, line 15 def to_s self.to_a.map {|x| x.to_s}.join end