1#!/usr/local/bin/python3
2# send Address Resolution Protocol Request to Ethernet broadcast address
3# expect no answer
4
5import os
6from addr import *
7from scapy.all import *
8
9arp=ARP(op='who-has', hwsrc="ff:ff:ff:ff:ff:ff", psrc=LOCAL_ADDR,
10    hwdst="ff:ff:ff:ff:ff:ff", pdst=REMOTE_ADDR)
11eth=Ether(src=LOCAL_MAC, dst="ff:ff:ff:ff:ff:ff")/arp
12
13e=srp1(eth, iface=LOCAL_IF, timeout=2)
14
15if e and e.type == ETH_P_ARP:
16	a=e.payload
17	a.show()
18	print("ARP REPLY")
19	exit(1)
20
21print("no arp reply")
22exit(0)
23