Class: PacketFu::TcpOption::WS
- Inherits:
-
PacketFu::TcpOption
- Object
- Struct
- PacketFu::TcpOption
- PacketFu::TcpOption::WS
- Defined in:
- lib/packetfu/protos/tcp.rb
Overview
Window Size option.
Instance Attribute Summary
Attributes inherited from PacketFu::TcpOption
Instance Method Summary collapse
-
#decode ⇒ Object
WS options with lengths other than 3 are malformed.
-
#initialize(args = {}) ⇒ WS
constructor
A new instance of WS.
- #value=(i) ⇒ Object
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
Instance Method Details
#decode ⇒ Object
WS options with lengths other than 3 are malformed.
379 380 381 382 383 384 385 |
# File 'lib/packetfu/protos/tcp.rb', line 379 def decode if self[:optlen].to_i == 3 "WS:#{self[:value].to_i}" else "WS-bad:#{self[:value]}" end end |
#value=(i) ⇒ Object
376 |
# File 'lib/packetfu/protos/tcp.rb', line 376 def value=(i); typecast i; end |