Class: PacketGen::Header::EAP::TLS
- Inherits:
-
PacketGen::Header::EAP
- Object
- BinStruct::Struct
- Base
- PacketGen::Header::EAP
- PacketGen::Header::EAP::TLS
- Defined in:
- lib/packetgen/header/eap/tls.rb
Overview
Extensible Authentication Protocol (EAP) - TLS, RFC 5216
TLS has following fields:
-
#flags (
BinStruct::Int8
), -
optionally #tls_length (
BinStruct::Int32
), if#l?
istrue
, -
#body (
BinStruct::String
).
Constant Summary
Constants inherited from PacketGen::Header::EAP
Instance Attribute Summary collapse
-
#flags ⇒ Integer
8-bit flags.
-
#l? ⇒ Integer
(also: #length_present?)
Say if 32-bit TLS length attribute is included.
-
#m? ⇒ Integer
(also: #more_fragments?)
Say if there are more fragments.
-
#s? ⇒ Integer
(also: #tls_start?)
If set, this message is a TLS-Start.
-
#tls_length ⇒ Integer
TLS message length.
Attributes inherited from PacketGen::Header::EAP
#body, #code, #id, #length, #type, #vendor_id, #vendor_type
Instance Method Summary collapse
Methods inherited from PacketGen::Header::EAP
#added_to_packet, #calc_length, #desired_auth_type, #failure?, #human_code, #human_type, #initialize, #nak?, #old_read, #read, #reply!, #request?, #response?, #success?, #type?
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=, #parse?, #protocol_name, #read, #to_s
Constructor Details
This class inherits a constructor from PacketGen::Header::EAP
Instance Attribute Details
#flags ⇒ Integer
8-bit flags
35 |
# File 'lib/packetgen/header/eap/tls.rb', line 35 define_bit_attr_before :body, :flags, l: 1, m: 1, s: 1, reserved: 5 |
#l? ⇒ Integer Also known as: length_present?
Say if 32-bit TLS length attribute is included.
35 |
# File 'lib/packetgen/header/eap/tls.rb', line 35 define_bit_attr_before :body, :flags, l: 1, m: 1, s: 1, reserved: 5 |
#m? ⇒ Integer Also known as: more_fragments?
Say if there are more fragments
35 |
# File 'lib/packetgen/header/eap/tls.rb', line 35 define_bit_attr_before :body, :flags, l: 1, m: 1, s: 1, reserved: 5 |
#s? ⇒ Integer Also known as: tls_start?
If set, this message is a TLS-Start
35 |
# File 'lib/packetgen/header/eap/tls.rb', line 35 define_bit_attr_before :body, :flags, l: 1, m: 1, s: 1, reserved: 5 |
#tls_length ⇒ Integer
TLS message length. This field provides the total length of the TLS message or set of messages that is being fragmented. So, it cannot be automatically calculated (no #calc_length
method).
45 46 |
# File 'lib/packetgen/header/eap/tls.rb', line 45 define_attr_before :body, :tls_length, BinStruct::Int32, optional: lambda(&:l?) |
Instance Method Details
#inspect ⇒ String
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/packetgen/header/eap/tls.rb', line 49 def inspect super do |attr| next unless attr == :flags str = Inspect.shift_level value = %i[l m s].map { |f| send(:"#{f}?") ? f.to_s : '.' }.join value = '%-16s (0x%02x)' % [value, self.flags] str << Inspect::FMT_ATTR % [self[attr].class.to_s.sub(/.*::/, ''), attr, value] end end |