Class: Ipv4
- Inherits:
-
BinData::Record
- Object
- BinData::Record
- Ipv4
- Defined in:
- lib/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?
35 36 37 |
# File 'lib/ipv4.rb', line 35 def header_length_in_bytes header_length * 4 end |
#length ⇒ Object
43 44 45 |
# File 'lib/ipv4.rb', line 43 def length total_length end |
#options_length_in_bytes ⇒ Object
39 40 41 |
# File 'lib/ipv4.rb', line 39 def header_length_in_bytes - .rel_offset end |