Class: PacketGen::Header::SCTP::InitChunk
- Inherits:
-
BaseChunk
- Object
- Types::Fields
- Base
- BaseChunk
- PacketGen::Header::SCTP::InitChunk
- Defined in:
- lib/packetgen/header/sctp/chunk.rb
Overview
Init 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 = 1 | Chunk Flags | Chunk Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Initiate Tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertised Receiver Window Credit (a_rwnd) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of Outbound Streams | Number of Inbound Streams |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Initial TSN |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \
/ Optional/Variable-Length Parameters /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Direct Known Subclasses
Constant Summary
Constants inherited from BaseChunk
Instance Attribute Summary collapse
-
#a_wrnd ⇒ Integer
32-bit Advertised Receiver Window Credit (a_rwnd).
-
#initial_tsn ⇒ Integer
32-bit Initial TSN.
-
#initiate_tag ⇒ Integer
32-bit Initiate Tag.
-
#nis ⇒ Integer
16-bit Number of Inbound Streams.
-
#nos ⇒ Integer
16-bit Number of Outbound Streams.
-
#parameters ⇒ ArrayOfParameter
List of parameters.
Attributes inherited from BaseChunk
Instance Method Summary collapse
-
#calc_length ⇒ void
Calculate lengths, including parameters ones.
-
#initialize(options = {}) ⇒ InitChunk
constructor
A new instance of InitChunk.
- #to_human ⇒ ::String
Methods inherited from BaseChunk
Methods included from Padded32
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
Instance Attribute Details
#a_wrnd ⇒ Integer
32-bit Advertised Receiver Window Credit (a_rwnd)
219 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 219 define_field :a_rwnd, Types::Int32 |
#initial_tsn ⇒ Integer
32-bit Initial TSN
231 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 231 define_field :initial_tsn, Types::Int32 |
#initiate_tag ⇒ Integer
32-bit Initiate Tag
215 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 215 define_field :initiate_tag, Types::Int32 |
#nis ⇒ Integer
16-bit Number of Inbound Streams
227 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 227 define_field :nis, Types::Int16 |
#nos ⇒ Integer
16-bit Number of Outbound Streams
223 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 223 define_field :nos, Types::Int16 |
#parameters ⇒ ArrayOfParameter
List of parameters
235 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 235 define_field :parameters, ArrayOfParameter |
Instance Method Details
#calc_length ⇒ void
This method returns an undefined value.
Calculate lengths, including parameters ones.
244 245 246 247 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 244 def calc_length parameters.each(&:calc_length) super end |
#to_human ⇒ ::String
250 251 252 253 254 255 256 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 250 def to_human str = +"<chunk:#{human_type}" flags_str = flags_to_human str << ",flags:#{flags_str}" unless flags_str.empty? str << ",param:#{parameters.map(&:to_human).join(',')}" unless parameters.empty? str << '>' end |