Class: PacketGen::Header::EAP::TLS
- Inherits:
-
PacketGen::Header::EAP
- Object
- Types::Fields
- 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:
-
optionally #tls_length (Types::Int32), if
#l?
istrue
,
Constant Summary
Constants inherited from PacketGen::Header::EAP
Instance Attribute Summary collapse
-
#flags ⇒ Integer
8-bit flags.
-
#l ⇒ Boolean
Say if length field is included.
-
#m ⇒ Boolean
Say if there are more fragments.
-
#s ⇒ Boolean
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, #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
Methods inherited from Types::Fields
#[], #[]=, #bits_on, define_bit_fields_on, define_field, define_field_after, define_field_before, #fields, fields, inherited, #initialize, #offset_of, #optional?, #optional_fields, #present?, #read, remove_bit_fields_on, remove_field, #sz, #to_h, #to_s, update_field
Constructor Details
This class inherits a constructor from PacketGen::Header::EAP
Instance Attribute Details
#flags ⇒ Integer
Returns 8-bit flags.
25 |
# File 'lib/packetgen/header/eap/tls.rb', line 25 define_field_before :body, :flags, Types::Int8 |
#l ⇒ Boolean
Say if length field is included. Defined on #flags field.
36 |
# File 'lib/packetgen/header/eap/tls.rb', line 36 define_bit_fields_on :flags, :l, :m, :s, :reserved, 5 |
#m ⇒ Boolean
Say if there are more fragments. Defined on #flags field.
36 |
# File 'lib/packetgen/header/eap/tls.rb', line 36 define_bit_fields_on :flags, :l, :m, :s, :reserved, 5 |
#s ⇒ Boolean
If set, this message is a TLS-Start. Defined on #flags field.
36 |
# File 'lib/packetgen/header/eap/tls.rb', line 36 define_bit_fields_on :flags, :l, :m, :s, :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).
46 47 |
# File 'lib/packetgen/header/eap/tls.rb', line 46 define_field_before :body, :tls_length, Types::Int32, optional: ->(h) { h.l? } |
Instance Method Details
#inspect ⇒ String
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/packetgen/header/eap/tls.rb', line 50 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 |