Class: PacketGen::Header::TCP::MSS

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

Overview

Maximum Segment 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, #read, #to_s

Methods inherited from Base

bind_header, #header_id, inherited, #ip_header, known_headers, #parse?, #protocol_name

Methods inherited from Types::Fields

#[], #[]=, #body=, define_bit_fields_on, define_field, define_field_after, define_field_before, #fields, #force_binary, inherited, #inspect, #read, #sz, #to_h, #to_s

Constructor Details

#initialize(options = {}) ⇒ MSS

Returns a new instance of MSS.

See Also:



145
146
147
148
# File 'lib/packetgen/header/tcp/option.rb', line 145

def initialize(options={})
  super options.merge!(kind: MSS_KIND, length: 4)
  self[:value] = Types::Int16.new(options[:value])
end

Instance Method Details

#to_humanString

Returns:

  • (String)


151
152
153
# File 'lib/packetgen/header/tcp/option.rb', line 151

def to_human
  "MSS:#{value}"
end