Class: PacketFu::TcpOption::SACKOK
- Inherits:
-
PacketFu::TcpOption
- Object
- Struct
- PacketFu::TcpOption
- PacketFu::TcpOption::SACKOK
- Defined in:
- lib/packetfu/protos/tcp/option.rb
Overview
Selective Acknowlegment OK option.
Instance Attribute Summary
Attributes inherited from PacketFu::TcpOption
Instance Method Summary collapse
-
#decode ⇒ Object
SACKOK options with sizes other than 2 are malformed.
-
#initialize(args = {}) ⇒ SACKOK
constructor
A new instance of SACKOK.
Methods inherited from PacketFu::TcpOption
#encode, #has_optlen?, #has_value?, #read, #to_s
Methods included from StructFu
#body=, #clone, #set_endianness, #sz, #typecast
Methods inherited from Struct
Constructor Details
#initialize(args = {}) ⇒ SACKOK
Returns a new instance of SACKOK.
186 187 188 189 190 191 |
# File 'lib/packetfu/protos/tcp/option.rb', line 186 def initialize(args={}) super( args.merge(:kind => 4, :optlen => 2) ) end |
Instance Method Details
#decode ⇒ Object
SACKOK options with sizes other than 2 are malformed.
194 195 196 197 198 199 200 |
# File 'lib/packetfu/protos/tcp/option.rb', line 194 def decode if self[:optlen].to_i == 2 "SACKOK" else "SACKOK-bad:#{self[:value]}" end end |