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

Attributes inherited from Base

#packet

Instance Method Summary collapse

Methods inherited from Option

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

Methods inherited from Base

#added_to_packet, bind, bind_header, calculate_and_set_length, #header_id, inherited, #ip_header, known_headers, #ll_header, #method_name, #parse?, #protocol_name, protocol_name

Methods inherited from Types::Fields

#[], #[]=, #bits_on, #body=, define_bit_fields_on, define_field, define_field_after, define_field_before, delete_field, fields, #fields, #force_binary, inherited, #inspect, #is_optional?, #is_present?, #offset_of, #optional?, #optional_fields, #present?, #read, remove_bit_fields_on, remove_field, #sz, #to_h, #to_s, update_field

Constructor Details

#initialize(options = {}) ⇒ WS

Returns a new instance of WS.

See Also:



172
173
174
175
# File 'lib/packetgen/header/tcp/option.rb', line 172

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

Instance Method Details

#to_humanString



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

def to_human
  "WS:#{value}"
end