Class: ServiceObjects::CraftArpPacket

Inherits:
Object
  • Object
show all
Defined in:
lib/ownlan/service_objects/craft_arp_packets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(saddr, daddr, saddr_ip, daddr_ip, opcode = 2) ⇒ CraftArpPacket

Returns a new instance of CraftArpPacket.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ownlan/service_objects/craft_arp_packets.rb', line 6

def initialize(saddr, daddr, saddr_ip, daddr_ip, opcode = 2)
  arp_packet = ::PacketFu::ARPPacket.new

  arp_packet.eth_saddr     = saddr
  arp_packet.eth_daddr     = daddr
  arp_packet.arp_saddr_mac = saddr
  arp_packet.arp_daddr_mac = daddr
  arp_packet.arp_saddr_ip  = saddr_ip
  arp_packet.arp_daddr_ip  = daddr_ip
  arp_packet.arp_opcode    = opcode

  @packet = arp_packet
end

Instance Attribute Details

#packetObject (readonly)

Returns the value of attribute packet.



4
5
6
# File 'lib/ownlan/service_objects/craft_arp_packets.rb', line 4

def packet
  @packet
end

Instance Method Details

#callObject



20
21
22
# File 'lib/ownlan/service_objects/craft_arp_packets.rb', line 20

def call
  packet
end