class PacketFu::TcpOption::MSS
Maximum Segment Size option.
Public Class Methods
new(args={})
click to toggle source
Calls superclass method
PacketFu::TcpOption.new
# File lib/packetfu/protos/tcp/option.rb, line 133 def initialize(args={}) super( args.merge(:kind => 2, :optlen => 4 ) ) self[:value] = Int16.new(args[:value]) end
Public Instance Methods
decode()
click to toggle source
MSS options with lengths other than 4 are malformed.
# File lib/packetfu/protos/tcp/option.rb, line 145 def decode if self[:optlen].to_i == 4 "MSS:#{self[:value].to_i}" else "MSS-bad:#{self[:value]}" end end
value=(i)
click to toggle source
# File lib/packetfu/protos/tcp/option.rb, line 142 def value=(i); typecast i; end