lib/packetgen/header/dot11/sub_mngt.rb in packetgen-2.6.0 vs lib/packetgen/header/dot11/sub_mngt.rb in packetgen-2.7.0
- old
+ new
@@ -7,11 +7,10 @@
# frozen_string_literal: true
module PacketGen
module Header
class Dot11
-
# @abstract Base class for all subtype management frames
# Subclasses of this class are used to specialize {Management}. A
# +SubMngt+ class set +subtype+ field in Dot11 header and may add some
# fields.
#
@@ -50,11 +49,11 @@
@elements.each do |el|
str << Inspect.shift_level(4) << el.to_human << "\n"
end
str
end
-
+
# Add an {Element} to header
# @param [Integer,String] type element type
# @param [Object] value element value
# @return [self]
# @since 2.1.3
@@ -67,11 +66,11 @@
private
def read_elements(str)
start = 0
elsz = Element.new.sz
- while str.size - start >= elsz do
+ while str.size - start >= elsz
el = Element.new.read(str[start, str.size])
@elements << el
start += el.sz
end
end
@@ -92,11 +91,11 @@
# @!attribute listen_interval
# @return [Integer] 16-bit listen interval value
define_field :listen_interval, Types::Int16le, default: 0x00c8
end
Header.add_class AssoReq
- Management.bind_header AssoReq, op: :and, type: 0, subtype: 0
+ Management.bind AssoReq, type: 0, subtype: 0
# IEEE 802.11 Association Response frame
#
# Specialize {Dot11::Management} with +subtype+ set to 1.
#
@@ -115,11 +114,11 @@
# @!attribute aid
# @return [Integer] 16-bit AID word
define_field :aid, Types::Int16le
end
Header.add_class AssoResp
- Management.bind_header AssoResp, op: :and, type: 0, subtype: 1
+ Management.bind AssoResp, type: 0, subtype: 1
# IEEE 802.11 ReAssociation Request frame
#
# Specialize {Dot11::Management} with +subtype+ set to 2.
#
@@ -132,11 +131,11 @@
# @!attribute current_ap
# @return [Eth::MAcAddr]
define_field :current_ap, Eth::MacAddr
end
Header.add_class ReAssoReq
- Management.bind_header ReAssoReq, op: :and, type: 0, subtype: 2
+ Management.bind ReAssoReq, type: 0, subtype: 2
# IEEE 802.11 ReAssociation Response frame
#
# Specialize {Dot11::Management} with +subtype+ set to 3.
#
@@ -146,22 +145,22 @@
# * {#aid} ({Types::Int16le}).
# @author Sylvain Daubert
class ReAssoResp < AssoResp
end
Header.add_class ReAssoResp
- Management.bind_header ReAssoResp, op: :and, type: 0, subtype: 3
+ Management.bind ReAssoResp, type: 0, subtype: 3
# IEEE 802.11 Probe Request frame
#
# Specialize {Dot11::Management} with +subtype+ set to 4.
#
# This class adds no field.
# @author Sylvain Daubert
class ProbeReq < SubMngt
end
Header.add_class ProbeReq
- Management.bind_header ProbeReq, op: :and, type: 0, subtype: 4
+ Management.bind ProbeReq, type: 0, subtype: 4
# IEEE 802.11 Probe Response frame
#
# Specialize {Dot11::Management} with +subtype+ set to 5.
#
@@ -180,11 +179,11 @@
# @!attribute cap
# @return [Integer] 16-bit capabillities word
define_field :cap, Types::Int16le
end
Header.add_class ProbeResp
- Management.bind_header ProbeResp, op: :and, type: 0, subtype: 5
+ Management.bind ProbeResp, type: 0, subtype: 5
# IEEE 802.11 Beacon frame
#
# Specialize {Dot11::Management} with +subtype+ set to 8.
#
@@ -203,21 +202,21 @@
# @!attribute cap
# @return [Integer] 16-bit capabillities word
define_field :cap, Types::Int16le
end
Header.add_class Beacon
- Management.bind_header Beacon, op: :and, type: 0, subtype: 8
+ Management.bind Beacon, type: 0, subtype: 8
# IEEE 802.11 ATIM frame
#
# Specialize {Dot11::Management} with +subtype+ set to 9.
#
# This class defines no field.
# @author Sylvain Daubert
class ATIM < SubMngt; end
Header.add_class ATIM
- Management.bind_header ATIM, op: :and, type: 0, subtype: 9
+ Management.bind ATIM, type: 0, subtype: 9
# IEEE 802.11 Disassociation frame
#
# Specialize {Dot11::Management} with +subtype+ set to 10.
#
@@ -228,11 +227,11 @@
# @!attribute reason
# @return [Integer] 16-bit reason value
define_field :reason, Types::Int16le
end
Header.add_class Disas
- Management.bind_header Disas, op: :and, type: 0, subtype: 10
+ Management.bind Disas, type: 0, subtype: 10
# IEEE 802.11 Authentication frame
#
# Specialize {Dot11::Management} with +subtype+ set to 11.
#
@@ -251,11 +250,11 @@
# @!attribute status
# @return [Integer] 16-bit status word
define_field :status, Types::Int16le
end
Header.add_class Auth
- Management.bind_header Auth, op: :and, type: 0, subtype: 11
+ Management.bind Auth, type: 0, subtype: 11
# IEEE 802.11 Deauthentication frame
#
# Specialize {Dot11::Management} with +subtype+ set to 12.
#
@@ -266,9 +265,9 @@
# @!attribute reason
# @return [Integer] 16-bit reason value
define_field :reason, Types::Int16le
end
Header.add_class DeAuth
- Management.bind_header DeAuth, op: :and, type: 0, subtype: 12
+ Management.bind DeAuth, type: 0, subtype: 12
end
end
end