Class: PacketGen::Header::SCTP::SackChunk

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

Overview

Selective Acknowledge 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 = 3 | Chunk Flags | Chunk Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Cumulative TSN Ack | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Advertised Receiver Window Credit (a_rwnd) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Number of Gap Ack Blocks = N | Number of Duplicate TSNs = M | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Gap Ack Block #1 Start | Gap Ack Block #1 End | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / / \ ...
/ / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Gap Ack Block #N Start | Gap Ack Block #N End | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Duplicate TSN 1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / / \ ...
/ / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Duplicate TSN M | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Author:

  • Sylvain Daubert

Since:

  • 3.4.0

  • 4.1.0 Remove ErrorMixin and ParameterMixin

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, #to_s

Constructor Details

#initialize(options = {}) ⇒ SackChunk

Returns a new instance of SackChunk.

Since:

  • 3.4.0

  • 4.1.0 Remove ErrorMixin and ParameterMixin



343
344
345
346
# File 'lib/packetgen/header/sctp/chunk.rb', line 343

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

Instance Attribute Details

#a_rwnd ⇒ Integer

32-bit Advertised Receiver Window Credit

Returns:

  • (Integer)


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

define_attr :a_rwnd, BinStruct::Int32

#ctsn_ack ⇒ Integer

32-bit Cumulative TSN Ack

Returns:

  • (Integer)


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

define_attr :ctsn_ack, BinStruct::Int32

#dup_tsns ⇒ BinStruct::ArrayOfInt32

Array of 32-bit Duplicate TSNs.

Returns:

  • (BinStruct::ArrayOfInt32)


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

define_attr :dup_tsns, BinStruct::ArrayOfInt32

#gaps ⇒ BinStruct::ArrayOfInt32

Array of 32-bit Integers, encoding boudaries of a Gap Ack Block. 16 most significant bits encode block start. 16 least significant bits encode block end.

Returns:

  • (BinStruct::ArrayOfInt32)


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

define_attr :gaps, BinStruct::ArrayOfInt32

#num_dup_tsn ⇒ Integer

16-bit Number of Duplicate TSNs

Returns:

  • (Integer)


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

define_attr :num_dup_tsn, BinStruct::Int32

#num_gap ⇒ Integer

16-bit Number of Gap Ack Blocks

Returns:

  • (Integer)


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

define_attr :num_gap, BinStruct::Int32