Class: PacketGen::Header::SCTP::InvalidStreamIdError
- Inherits:
-
Object
- Object
- PacketGen::Header::SCTP::InvalidStreamIdError
- Includes:
- ErrorMixin
- Defined in:
- lib/packetgen/header/sctp/error.rb
Overview
InvalidStreamIdentifier error
Instance Method Summary collapse
- #from_human(val) ⇒ Object
-
#stream_identifier ⇒ Integer
Get stream Id value.
-
#stream_identifier=(stream_id) ⇒ Integer
Set stream Id value.
- #to_human ⇒ ::String
Methods included from ErrorMixin
Methods included from Padded32
Instance Method Details
#from_human(val) ⇒ Object
116 117 118 119 |
# File 'lib/packetgen/header/sctp/error.rb', line 116 def from_human(val) super self.value <<= 16 if self[:value] < Types::Int end |
#stream_identifier ⇒ Integer
Get stream Id value
98 99 100 |
# File 'lib/packetgen/header/sctp/error.rb', line 98 def stream_identifier self.value >> 16 end |
#stream_identifier=(stream_id) ⇒ Integer
Set stream Id value
105 106 107 108 |
# File 'lib/packetgen/header/sctp/error.rb', line 105 def stream_identifier=(stream_id) self.value = (stream_id & 0xffff) << 16 stream_id end |
#to_human ⇒ ::String
111 112 113 |
# File 'lib/packetgen/header/sctp/error.rb', line 111 def to_human "<#{error_name}: #{stream_identifier}>" end |