Module: Pio::IPv4Header
- Includes:
- Payload
- Included in:
- Dhcp::Frame, Pio::Icmp::Format, PacketIn::DataParser::IPv4Packet, Udp
- Defined in:
- lib/pio/ipv4_header.rb
Overview
IP Version 4 Header Format
Defined Under Namespace
Modules: ProtocolNumber
Class Method Summary collapse
-
.included(klass) ⇒ Object
rubocop:disable MethodLength rubocop:disable AbcSize This method smells of :reek:TooManyStatements.
Methods included from Payload
Class Method Details
.included(klass) ⇒ Object
rubocop:disable MethodLength rubocop:disable AbcSize This method smells of :reek:TooManyStatements
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/pio/ipv4_header.rb', line 18 def self.included(klass) def klass.ipv4_header( = {}) bit4 :ip_version, value: 0x4 bit4 :ip_header_length, initial_value: 0x5 uint8 :ip_type_of_service, initial_value: 0 uint16be :ip_total_length, initial_value: :calculate_ip_length uint16be :ip_identifier, initial_value: 0 bit3 :ip_flag, initial_value: 0 bit13 :ip_fragment, initial_value: 0 uint8 :ip_ttl, initial_value: 128 uint8 :ip_protocol, initial_value: [:ip_protocol] || 0 uint16be :ip_header_checksum, initial_value: :calculate_ip_checksum ip_address :ip_source_address ip_address :ip_destination_address string :ip_option, read_length: :ip_option_length end end |