Class PacketFu::ARPHeader
In: lib/packetfu/arp.rb
Parent: Struct.new(:arp_hw, :arp_proto, :arp_hw_len, :arp_proto_len, :arp_opcode, :arp_src_mac, :arp_src_ip, :arp_dst_mac, :arp_dst_ip, :body)

ARPHeader is a complete ARP struct, used in ARPPacket.

ARP is used to discover the machine address of nearby devices.

See www.networksorcery.com/enp/protocol/arp.htm for details.

Header Definition

      Int16   :arp_hw          Default: 1       # Ethernet
      Int16   :arp_proto,      Default: 0x8000  # IP
      Int8    :arp_hw_len,     Default: 6
      Int8    :arp_proto_len,  Default: 4
      Int16   :arp_opcode,     Default: 1       # 1: Request, 2: Reply, 3: Request-Reverse, 4: Reply-Reverse
      EthMac  :arp_src_mac                      # From eth.rb
      Octets  :arp_src_ip                       # From ip.rb
      EthMac  :arp_dst_mac                      # From eth.rb
      Octets  :arp_dst_ip                       # From ip.rb
      String  :body

Methods

Included Modules

StructFu

Public Class methods

Public Instance methods

Get a more readable destination IP address.

Set a more readable destination IP address.

Get a more readable source MAC address.

Set the destination MAC address in a more readable way.

Getter for the ARP destination IP address.

Setter for the ARP destination IP address.

Setter for the ARP destination MAC address.

Setter for the ARP destination MAC address.

Getter for the ARP hardware type.

Setter for the ARP hardware type.

Getter for the ARP hardware type length.

Setter for the ARP hardware type length.

Getter for the ARP opcode.

Setter for the ARP opcode.

Getter for the ARP protocol length.

Getter for the ARP protocol.

Setter for the ARP protocol.

Setter for the ARP protocol length.

Get a more readable source IP address.

Set a more readable source IP address.

Get a more readable source MAC address.

Set the source MAC address in a more readable way.

Setter for the ARP source IP address.

Getter for the ARP source IP address.

Getter for the ARP source MAC address.

Setter for the ARP source MAC address.

Reads a string to populate the object.

Returns the object in string form.

[Validate]