class PacketGen::Header::Dot1x
IEEE 802.1X / EAPOL
A IEEE 802.1X header consists of:
-
a {#version} ({Types::Int8}),
-
a packet {#type} ({Types::Int8}),
-
a {#length} ({Types::Int16}),
-
and a body (a {Types::String} or another
Header
class).
Create a Dot1x
header¶ ↑
pkt1 = PacketGen.gen('Eth').add('Dot1x', type: 1) pkt2 = PacketGen.gen('Eth').add('Dot1x') pkt2.dot1x.type = 'EAP Packet' pkt2.dot1x.body.read 'body'
@author Sylvain Daubert @since 1.4.0
Constants
- ETHERTYPE
IEEE 802.1x Ether type
- TYPES
IEEE 802.1X packet types
Public Instance Methods
calc_length()
click to toggle source
Calculate and set body length @return [Integer] @since 2.1.4
# File lib/packetgen/header/dot1x.rb, line 59 def calc_length Base.calculate_and_set_length self, header_in_size: false end
human_type()
click to toggle source
Get human readable type @return [String]
# File lib/packetgen/header/dot1x.rb, line 52 def human_type self[:type].to_human end