Class: PacketGen::Header::SCTP::Error

Inherits:
Object
  • Object
show all
Includes:
ErrorMixin
Defined in:
lib/packetgen/header/sctp/error.rb

Overview

Base class/factory for AbortChunk and ErrorChunk error causes

Author:

  • Sylvain Daubert

Since:

  • 3.4.0

Constant Summary collapse

TYPES =

Error Causes/Types

Since:

  • 3.4.0

{
  'InvalidStreamId' => 1,
  'MissingMandatoryParameter' => 2,
  'StaleCookie' => 3,
  'OutOfResource' => 4,
  'UnresolvableAddress' => 5,
  'UnrecognizedChunkType' => 6,
  'InvalidMandatoryParameter' => 7,
  'UnrecognizedParameters' => 8,
  'NoUserData' => 9,
  'CookieReceivedWhileShuttingDown' => 10,
  'RestartAssociationWithNewAddress' => 11,
  'UserInitiatedAbort' => 12,
  'ProtocolViolation' => 13
}.freeze

Instance Method Summary collapse

Methods included from ErrorMixin

#error_name, #to_human

Methods included from Padded32

#padded?, #to_s

Instance Method Details

#from_human(value) ⇒ Object

Parameters:

  • value (Object)

Since:

  • 3.4.0



56
57
58
59
60
61
62
# File 'lib/packetgen/header/sctp/error.rb', line 56

def from_human(value)
  if value.is_a?(self[:value].class)
    self[:value] = value
  else
    self[:value].from_human(value)
  end
end