Class: PacketGen::Header::SCTP::CookieEchoChunk

Inherits:
BaseChunk show all
Defined in:
lib/packetgen/header/sctp/chunk.rb

Overview

Cookie Echo Chunk

       0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Type = 10   |  Chunk Flags  |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                            Cookie                             /
\                                                               \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Author:

  • Sylvain Daubert

Since:

  • 3.4.0

Constant Summary

Constants inherited from BaseChunk

BaseChunk::TYPES

Instance Attribute Summary collapse

Attributes inherited from BaseChunk

#length, #type

Instance Method Summary collapse

Methods inherited from BaseChunk

#calc_length, #human_type, #to_human

Methods included from Padded32

#padded?, #to_s

Methods inherited from Base

bind, calculate_and_set_length, #header_id, inherited, #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, #inspect, #offset_of, #optional?, #optional_fields, #present?, #read, remove_bit_fields_on, remove_field, #sz, #to_h, #to_s, update_field

Constructor Details

#initialize(options = {}) ⇒ CookieEchoChunk

Returns a new instance of CookieEchoChunk.

Since:

  • 3.4.0



506
507
508
509
# File 'lib/packetgen/header/sctp/chunk.rb', line 506

def initialize(options={})
  options[:type] = BaseChunk::TYPES['COOKIE_ECHO'] unless options.key?(:type)
  super
end

Instance Attribute Details

Returns:

  • (String)


504
# File 'lib/packetgen/header/sctp/chunk.rb', line 504

define_field :cookie, Types::String