Class: PacketGen::Header::Dot11::Control
- Inherits:
-
PacketGen::Header::Dot11
- Object
- Types::Fields
- Base
- PacketGen::Header::Dot11
- PacketGen::Header::Dot11::Control
- Defined in:
- lib/packetgen/header/dot11/control.rb
Overview
IEEE 802.11 control frame header
This class make a PacketGen::Header::Dot11 header with #type set to 1
(control frame).
A IEEE 802.11 control header consists of:
-
a #frame_ctrl (Types::Int16),
-
a #id/duration (Types::Int16le),
-
a #mac1 (Eth::MacAddr).
-
sometimes a #mac2 (Eth::MacAddr),
-
a #body (a Types::String or another Base class),
-
and a Frame check sequence (#fcs, of type Types::Int32le).
Constant Summary collapse
- SUBTYPES =
Control subtypes
{ 7 => 'Wrapper', 8 => 'Block Ack Request', 9 => 'Block Ack', 10 => 'PS-Poll', 11 => 'RTS', 12 => 'CTS', 13 => 'Ack', 14 => 'CF-End', 15 => 'CF-End+CF-Ack' }.freeze
- SUBTYPES_WITH_MAC2 =
Control subtypes with mac2 field
[9, 10, 11, 14, 15].freeze
Constants inherited from PacketGen::Header::Dot11
Instance Attribute Summary
Attributes inherited from PacketGen::Header::Dot11
#body, #fcs, #fragment_number, #frame_ctrl, #from_ds, #ht_ctrl, #id, #mac1, #mac2, #mac3, #mac4, #md, #mf, #order, #proto_version, #pwmngt, #qos_ctrl, #retry, #sequence_ctrl, #sequence_number, #subtype, #to_ds, #type, #wep
Instance Method Summary collapse
-
#human_subtype ⇒ String
Get human readable subtype.
-
#initialize(options = {}) ⇒ Control
constructor
A new instance of Control.
Methods inherited from PacketGen::Header::Dot11
#added_to_packet, #calc_checksum, #fields, #human_type, #inspect, #old_fields, #old_read, #read, #to_s, #to_w
Methods inherited from Base
bind, calculate_and_set_length, #header_id, inherited, #ip_header, #ll_header
Methods included from PacketGen::Headerable
#added_to_packet, included, #method_name, #packet, #packet=, #parse?, #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, #inspect, #offset_of, #optional?, #optional_fields, #present?, #read, remove_bit_fields_on, remove_field, #sz, #to_h, #to_s, update_field
Constructor Details
#initialize(options = {}) ⇒ Control
Returns a new instance of Control.
45 46 47 48 49 |
# File 'lib/packetgen/header/dot11/control.rb', line 45 def initialize(={}) super({ type: 1 }.merge!()) @applicable_fields -= %i[mac3 sequence_ctrl mac4 qos_ctrl ht_ctrl] define_applicable_fields end |
Instance Method Details
#human_subtype ⇒ String
Get human readable subtype
53 54 55 |
# File 'lib/packetgen/header/dot11/control.rb', line 53 def human_subtype SUBTYPES[subtype] || subtype.to_s end |