Class: PacketGen::Header::RadioTap
- Inherits:
-
Base
- Object
- Types::Fields
- Base
- PacketGen::Header::RadioTap
- Defined in:
- lib/packetgen/header/dot11.rb
Overview
Radiotap header (see www.radiotap.org/)
Instance Attribute Summary collapse
- #body ⇒ Type::String
-
#length ⇒ Integer
16-bit RadioTap header length.
-
#pad ⇒ Integer
8-bit pad.
-
#present_flags ⇒ Integer
32-bit integer.
-
#radio_fields ⇒ Type::String
Concatenation of RadioTap fields.
-
#version ⇒ Integer
8-bit version.
Instance Method Summary collapse
-
#calc_length ⇒ Integer
Calculate header length.
-
#parse? ⇒ Boolean
Check version field.
-
#to_w(iface) ⇒ void
send RadioTap packet on wire.
Methods inherited from Base
bind, calculate_and_set_length, #header_id, inherited, #initialize, #ip_header, #ll_header
Methods included from PacketGen::Headerable
#added_to_packet, included, #method_name, #packet, #packet=, #protocol_name, #read
Methods inherited from Types::Fields
#[], #[]=, #bits_on, define_bit_fields_on, define_field, define_field_after, define_field_before, #fields, fields, inherited, #initialize, #inspect, #offset_of, #optional?, #optional_fields, #present?, #read, remove_bit_fields_on, remove_field, #sz, #to_h, #to_s, update_field
Constructor Details
This class inherits a constructor from PacketGen::Header::Base
Instance Attribute Details
#body ⇒ Type::String
83 |
# File 'lib/packetgen/header/dot11.rb', line 83 define_field :body, Types::String |
#length ⇒ Integer
Returns 16-bit RadioTap header length.
74 |
# File 'lib/packetgen/header/dot11.rb', line 74 define_field :length, Types::Int16le, default: 8 |
#pad ⇒ Integer
Returns 8-bit pad.
71 |
# File 'lib/packetgen/header/dot11.rb', line 71 define_field :pad, Types::Int8, default: 0 |
#present_flags ⇒ Integer
Returns 32-bit integer.
77 |
# File 'lib/packetgen/header/dot11.rb', line 77 define_field :present_flags, Types::Int32le |
Instance Method Details
#calc_length ⇒ Integer
Calculate header length
94 95 96 |
# File 'lib/packetgen/header/dot11.rb', line 94 def calc_length self[:length].value = self.sz - self[:body].sz end |
#parse? ⇒ Boolean
Check version field
87 88 89 |
# File 'lib/packetgen/header/dot11.rb', line 87 def parse? version.zero? && (length >= 8) end |