Class: PacketFu::TcpOption::MSS
- Inherits:
-
PacketFu::TcpOption
- Object
- Struct
- PacketFu::TcpOption
- PacketFu::TcpOption::MSS
- Defined in:
- lib/packetfu/protos/tcp/option.rb
Overview
Maximum Segment Size option.
Instance Attribute Summary
Attributes inherited from PacketFu::TcpOption
Instance Method Summary collapse
-
#decode ⇒ Object
MSS options with lengths other than 4 are malformed.
-
#initialize(args = {}) ⇒ MSS
constructor
A new instance of MSS.
- #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
MSS options with lengths other than 4 are malformed.
146 147 148 149 150 151 152 |
# File 'lib/packetfu/protos/tcp/option.rb', line 146 def decode if self[:optlen].to_i == 4 "MSS:#{self[:value].to_i}" else "MSS-bad:#{self[:value]}" end end |
#value=(i) ⇒ Object
143 |
# File 'lib/packetfu/protos/tcp/option.rb', line 143 def value=(i); typecast i; end |