class PacketGen::Header::Dot11::Control
IEEE 802.11 control frame header
This class make a {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}).
@author Sylvain Daubert
Constants
Public Class Methods
new(options={})
click to toggle source
@param [Hash] options @see Base#initialize
Calls superclass method
PacketGen::Header::Dot11::new
# File lib/packetgen/header/dot11/control.rb, line 44 def initialize(options={}) super({ type: 1 }.merge!(options)) @applicable_fields -= %i[mac3 sequence_ctrl mac4 qos_ctrl ht_ctrl] define_applicable_fields end
Public Instance Methods
human_subtype()
click to toggle source
Get human readable subtype @return [String]
# File lib/packetgen/header/dot11/control.rb, line 52 def human_subtype SUBTYPES[subtype] || subtype.to_s end
Private Instance Methods
define_applicable_fields()
click to toggle source
Calls superclass method
PacketGen::Header::Dot11#define_applicable_fields
# File lib/packetgen/header/dot11/control.rb, line 58 def define_applicable_fields super if @applicable_fields.include? :mac2 @applicable_fields -= %i[mac2] unless SUBTYPES_WITH_MAC2.include? self.subtype elsif SUBTYPES_WITH_MAC2.include? self.subtype @applicable_fields[3, 0] = :mac2 end end