Class: PacketGen::Header::PPI
- Inherits:
-
Base
- Object
- Types::Fields
- Base
- PacketGen::Header::PPI
- Defined in:
- lib/packetgen/header/dot11.rb
Overview
PPI (Per-Packet Information) packet
Instance Attribute Summary collapse
-
#align ⇒ Boolean
Align flag from #flags attribute.
- #body ⇒ Type::String
-
#dlt ⇒ Integer
32-bit PPI data link type.
-
#flags ⇒ Integer
8-bit PPI flags.
-
#length ⇒ Integer
16-bit PPI header length.
-
#ppi_fields ⇒ Type::String
Concatenation of PPI fields.
-
#version ⇒ Integer
8-bit PPI version.
Instance Method Summary collapse
-
#calc_length ⇒ Integer
Calculate header length.
-
#parse? ⇒ Boolean
Check version field.
-
#to_w(iface) ⇒ void
send PPI 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
#align ⇒ Boolean
Returns align flag from #flags attribute.
38 |
# File 'lib/packetgen/header/dot11.rb', line 38 define_bit_fields_on :flags, :reserved, 7, :align |
#body ⇒ Type::String
35 |
# File 'lib/packetgen/header/dot11.rb', line 35 define_field :body, Types::String |
#dlt ⇒ Integer
Returns 32-bit PPI data link type.
29 |
# File 'lib/packetgen/header/dot11.rb', line 29 define_field :dlt, Types::Int32le |
#flags ⇒ Integer
Returns 8-bit PPI flags.
23 |
# File 'lib/packetgen/header/dot11.rb', line 23 define_field :flags, Types::Int8 |
#length ⇒ Integer
Returns 16-bit PPI header length.
26 |
# File 'lib/packetgen/header/dot11.rb', line 26 define_field :length, Types::Int16le, default: 8 |
Instance Method Details
#calc_length ⇒ Integer
Calculate header length
49 50 51 |
# File 'lib/packetgen/header/dot11.rb', line 49 def calc_length self[:length].value = self.sz - self[:body].sz end |
#parse? ⇒ Boolean
Check version field
42 43 44 |
# File 'lib/packetgen/header/dot11.rb', line 42 def parse? version.zero? && (length >= 8) end |