could u please show me sample code of NonBlockingSniffer but i try this code-
from cycapture.libpcap import NonBlockingSniffer
from cycapture.libtins import EthernetII
from collections import deque
try:
q = deque()
sniffer = NonBlockingSniffer(interface="enp9s0", buffer_size=0, snapshot_length=65000)
f = lambda mview: EthernetII.from_buffer(mview)
sniffer.sniff_and_store(container=q, f=f, max_p=-1)
print(len(q))
except KeyboardInterrupt:
pass
But i got error if anyone can help me with that.
Traceback (most recent call last):
File "pycapture_test3.py", line 9, in <module>
sniffer.sniff_and_store(container=q, f=f, max_p=-1)
File "cycapture/libpcap/nonblocking_sniffer.pyx.pxi", line 201, in cycapture.libpcap._pcap.NonBlockingSniffer.sniff_and_store (cycapture/libpcap/_pcap.c:20604)
File "cycapture/libpcap/nonblocking_sniffer.pyx.pxi", line 235, in cycapture.libpcap._pcap.NonBlockingSniffer.sniff_and_store (cycapture/libpcap/_pcap.c:20217)
RuntimeError: set loop and loop_type first
could u please show me sample code of NonBlockingSniffer but i try this code-
But i got error if anyone can help me with that.
@stephane-martin