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?
34 35 36 |
# File 'lib/ipv4.rb', line 34 def header_length_in_bytes header_length * 4 end |
#length ⇒ Object
42 43 44 |
# File 'lib/ipv4.rb', line 42 def length total_length end |
#options_length_in_bytes ⇒ Object
38 39 40 |
# File 'lib/ipv4.rb', line 38 def header_length_in_bytes - .rel_offset end |