Class: PacketGen::Header::TCP::TS
- Defined in:
- lib/packetgen/header/tcp/option.rb
Overview
Timestamp TCP option
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
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ TS
constructor
A new instance of TS.
- #to_human ⇒ String
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
Constructor Details
#initialize(options = {}) ⇒ TS
Returns a new instance of TS.
240 241 242 243 |
# File 'lib/packetgen/header/tcp/option.rb', line 240 def initialize(={}) super .merge!(kind: TS_KIND, length: 10) self[:value] = StructFu::String.new.read([:value] || "\0" * 8) end |
Instance Method Details
#to_human ⇒ String
246 247 248 249 |
# File 'lib/packetgen/header/tcp/option.rb', line 246 def to_human value, echo_reply = self[:value].unpack('NN') "TS:#{value};#{echo_reply}" end |