def start(): s = NonBlockingSniffer("en0", read_timeout=2000) s.filter = "udp and dst port 53" # s.set_loop(IOLoop.instance()).sniff_and_store(q, lambda buf: EthernetII(buf=buf)) # s.set_loop(IOLoop.instance()).sniff_and_export('/Users/stef/baaaa2.pcap') s.set_loop(IOLoop.instance()).sniff_callback(callback)
def handle_int(signum, frame): global stopping NonBlockingSniffer.stop_all() stopping = True IOLoop.instance().stop()