Class: PcapTools::Parser::IP_PDU

Inherits:
BinData::Record
  • Object
show all
Includes:
HasParent
Defined in:
lib/pcap_parser.rb

Overview

IP Protocol Data Unit

Instance Attribute Summary

Attributes included from HasParent

#parent

Instance Method Summary collapse

Instance Method Details

#header_length_in_bytesObject



129
130
131
# File 'lib/pcap_parser.rb', line 129

def header_length_in_bytes
  header_length * 4
end

#options_length_in_bytesObject



133
134
135
# File 'lib/pcap_parser.rb', line 133

def options_length_in_bytes
  header_length_in_bytes - options.rel_offset
end

#payload_length_in_bytesObject



137
138
139
# File 'lib/pcap_parser.rb', line 137

def payload_length_in_bytes
  total_length - header_length_in_bytes
end

#typeObject



141
142
143
# File 'lib/pcap_parser.rb', line 141

def type
  "IP"
end