Class: Dot11::Dot11::SNAP

Inherits:
Packet
  • Object
show all
Defined in:
lib/dot11/dot11.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Packet

#=~, #initialize, new, older_new, #to_filter

Constructor Details

This class inherits a constructor from Dot11::Packet

Instance Attribute Details

#codeObject

Returns the value of attribute code.



937
938
939
# File 'lib/dot11/dot11.rb', line 937

def code
  @code
end

#ouiObject

Returns the value of attribute oui.



937
938
939
# File 'lib/dot11/dot11.rb', line 937

def oui
  @oui
end

#payloadObject

Returns the value of attribute payload.



937
938
939
# File 'lib/dot11/dot11.rb', line 937

def payload
  @payload
end

Instance Method Details

#/(other) ⇒ Object



957
958
959
960
# File 'lib/dot11/dot11.rb', line 957

def /(other)
  @payload = other
  self
end

#dataObject



939
940
941
# File 'lib/dot11/dot11.rb', line 939

def data
  [oui, code].pack("QXv") + payload.data
end

#to_sObject



943
944
945
946
947
948
949
# File 'lib/dot11/dot11.rb', line 943

def to_s
  "SNAP\n" +
  "-------\n" +
  "oui: #{oui}\n" +
  "code: #{code}\n" + 
  (if payload then "payload:\n#{payload.to_s.indent(6)}" else "" end)
end