Class: PacketGen::Header::EAP::TTLS
- Inherits:
-
PacketGen::Header::EAP
- Object
- Types::Fields
- Base
- PacketGen::Header::EAP
- PacketGen::Header::EAP::TTLS
- Defined in:
- lib/packetgen/header/eap/ttls.rb
Overview
Extensible Authentication Protocol (EAP) - Tunneled-TLS, RFC 5281
TTLS has following fields:
-
optionally #message_length (Types::Int32), if
#l?
istrue
,
Direct Known Subclasses
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.
-
#message_length ⇒ Integer
Message length.
-
#reserved ⇒ Integer
2-bit reserved integer.
-
#s ⇒ Boolean
If set, this message is a TLS-Start.
-
#version ⇒ Integer
3-bit version.
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/ttls.rb', line 25 define_field_before :body, :flags, Types::Int8 |
#l ⇒ Boolean
Say if length field is included. Defined on #flags field.
40 |
# File 'lib/packetgen/header/eap/ttls.rb', line 40 define_bit_fields_on :flags, :l, :m, :s, :reserved, 2, :version, 3 |
#m ⇒ Boolean
Say if there are more fragments. Defined on #flags field.
40 |
# File 'lib/packetgen/header/eap/ttls.rb', line 40 define_bit_fields_on :flags, :l, :m, :s, :reserved, 2, :version, 3 |
#message_length ⇒ Integer
Message length. This field provides the total length of the raw data message sequence prior to fragmentation. So, it cannot be automatically calculated (no #calc_length
method).
50 51 |
# File 'lib/packetgen/header/eap/ttls.rb', line 50 define_field_before :body, :message_length, Types::Int32, optional: ->(h) { h.l? } |
#reserved ⇒ Integer
Returns 2-bit reserved integer.
40 |
# File 'lib/packetgen/header/eap/ttls.rb', line 40 define_bit_fields_on :flags, :l, :m, :s, :reserved, 2, :version, 3 |
#s ⇒ Boolean
If set, this message is a TLS-Start. Defined on #flags field.
40 |
# File 'lib/packetgen/header/eap/ttls.rb', line 40 define_bit_fields_on :flags, :l, :m, :s, :reserved, 2, :version, 3 |
#version ⇒ Integer
Returns 3-bit version.
40 |
# File 'lib/packetgen/header/eap/ttls.rb', line 40 define_bit_fields_on :flags, :l, :m, :s, :reserved, 2, :version, 3 |
Instance Method Details
#inspect ⇒ String
54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/packetgen/header/eap/ttls.rb', line 54 def inspect super do |attr| next unless attr == :flags shift = Inspect.shift_level str = shift.dup 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] str << shift str << Inspect::FMT_ATTR % ['', 'version', self.version] end end |