Class: PacketFu::TcpOption::SACKOK
- Inherits:
-
PacketFu::TcpOption
- Object
- Struct
- PacketFu::TcpOption
- PacketFu::TcpOption::SACKOK
- Defined in:
- lib/packetfu/protos/tcp.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.
393 394 395 396 397 398 |
# File 'lib/packetfu/protos/tcp.rb', line 393 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.
401 402 403 404 405 406 407 |
# File 'lib/packetfu/protos/tcp.rb', line 401 def decode if self[:optlen].to_i == 2 "SACKOK" else "SACKOK-bad:#{self[:value]}" end end |