Class: PacketGen::Header::NonESPMarker

Inherits:
Base show all
Defined in:
lib/packetgen/header/ike.rb

Overview

This class handles a pseudo-header used to differentiate ESP from IKE headers in a UDP datagram with port 4500.

Author:

  • Sylvain Daubert

Since:

  • 2.0.0

Instance Attribute Summary collapse

Attributes inherited from Base

#packet

Instance Method Summary collapse

Methods inherited from Base

#added_to_packet, bind, bind_header, calculate_and_set_length, #header_id, inherited, #initialize, #ip_header, known_headers, #ll_header, #method_name, #protocol_name, protocol_name

Methods inherited from Types::Fields

#[], #[]=, #bits_on, define_bit_fields_on, define_field, define_field_after, define_field_before, delete_field, fields, #fields, #force_binary, inherited, #initialize, #inspect, #is_optional?, #is_present?, #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::Base

Instance Attribute Details

#bodyTypes::String, Header::Base



21
# File 'lib/packetgen/header/ike.rb', line 21

define_field :body, Types::String

#non_esp_markerInteger

32-bit zero marker to differentiate IKE packet over UDP port 4500 from ESP ones

Returns:

  • (Integer)


18
# File 'lib/packetgen/header/ike.rb', line 18

define_field :non_esp_marker, Types::Int32, default: 0

Instance Method Details

#parse?Boolean

Check non_esp_marker field

Returns:

  • (Boolean)

See Also:

  • PacketGen::Header::NonESPMarker.[Base[Base#parse?]

Since:

  • 2.0.0



25
26
27
# File 'lib/packetgen/header/ike.rb', line 25

def parse?
  non_esp_marker.zero?
end