Class: PacketGen::Header::SCTP::ErrorChunk
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
-
#error_causes ⇒ ArrayOfError
Causes for this error chunk.
Attributes inherited from BaseChunk
Instance Method Summary collapse
-
#calc_length ⇒ void
Calculate lengths, including causes ones.
-
#initialize(options = {}) ⇒ ErrorChunk
constructor
A new instance of ErrorChunk.
-
#to_human ⇒ ::String
Get human-readable description.
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, #to_s
Constructor Details
#initialize(options = {}) ⇒ ErrorChunk
Returns a new instance of ErrorChunk.
423 424 425 426 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 423 def initialize(={}) [:type] = BaseChunk::TYPES['ERROR'] unless .key?(:type) super end |
Instance Attribute Details
#error_causes ⇒ ArrayOfError
Causes for this error chunk
421 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 421 define_attr :error_causes, ArrayOfError |
Instance Method Details
#calc_length ⇒ void
This method returns an undefined value.
Calculate lengths, including causes ones.
430 431 432 433 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 430 def calc_length error_causes.each(&:calc_length) super end |
#to_human ⇒ ::String
Get human-readable description
437 438 439 440 441 442 443 |
# File 'lib/packetgen/header/sctp/chunk.rb', line 437 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 |