Class: PacketGen::Header::TCP::TS

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

Overview

Timestamp 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

#inspect, #length?, #old_set_value, #to_s

Constructor Details

#initialize(options = {}) ⇒ TS

Returns a new instance of TS.

See Also:



248
249
250
251
# File 'lib/packetgen/header/tcp/option.rb', line 248

def initialize(options={})
  super
  self[:value].read(options[:value] || "\0" * 8)
end

Instance Method Details

#to_humanString

Get human-readable description

Returns:

  • (String)


255
256
257
258
# File 'lib/packetgen/header/tcp/option.rb', line 255

def to_human
  value, echo_reply = self[:value].unpack('NN')
  "TS:#{value};#{echo_reply}"
end