Class: PacketGen::Header::SCTP::ErrorChunk
- Inherits:
-
BaseChunk
- Object
- Types::Fields
- Base
- BaseChunk
- PacketGen::Header::SCTP::ErrorChunk
- Defined in:
- lib/packetgen/header/sctp/chunk.rb
Overview
Operation Error 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 = 9 | Chunk Flags | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\ \
/ zero or more Error Causes /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Direct Known Subclasses
Constant Summary
Constants inherited from BaseChunk
Instance Attribute Summary collapse
Attributes inherited from BaseChunk
Instance Method Summary collapse
-
#calc_length ⇒ void
Calculate lengths, including parameters ones.
-
#initialize(options = {}) ⇒ ErrorChunk
constructor
A new instance of ErrorChunk.
- #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
#initialize(options = {}) ⇒ ErrorChunk
Returns a new instance of ErrorChunk.
404 405 406 407 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 404 def initialize(={}) [:type] = BaseChunk::TYPES['ERROR'] unless .key?(:type) super end |
Instance Attribute Details
#error_causes ⇒ ArrayofError
402 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 402 define_field :error_causes, ArrayOfError |
Instance Method Details
#calc_length ⇒ void
This method returns an undefined value.
Calculate lengths, including parameters ones.
411 412 413 414 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 411 def calc_length error_causes.each(&:calc_length) super end |
#to_human ⇒ ::String
417 418 419 420 421 422 423 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 417 def to_human str = +"<chunk:#{human_type}" flags_str = flags_to_human str << ",flags:#{flags_str}" unless flags_str.empty? str << ",causes:#{error_causes.map(&:to_human).join(',')}" unless error_causes.empty? str << '>' end |