Class: PacketGen::Header::SCTP::DataChunk

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

Overview

Data 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 = 0    |  Res  |I|U|B|E|            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              TSN                              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Stream Identifier S      |   Stream Sequence Number n    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Payload Protocol Identifier                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\                                                               \
/                 User Data (seq n of Stream S)                 /
\                                                               \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

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

Method Summary

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

#bodyString

SCTP chunk value

Returns:

  • (String)


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

define_field :body, Types::String, builder: ->(h, t) { t.new(length_from: -> { h.length - 4 }) }

#flag_bBoolean

BEGINNING fragment flag

Returns:

  • (Boolean)


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

define_bit_fields_on :flags, :flag_res, 4, :flag_i, :flag_u, :flag_b, :flag_e

#flag_eBoolean

ENDING fragment flag

Returns:

  • (Boolean)


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

define_bit_fields_on :flags, :flag_res, 4, :flag_i, :flag_u, :flag_b, :flag_e

#flag_iBoolean

IMMEDIATE flag

Returns:

  • (Boolean)


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

define_bit_fields_on :flags, :flag_res, 4, :flag_i, :flag_u, :flag_b, :flag_e

#flag_uBoolean

UNORDERED flag

Returns:

  • (Boolean)


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

define_bit_fields_on :flags, :flag_res, 4, :flag_i, :flag_u, :flag_b, :flag_e

#ppidInteger

32-bit payload protocol identifier

Returns:

  • (Integer)


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

define_field :ppid, Types::Int32

#stream_idInteger

16-bit stream identifier

Returns:

  • (Integer)


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

define_field :stream_id, Types::Int16

#stream_snInteger

16-bit stream sequence number

Returns:

  • (Integer)


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

define_field :stream_sn, Types::Int16

#tsnInteger

32-bit TSN for this DATA chunk

Returns:

  • (Integer)


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

define_field :tsn, Types::Int32