from scapy.all import * # fonction callback def packet_capture(pkt): print(pkt[IP].src, "->",pkt[IP].dst) sniff(prn=packet_capture, filter="ip", count=10)