Class: PacketFu::TcpOption::WS
- Inherits:
-
PacketFu::TcpOption
- Object
- Struct
- PacketFu::TcpOption
- PacketFu::TcpOption::WS
- Defined in:
- lib/packetfu/protos/tcp/option.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.
172 173 174 175 176 177 178 |
# File 'lib/packetfu/protos/tcp/option.rb', line 172 def decode if self[:optlen].to_i == 3 "WS:#{self[:value].to_i}" else "WS-bad:#{self[:value]}" end end |
#value=(i) ⇒ Object
169 |
# File 'lib/packetfu/protos/tcp/option.rb', line 169 def value=(i); typecast i; end |