überall (auf dem Raspberry Pi Gerät) läuft dieses Skript aber nicht auf dem virtualisierten Raspberry Pi Desktop x86 Server!
Der Raspberry Pi Desktop x86 läuft als VM. Ich kann das Skript nicht ausführen. Ich bekomme ständig eine Fehlermeldung.
Script:
Code: Alles auswählen
from scapy.all import *
def arp_display(pkt):
if pkt.haslayer(DHCP):
print pkt[Ether].src
print "Druecken Sie den Dashbutton"
print sniff(prn=arp_display, filter="(udp and (port 67 or 68))", store=0)
Code: Alles auswählen
Druecken Sie den Dashbutton
Traceback (most recent call last):
File "dash_button_detect.py", line 8, in <module>
print sniff(prn=arp_display, filter="(udp and (port 67 or 68))", store=0)
File "/usr/lib/python2.7/dist-packages/scapy/sendrecv.py", line 593, in sniff
**karg)]
File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 496, in __init__
attach_filter(self.ins, filter, iface)
File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 157, in attach_filter
s.setsockopt(SOL_SOCKET, SO_ATTACH_FILTER, bpfh)
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 22] Invalid argument