Class: PacketProtocols::Ipv4
- Inherits:
-
BinData::Record
- Object
- BinData::Record
- PacketProtocols::Ipv4
- Defined in:
- lib/packet-protocols/ipv4.rb
Constant Summary collapse
- PROTOCOLS =
{ icmp: 1, tcp: 6, udp: 17 }
Instance Method Summary collapse
-
#header_length_in_bytes ⇒ Object
virtual assert: :checksum_valid?.
- #length ⇒ Object
- #options_length_in_bytes ⇒ Object
Instance Method Details
#header_length_in_bytes ⇒ Object
virtual assert: :checksum_valid?
36 37 38 |
# File 'lib/packet-protocols/ipv4.rb', line 36 def header_length_in_bytes header_length * 4 end |
#length ⇒ Object
44 45 46 |
# File 'lib/packet-protocols/ipv4.rb', line 44 def length total_length end |
#options_length_in_bytes ⇒ Object
40 41 42 |
# File 'lib/packet-protocols/ipv4.rb', line 40 def header_length_in_bytes - .rel_offset end |