Class: PacketGen::Header::TCP::WS

Inherits:
Option show all
Defined in:
lib/packetgen/header/tcp/option.rb

Overview

Window Size TCP option

Author:

  • Sylvain Daubert

Constant Summary

Constants inherited from Option

Option::ECHOREPLY_KIND, Option::ECHO_KIND, Option::EOL_KIND, Option::MSS_KIND, Option::NOP_KIND, Option::SACKOK_KIND, Option::SACK_KIND, Option::TS_KIND, Option::WS_KIND

Instance Attribute Summary

Attributes inherited from Option

#kind, #length, #value

Instance Method Summary collapse

Methods inherited from Option

#has_length?, #inspect, #read, #to_s

Methods included from StructFu

#body=, #clone, #set_endianness, #sz, #to_s, #typecast

Methods inherited from Struct

#force_binary

Constructor Details

#initialize(options = {}) ⇒ WS

Returns a new instance of WS.

See Also:



176
177
178
179
# File 'lib/packetgen/header/tcp/option.rb', line 176

def initialize(options={})
  super options.merge!(kind: WS_KIND, length: 3)
  self[:value] = Int8.new(options[:value])
end

Instance Method Details

#to_humanString

Returns:



182
183
184
# File 'lib/packetgen/header/tcp/option.rb', line 182

def to_human
  "WS:#{value}"
end