Class: Tcp

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/tcp.rb

Instance Method Summary collapse

Instance Method Details

#header_length_in_bytesObject

virtual assert: :checksum_valid?



29
30
31
# File 'lib/tcp.rb', line 29

def header_length_in_bytes
  data_offset * 4
end

#lengthObject



37
38
39
# File 'lib/tcp.rb', line 37

def length
  header_length_in_bytes + options_length_in_bytes + payload.length
end

#options_length_in_bytesObject



33
34
35
# File 'lib/tcp.rb', line 33

def options_length_in_bytes
  header_length_in_bytes - options.rel_offset
end