Class: PacketGen::Header::SCTP::DataChunk
- Inherits:
-
BaseChunk
- Object
- Types::Fields
- Base
- BaseChunk
- PacketGen::Header::SCTP::DataChunk
- 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) /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Constant Summary
Constants inherited from BaseChunk
Instance Attribute Summary collapse
-
#body ⇒ String
SCTP chunk value.
-
#flag_b ⇒ Boolean
BEGINNING fragment flag.
-
#flag_e ⇒ Boolean
ENDING fragment flag.
-
#flag_i ⇒ Boolean
IMMEDIATE flag.
-
#flag_u ⇒ Boolean
UNORDERED flag.
-
#ppid ⇒ Integer
32-bit payload protocol identifier.
-
#stream_id ⇒ Integer
16-bit stream identifier.
-
#stream_sn ⇒ Integer
16-bit stream sequence number.
-
#tsn ⇒ Integer
32-bit TSN for this DATA chunk.
Attributes inherited from BaseChunk
Method Summary
Methods inherited from BaseChunk
#calc_length, #human_type, #to_human
Methods included from Padded32
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
#body ⇒ String
SCTP chunk value
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_b ⇒ Boolean
BEGINNING fragment flag
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_e ⇒ Boolean
ENDING fragment flag
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_i ⇒ Boolean
IMMEDIATE flag
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_u ⇒ Boolean
UNORDERED flag
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 |
#ppid ⇒ Integer
32-bit payload protocol identifier
160 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 160 define_field :ppid, Types::Int32 |
#stream_id ⇒ Integer
16-bit stream identifier
152 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 152 define_field :stream_id, Types::Int16 |